PublicShow sourcelists.pl -- List Manipulation

This library provides commonly accepted basic predicates for list manipulation in the Prolog community. Some additional list manipulations are built-in. See e.g., memberchk/2, length/2.

The implementation of this library is copied from many places. These include: "The Craft of Prolog", the DEC-10 Prolog library (LISTRO.PL) and the YAP lists library. Some predicates are reimplemented based on their specification by Quintus and SICStus.

Compatibility
- Virtually every Prolog system has library(lists), but the set of provided predicates is diverse. There is a fair agreement on the semantics of most of these predicates, although error handling may vary.
Source member(?Elem, ?List)
True if Elem is a member of List. The SWI-Prolog definition differs from the classical one. Our definition avoids unpacking each list element twice and provides determinism on the last element. E.g. this is deterministic:
    member(X, [One]).
author
- Gertjan van Noord

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

Source sum_list(Arg1, Arg2)
Source permutation(Arg1, Arg2)
Source last(Arg1, Arg2)
Source nth0(Arg1, Arg2, Arg3)
Source selectchk(Arg1, Arg2, Arg3)
Source append(Arg1, Arg2)
Source subset(Arg1, Arg2)
Source is_set(Arg1)
Source min_member(Arg1, Arg2)
Source reverse(Arg1, Arg2)
Source nth1(Arg1, Arg2, Arg3, Arg4)
Source delete(Arg1, Arg2, Arg3)
Source select(Arg1, Arg2, Arg3, Arg4)
Source append(Arg1, Arg2, Arg3)
Source union(Arg1, Arg2, Arg3)
Source numlist(Arg1, Arg2, Arg3)
Source min_list(Arg1, Arg2)
Source max_member(Arg1, Arg2)
Source same_length(Arg1, Arg2)
Source nth0(Arg1, Arg2, Arg3, Arg4)
Source prefix(Arg1, Arg2)
Source selectchk(Arg1, Arg2, Arg3, Arg4)
Source intersection(Arg1, Arg2, Arg3)
Source max_list(Arg1, Arg2)
Source flatten(Arg1, Arg2)
Source proper_length(Arg1, Arg2)
Source nth1(Arg1, Arg2, Arg3)
Source nextto(Arg1, Arg2, Arg3)
Source select(Arg1, Arg2, Arg3)
Source subtract(Arg1, Arg2, Arg3)
Source list_to_set(Arg1, Arg2)