[ Reference Manual | Alphabetic Index ]

Term Manipulation

Built-ins to convert, compose, decompose and modify terms

Predicates

?Term =.. ?List
Univ --- Succeeds if List is the list which has Term's functor as its first element and Term's arguments, if any, as its successive elements.
C(?Input, ?Token, ?Rest)
Specifies how DCG grammar rules get a token from their input.
add_attribute(?Var, ?Attribute)
Add dynamically an attribute to a variable
add_attribute(?Var, ?Attribute, +AttrName)
Add dynamically an attribute to a variable.
arg(+N, +Term, -Arg)
Succeeds if Arg is the Nth argument of the compound term Term.
arity(+Term, -Arity)
Succeeds if Arity is the arity of Term.
array_concat(+Front, +Back, -Concat)
Concatenate two arrays into one
array_flat(+N, +Array, -Flat)
Flattens (reduces the number of dimensions) of a multi-dimensional array
array_list(?Array, ?List)
Conversion between array and list
bytes_to_term(+String, -Term)
Converts String, which is supposed to be an encoding of a term, into Term.
char_code(?Char, ?Code)
Succeeds if Code is the numeric character code of the character Char.
copy_term(?OldTerm, -NewTerm)
A copy of OldTerm with new variables is created and unified with NewTerm.
copy_term(?OldTerm, -NewTerm, -AttrVars)
A copy of OldTerm with new variables is created and unified with NewTerm. AttrVars is a list mapping the attributed variables in OldTerm to the corresponding variables in NewTerm.
copy_term_vars(?Vars, ?OldTerm, -NewTerm)
NewTerm gets unified with a variant of OldTerm where all occurrences of variables in Vars are replaced by fresh variables.
dim(?Array, ?Dimensions)
Creates a multi-dimensional array or or computes the dimensions of an existing one
eval_to_array(?Collection, ?Result)
Equate a "collection" expression with an array
eval_to_complete_list(?Collection, ?Result)
Equate a "collection" expression with a list
eval_to_list(?Collection, ?Result)
Equate a "collection" expression with a list
functor(?Term, ?Functor, ?Arity)
Succeeds if the compound term Term has functor Functor and arity Arity or if Term and Functor are atomic and equal, and Arity is 0.
get_var_bounds(?Var, -Lower, -Upper)
Retrieve bounds of a numeric variable in a generic way
meta_attribute(+Name, ++Handlers)
Declares the variable attribute Name with the corresponding handlers
meta_bind(-Meta, ?Term)
The attributed variable Meta is bound to the term Term without triggering the metaterm-unification event.
set_var_bounds(?Var, +Lower, +Upper)
Impose bounds on a numeric variable in a generic way
setarg(+N, +Term, ?Arg)
Destructively replaces the Nth argument of the compound term Term with the term Arg.
subscript(+Term, ++Subscript, -Elem)
Accesses the subterm Elem of Term, as specified by Subscript
term_string(?Term, ?String)
Conversion between a Prolog term and a string.
term_string(?Term, ?String, +Options)
Configurable conversion between a Prolog term and a string.
term_to_bytes(?Term, -String)
String is a ground encoding of Term, suitable for writing to a file, transmitting over a network etc.
term_variables(?Term, -VarList)
Succeeds if VarList is the list of all variables in Term.
term_variables_array(?Term, -VarArr)
Succeeds if VarArr is an array containing all variables in Term.
term_variables_count(?Term, -N)
Succeeds if N is the number of distinct variables in Term.
update_struct(+StructName, +FieldList, ?OldStruct, ?NewStruct)
NewStruct is the same as OldStruct except that the fields in FieldList have been replaced

Generated from termmanip.eci on 2022-09-03 14:26