Section "term"

The term API provides the creation and basic operations of Prolog terms. Currently there are no API calls to access the content of Prolog terms, since they are mapped to classes of the host language and the API client can directly access the fields of these classes. This gives more speed in the implementation of built-ins through the native API.

The mapping to classes is lean, in that only Prolog variables and Prolog compounds have their own classes. Otherwise, the objects form the host language are used to represent Prolog atomics. Among the Prolog atomics are Prolog references, which are everything that is neither a Prolog atom or a Prolog number.

The following term API calls are provided:

deref(T) (host language)
Return the dereferencing of the term T.
copy_term(T): (host language)
Return a copy of the term T.
is_variable(T): (host language)
Check whether the object T is a variable.
is_compound(T): (host language)
Check whether the object T is a compound.
is_atom(T): (host language)
Check whether the object T is an atom.
is_number(T): (host language)
Check whether the object T is a number.
is_integer(T): (host language)
Check whether the object T is an integer.
is_float(T): (host language)
Check whether the object T is a float.
unify(S, T): (host language)
Determine whether the two terms S and T unify.
equal_term(S, T): (host language)
Determine whether the two terms S and T are syntactically equivalent.
compare_term(S, T): (host language)
Return the syntactic relationship between the two terms S and T.
narrow_float(T): (host language)
Return the Prolog number T narrowed to a float.

Kommentare