All Built-ins

Lists

List manipulation and querying predicates

Length(?XS, ?N)

True if Length represents the number of elements in List. This predicate is a true relation and can be used to find the length of a list or produce a list (holding variables) of length Length.

Is_list(?XS)

Checks if XS is a proper list. If XS is a variable, returns false.

Elem(?X, ?XS)

Checks if X is an element of the list XS.

Append(?XS, ?YS, ?ZS)

Appends the list XS to the list YS, and unifies the result with ZS.

Reverse(?XS, ?YS)

Reverses the list XS, and unifies the result with YS.

Nth(?N, ?XS, ?X)

Gets the Nth element of the list XS, and unifies it with X. The first element is at index 0.