]> Repositorios git - scryer-prolog.git/commitdiff
ADDED: Provisional support for (#=)/3 and (#<)/3.
authorMarkus Triska <[email protected]>
Sun, 8 Nov 2020 08:25:56 +0000 (09:25 +0100)
committerMarkus Triska <[email protected]>
Sun, 8 Nov 2020 08:26:50 +0000 (09:26 +0100)
These predicates are intended for constructs from library(reif), such
as if_/3. For the time being, they are defined here. If you have any
recommendations or comments regarding the best location of these
predicates, or need more of them, please file an issue.

Suggested by @Qqwy in https://github.com/triska/clpz/issues/12.

Many thanks!

src/lib/clpz.pl

index 4fa4b846b589d1fc01f1ae2cb7daa871ca636a31..a4f662567ae4334ae64a6607991bf3ba7da28b67 100644 (file)
                  fd_inf/2,
                  fd_sup/2,
                  fd_size/2,
-                 fd_dom/2
+                 fd_dom/2,
+
+                 % for use in predicates from library(reif)
+                 (#=)/3,
+                 (#<)/3
 
                  % called from goal_expansion
                  % clpz_equal/2,
@@ -7740,6 +7744,21 @@ plusterm_(CV, T0, T0+T) :- coeff_var_term(CV, T).
 
 coeff_var_term(C-V, T) :- ( C =:= 1 -> T = ?(V) ; T = C * ?(V) ).
 
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+   Reified predicates for use with predicates from library(reif).
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+#=(X, Y, T) :-
+        X #= Y #<==> B,
+        zo_t(B, T).
+
+#<(X, Y, T) :-
+        X #< Y #<==> B,
+        zo_t(B, T).
+
+zo_t(0, false).
+zo_t(1, true).
+
 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Generated predicates
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */