Did you know ... Search Documentation:
hprolog.pl -- hProlog compatibility library
PublicShow source

This library has been developed mainly for porting the CHR package.

- 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.
Source substitute_eq(+OldVal, +OldList, +NewVal, -NewList)
Substitute OldVal by NewVal in OldList and unify the result with NewList.
Source memberchk_eq(+Val, +List)
Deterministic check of membership using == rather than unification.
Source 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.
Source intersect_eq(+List1, +List2, -Intersection)
Determine the intersection of two lists without unifying values.
Source 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.
Source drop(+N, +List, -ListMinFirstN) is semidet
Drop the first N elements from List and unify the remainder with LastElements.
Source split_at(+N, +List, +FirstN, -Rest) is semidet
Combines take/3 and drop/3.
Source max_go_list(+List, -Max)
Return the maximum of List in the standard order of terms.
Source or_list(+ListOfInts, -BitwiseOr)
Do a bitwise disjuction over all integer members of ListOfInts.
Source sublist(?Sub, +List) is nondet
True if all elements of Sub appear in List in the same order.
Source 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] ;
Source chr_delete(+List, +Element, -Rest) is det
Rest is a copy of List without elements matching Element using ==.
Source time(:Goal, -CPU, -Wall)
hProlog compatible predicate to for statistical purposes

Undocumented predicates

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

Source get_ds(Arg1, Arg2, Arg3)
Source make_update_store_goal(Arg1, Arg2, Arg3)
Source get_store(Arg1, Arg2)
Source ds_to_list(Arg1, Arg2)
Source make_get_store_goal_no_error(Arg1, Arg2, Arg3)
Source init_store(Arg1, Arg2)
Source empty_ds(Arg1)
Source make_get_store_goal(Arg1, Arg2, Arg3)
Source make_init_store_goal(Arg1, Arg2, Arg3)
Source update_store(Arg1, Arg2)
Source put_ds(Arg1, Arg2, Arg3, Arg4)