Section "prologue"

In this section, we list common predefined Prolog predicates that are bootstrapped in Prolog itself with or without the help of predefined built-ins. The predefined predicates here mainly defined some convenience related to list processing.

The following lists predicates are provided:

member(E, L):
The predicate succeeds for every member E of the list L.
select(E, L, R):
The predicate succeeds for every member E of the L with remainder list R.
number_codes(A, B): [ISO 8.16.8]
If A is a variable, then the predicate succeeds in A with the number from the Prolog list B. Otherwise the predicates succeeds in B with the Prolog list for the number A.
findall(T, G, L): [ISO 8.10.1]
The predicate succeeds in L with all T such that G succeeds.
list_to_set(L, S):
The predicate succeeds in S with the deduplication of L.
reverse(L, R):
The predicate succeeds in R with the reverse of L. Currently only implemented for mode reverse(+, -).
append(L, R, S):
The predicate succeeds whenever S unifies with the concatenation of L and R.
between(L, H, X):
The predicate succeeds for every integer X between L and H. Currently only implemented for mode between(+, +, -).
length(L, N):
The predicate succeeds with N being the length of the list L. Currently only implemented for mode length(+, -).

Kommentare