Section "univ"

Prolog terms are at the heart of a Prolog system. The Dogelog player is not different. Internally it uses host language objects that represent Prolog terms. Visible for the user are the usual ISO core standard built-ins dealing with Prolog terms. The number of arguments of a Prolog term is only limited by the possible size of a host language array.

The following built-ins are provided:

ground(T): [TC2 8.3.10]
The built-in succceeds if T is ground.
term_variables(T, L): [TC2 8.5.5]
The built-in succeeds in L with the variables of T.
S = T: [ISO 8.2.1]
The built-in succeeds when the Prolog terms S and T unify, otherwise the built-in fails.
S \= T: [ISO 8.2.3]
The built-in succeeds when the Prolog terms S and T do not unify, otherwise the built-in fails.
copy_term(S, T): [ISO 8.5.4]
The built-in succeeds in T with a copy of S.
T =.. [F|L]: [ISO 8.5.3]
If T is a variable, the built-in succeeds in T with the Prolog term from the functor F and arguments L. Otherwise the built-in succeeds in F and L with the functor and arguments of the Prolog term T.
functor(T, F, A): [ISO 8.5.1]
If T is a variable, the built-in succeeds in T with a new Prolog term from the functor F and the arity A. Otherwise the built-in succeeds in F and L with the functor and arguments of the Prolog term T.
arg(K, X, Y): [ISO 8.5.2]
The predicate succeeds in Y with the K-th argument of X.
change_arg(K, X, Y):
The predicate succeeds. As a side-effect the K-th argument of X is set to Y.

Kommentare