Did you know ... Search Documentation:
Pack logicmoo_base -- prolog/logicmoo/pdt_server/org.cs3.prolog.library_3.1.2.201603251848/pl/lists.pl
PublicShow source
 nth1_non_unifying(Index, List, Elem) is nondet
Check list membership without unifying. Succeed only upon identical terms. Suceed multiply if member multiply in list!!!!
 union_and_intersection(+Set1, +Set2, ?Union, ?Intersection) is det
Determines the union and intersection of two sets represented as dupliate-free lists. Has no side-effects on free variables (free variables are not unified). Arg1 and arg2 are the input sets. Arg3 is their union. Arg4 is their intersection.
 union_sorted(+Set1, +Set2, ?Union) is det
Determines the union of two sets represented as dupliate-free lists. Has no side-effects on free variables (free variables are not unified). The result set is sorted according to the standard order of terms. Arg1 and Arg2 are the input sets. Arg3 is their union.
 union_order_preserving(+Set1, +Set2, ?Union) is det
Determines the union of two sets represented as dupliate-free lists. Has no side-effects on free variables (free variables are not unified). Does not change the relative order of terms. If duplicates are encountered, the first occurence is retained. Arg1 and arg2 are the input sets. Arg3 is their union.
 remove_duplicates_sorted(+List, ?DuplicateFree) is det
Arg2 is the duplicate-free version of Arg1. The first occurence of any element of Arg1 is preserved, later ones are deleted. It is assumed that the list in Arg1 is sorted, so any duplicates occur consecutively. Two terms are considered duplicates if they unify. The unification is performed before the removal. So any list of free variables will be collapsed to just one element that is unified with each removed element!
 remove_duplicates(+List, ?DuplicateFree) is det
Arg2 is the duplicate-free version of Arg1. The first occurence of any element of Arg1 is preserved, later ones are deleted.
 list_sum(+Numbers, ?Total)
  • Arg1 = List of numbers (integer or real)
  • Arg2 = Sum of the elements of Arg1.

Sum up a list of numbers.

 traverseList(List, Stop, _Pred)
Generic list visitor. Traverses any binary encoded list and executes Pred(X) on all its elements. The functor of the terms representing binary lists is irrelevant as long as the head is the first argument and the tail is the second. Stop is the term representing the end of the sequence.
 list_to_disjunction(+List, ?Disjunction) is det
Arg1 is a List and Arg2 is its representation as a disjunction.
 list_to_conjunction(+List, ?Conjunction) is det
Arg1 is a List and Arg2 is its representation as a conjunction.
 pretty_print_list(+List) is det
Pretty-print a list, with each element starting on a new line and fixed two character indentation of list elements relative to the opening and closing list brace. If the list contains nestes lists, their contents is pretty printed recursively.
 pretty_print_list(+List, +Indent)
Pretty-print List, with each element starting on a new line. Indent is the indentation of each element. It is an integer, e.g. 3 for 3 character indentation of list elements relative to the opening and closing list brace. If the list contains nestes lists, their contents is pretty printed recursively.

Undocumented predicates

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

 ctc_intersection(Arg1, Arg2, Arg3)
 list_2_comma_separated_list(Arg1, Arg2)
 list_2_separated_list(Arg1, Arg2, Arg3)
 ctc_intersection(Arg1, Arg2, Arg3)
 list_2_comma_separated_list(Arg1, Arg2)
 list_2_separated_list(Arg1, Arg2, Arg3)
 finite_length(Arg1, Arg2)