Skip to content

Commit

Permalink
ADDED: clpz_t/2, generalizing support for use with library(reif)
Browse files Browse the repository at this point in the history
This was suggested and contributed by @librarianmage in:

    #2225 (comment)

Many thanks!

If anyone can find a better predicate name, please let us know any time!
  • Loading branch information
triska committed Feb 6, 2024
1 parent 140a15f commit aa98a7e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/lib/clpz.pl
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
fd_dom/2,

% for use in predicates from library(reif)
clpz_t/2,
(#=)/3,
(#<)/3

Expand Down Expand Up @@ -7981,13 +7982,13 @@
Reified predicates for use with predicates from library(reif).
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

#=(X, Y, T) :-
X #= Y #<==> #B,
clpz_t(Expr, T) :-
Expr #<==> #B,
zo_t(B, T).

#<(X, Y, T) :-
X #< Y #<==> #B,
zo_t(B, T).
#=(X, Y, T) :- clpz_t(X #= Y, T).

#<(X, Y, T) :- clpz_t(X #< Y, T).

zo_t(0, false).
zo_t(1, true).
Expand Down

0 comments on commit aa98a7e

Please sign in to comment.