File "compat"

This file provides compatibility predicates and evaluable functions. The predicate number/3 assigns the compound ‘$VAR’/1 to variables, enumerating integers for the first argument of the compound. The predicate is not required by the ISO core standard, although the ISO core standard wants that the write predicates understand the compound.

This file also introduces higher order logic programming to the Dogelog Player Prolog systems, in that we support the predicates call/n. The predicates are not realized inside the Novacore, but have to be explicitly requested through this files. The predicates are currently realized for the arities n = 2..8.

The following compat predicates are provided:

forall(A, B): [N208 8.10.4]
The predicate succeeds when there is no success of A such that B fails. Otherwise, the predicate fails.
numbervars(X, N, M):
The predicate instantiates the un-instantiated variables of the term X with compounds of the form ‘$VAR’(<index>). The <index> starts with N. The predicate succeeds when M unifies with the next available <index>.
unify_with_occurs_check(S, T): [ISO 8.2.2]
The built-in succeeds when the Prolog terms S and T unify with occurs check, otherwise the built-in fails.
subsumes(X, Y):
The built-in succeeds if X subsumes Y.
subsumes_term(X, Y): [ISO 8.2.4]
The built-in succeeds if X subsumes Y without keeping the bindings.
term_hash(X, H):
The predicate succeeds in H with the hash of the term X.
term_singletons(T, L):
The built-in succeeds in L with the singleton variables of T.
nonground(T, V):
The built-in succeeds if T is non-ground and V is the first variable.
unnumbervars(S, N, T):
The predicate succeeds in T with a copy of S with compounds of the form ‘$VAR’(<index>) and <index> greater or equal N are replaced by fresh variables.
call(F, A1, .., An): [Corr.2 8.15.4.4]
The predicate succeeds in calling the goal which results from appending the arguments A1, .., An to the callable F.

Kommentare