From: Markus Triska Date: Sun, 8 Nov 2020 08:25:56 +0000 (+0100) Subject: ADDED: Provisional support for (#=)/3 and (#<)/3. X-Git-Tag: v0.9.0~170^2 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=41a751e7f50303ac3a95982110364efa62c82094;p=scryer-prolog.git ADDED: Provisional support for (#=)/3 and (#<)/3. 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! --- diff --git a/src/lib/clpz.pl b/src/lib/clpz.pl index 4fa4b846..a4f66256 100644 --- a/src/lib/clpz.pl +++ b/src/lib/clpz.pl @@ -99,7 +99,11 @@ 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 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */