Previous Up Next

6.2  Types and modes

The templates part defines, for each argument of the concerned built-in predicate, its mode and type. The mode specifies whether or not the argument must be instantiated when the built-in predicate is called. The mode is encoded with a symbol just before the type. Possible modes are:

The type of an argument is defined by the following table:

TypeDescription
TYPE_lista list whose the type of each element is TYPE
TYPE1_or_TYPE2a term whose type is either TYPE1 or TYPE2
atoman atom
atom_propertyan atom property (section 8.19.11)
booleanthe atom true or false
bytean integer ≥ 0 and ≤ 255
callable_terman atom or a compound term
charactera single character atom
character_codean integer ≥ 1 and ≤ 255
clausea clause (fact or rule)
close_optiona close option (section 8.10.7)
compound_terma compound term
evaluablean arithmetic expression (section 8.6.1)
fd_bool_evaluablea boolean FD expression (section 9.7.1)
fd_labeling_optionan FD labeling option (section 9.9.1)
fd_evaluablean arithmetic FD expression (section 9.6.1)
fd_variablean FD variable
flaga Prolog flag (section 8.22.1)
floata floating point number
heada head of a clause (atom or compound term)
integeran integer
in_bytean integer ≥ 0 and ≤ 255 or -1 (for the end-of-file)
in_charactera single character atom or the atom end_of_file (for the end-of-file)
in_character_codean integer ≥ 1 and ≤ 255 or -1 (for the end-of-file)
io_modean atom in: read, write or append
listthe empty list [] or a non-empty list [_|_]
nonvarany term that is not a variable
numberan integer or a floating point number
operator_specifieran operator specifier (section 8.14.10)
os_file_propertyan operating system file property (section 8.27.11)
predicate_indicatora term Name/Arity where Name is an atom and Arity an integer ≥ 0. A callable term can be given if the strict_iso Prolog flag is switched off (section 8.22.1)
predicate_propertya predicate property (section 8.8.2)
read_optiona read option (section 8.14.1)
socket_addressa term of the form ’AF_UNIX’(A) or ’AF_INET’(A,N) where A is an atom and N an integer
socket_domainan atom in: ’AF_UNIX’ or ’AF_INET’
source_sinkan atom identifying a source or a sink
streama stream-term: a term of the form ’$stream’(N) where N is an integer ≥ 0
stream_optiona stream option (section 8.10.6)
stream_or_aliasa stream-term or an alias (atom)
stream_positiona stream position: a term ’$stream_position’(I1, I2, I3, I4) where I1, I2, I3 and I4 are integers
stream_propertya stream property (section 8.10.10)
stream_seek_methodan atom in: bof, current or eof
termany term
var_binding_optiona variable binding option (section 8.5.3)
write_optiona write option (section 8.14.6)

Copyright (C) 1999-2021 Daniel Diaz Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. More about the copyright
Previous Up Next