Did you know ... | Search Documentation: |
Pack purity -- docs/api_purity.md |
Up: Purity
The core purity library is used by almost all other files in this set of libraries. While many of the files are optional, the core library is essential.
Contained within are mostly predicates for comparison, and other common helper predicates.
This predicate exists to replace A = B
in regular Prolog.
pcompare(TermA, TermB, Comparator) -
Comparator is one of <, > or =
Comparator is the comparison between TermA and TermB
both TermA and TermB must be in the same Domain
pdif(TermA, TermB, Truth).
TermA is not TermB
Truth is true if TermA is not TermB within the same domain. Truth is false if TermA is the same as TermB within the same domain.
The equivalent of pdif(A, B, true).
pif(Goal, TrueGoal, FalseGoal).
Goal is a callable with the last argument resolving to true or false.
if Goal results in true then TrueGoal is called.
if Goal results in false then FalseGoal is called.
<comparator>(TermA, TermB, Truth).
This goal fails if TermA and TermB are not in the same domain, or either TermA or TermB are not in any domain.