summaryrefslogtreecommitdiff
path: root/stdlib.pl
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib.pl')
-rw-r--r--stdlib.pl21
1 files changed, 21 insertions, 0 deletions
diff --git a/stdlib.pl b/stdlib.pl
index 596aff6..b36a851 100644
--- a/stdlib.pl
+++ b/stdlib.pl
@@ -129,3 +129,24 @@ write_canonical(Term) :-
write_canonical(S, Term) :-
write_term(S, Term, [quoted(true), ignore_ops(true)]).
+% Arithmetic comparisons defined in terms of >=. This is not the most effective way,
+% but it is fine for now.
+
+E1 =:= E2 :-
+ E1 >= E2,
+ E2 >= E1.
+
+E1 =\= E2 :-
+ \+ E1 =:= E2.
+
+E1 < E2 :-
+ E2 >= E1,
+ E1 =\= E2.
+
+E1 =< E2 :-
+ E2 >= E1.
+
+E1 > E2 :-
+ E2 < E1.
+
+