diff options
Diffstat (limited to 'stdlib.pl')
-rw-r--r-- | stdlib.pl | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/stdlib.pl b/stdlib.pl new file mode 100644 index 0000000..c53cf78 --- /dev/null +++ b/stdlib.pl @@ -0,0 +1,30 @@ +% Logic and control predicates +\+ Goal :- call(Goal), !, fail. +\+ Goal. + +once(Goal) :- + call(Goal), + !. + +repeat :- true ; repeat. + +% Control structures. +true. + +If -> Then :- + If, !, Then. + +If -> Then ; _ :- + If, !, Then. +_ -> _ ; Else :- + !, Else. +If ; _ :- + If. +_ ; Else :- + Else. + +% Term unification +A = A. + +A \= B :- + \+ A = B. |