This library provides commonly accepted basic predicates for list manipulation in the Prolog community. Some additional list manipulations are built-in. Their description is in section 4.28.
?- flatten([a, [b, [c, d], e]], X). X = [a, b, c, d, e] |
The set predicates listed in this section work on ordinary unsorted
lists. Note that this makes many of the operations order N^2.
For larger sets, please consider the use of ordered sets as implemented
by library oset.pl
, running most these operations in order N.
This library is currently not documented in the manual.
?- list_to_set([a,b,a], X) X = [a,b] |