This library has been developed mainly for porting the CHR package.
- author
- - Tom Schrijvers
- - Bart Demoen
- - Jan Wielemaker
- To be done
- - Ultimately, this must disappear. Generally useful predicates
must be moved to their appropriate library. Others must be moved
into the CHR utilities.
substitute_eq(+OldVal, +OldList, +NewVal, -NewList)- Substitute OldVal by NewVal in OldList and unify the result
with NewList.
memberchk_eq(+Val, +List)- Deterministic check of membership using == rather than
unification.
list_difference_eq(+List, -Subtract, -Rest)- Delete all elements of Subtract from List and unify the result
with Rest. Element comparision is done using ==/2.
intersect_eq(+List1, +List2, -Intersection)- Determine the intersection of two lists without unifying values.
take(+N, +List, -FirstElements)- Take the first N elements from List and unify this with
FirstElements. The definition is based on the GNU-Prolog lists
library. Implementation by Jan Wielemaker.
drop(+N, +List, -ListMinFirstN) is semidet- Drop the first N elements from List and unify the remainder with
LastElements.
split_at(+N, +List, +FirstN, -Rest) is semidet- Combines take/3 and drop/3.
max_go_list(+List, -Max)- Return the maximum of List in the standard order of terms.
or_list(+ListOfInts, -BitwiseOr)- Do a bitwise disjuction over all integer members of ListOfInts.
sublist(?Sub, +List) is nondet- True if all elements of Sub appear in List in the same order.
bounded_sublist(?Sub, +List, +Bound:integer)- As sublist/2, but Sub has at most Bound elements. E.g. the call
below generates all 21 sublists of length =< 2 from the second
argument.
?- bounded_sublist(List, [a,b,c,d], 2).
X = [] ;
X = [a] ;
X = [a, b] ;
X = [a] ;
...
chr_delete(+List, +Element, -Rest) is det- Rest is a copy of List without elements matching Element using
==.
time(:Goal, -CPU, -Wall)- hProlog compatible predicate to for statistical purposes
Undocumented predicates
The following predicates are exported, but not or incorrectly documented.
make_get_store_goal(Arg1, Arg2, Arg3)
put_ds(Arg1, Arg2, Arg3, Arg4)
ds_to_list(Arg1, Arg2)
make_init_store_goal(Arg1, Arg2, Arg3)
get_ds(Arg1, Arg2, Arg3)
make_get_store_goal_no_error(Arg1, Arg2, Arg3)
make_update_store_goal(Arg1, Arg2, Arg3)
empty_ds(Arg1)
update_store(Arg1, Arg2)
get_store(Arg1, Arg2)
init_store(Arg1, Arg2)