List Predicates in the Prolog Library¶
List Manipulation Predicates.
The following list manipulation routines are available once included with the use_module(library(lists))
command.
- randomize/3
- intersection/4
- numlist/4
- flatten/3
- same_length/3
- remove_duplicates/3
- nth/6
- nth1/6
- nth0/6
- nth0/3
- nth0/5
- length/2
- delete/4
- identical_member/2
- member/2
- prolog::randomize/2
- prolog::list_to_set/2
- prolog::subtract/3
- prolog::intersection/3
- prolog::numlist/3
- prolog::min_list/2
- prolog::max_list/2
- prolog::flatten/2
- prolog::list_concat/2
- prolog::sum_list/2
- prolog::sum_list/3
- prolog::sumlist/2
- prolog::suffix/2
- prolog::substitute/4
- prolog::sublist/2
- prolog::select/3
- prolog::selectchk/3
- prolog::same_length/2
- prolog::remove_duplicates/2
- prolog::prefix/2
- prolog::permutation/2
- prolog::nth/4
- prolog::nth1/4
- prolog::nth0/4
- prolog::nth/3
- prolog::nth1/3
- prolog::nextto/3
- prolog::last/2
- prolog::reverse/2
- prolog::append/2
- prolog::delete/3
- prolog::append/3
- prolog::memberchk/2
Functions:¶
1. *** prolog::identical_member(?Element, ?Set) is nondet%% identical_member holds true when Set is a list*:
1. *** prolog::append(? Lists,? Combined) %% Concatenate a list of lists. Is true if Lists is a list of% lists*:
1. *** prolog::nt/0(?N,+List, ?Elem) %is true when Elem is the Nth member of List*:
1. counting the first as prolog::element(That is, throw away the first% N elements and unify Elem with the next.) It can only be used to% select a particular element given the list and index. For that% task it is more efficient than nmember.% nth(+N:
Var:¶
1. counting the first as prolog::List:
1. counting the first as Elem is the same as prolog::nt/0:
1. counting the first as Elem is the same as except that it counts prolog::from: