Skip to content

Commit

Permalink
ENHANCED: domain error in zcompare/3 (mthom#1723)
Browse files Browse the repository at this point in the history
  • Loading branch information
triska committed Aug 14, 2023
1 parent a36df33 commit f02cd0a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/lib/clpz.pl
Original file line number Diff line number Diff line change
Expand Up @@ -7488,9 +7488,15 @@
propagator_init_trigger([A,B], pzcompare(Order, A, B))
).

zcompare_(=, A, B) :- #A #= #B.
zcompare_(<, A, B) :- #A #< #B.
zcompare_(>, A, B) :- #A #> #B.
zcompare_(O, A, B) :-
( member(O, "<=>") -> true
; domain_error(order, O, zcompare/3)
),
zcompare__(O, A, B).

zcompare__(=, A, B) :- #A #= #B.
zcompare__(<, A, B) :- #A #< #B.
zcompare__(>, A, B) :- #A #> #B.

%% chain(+Relation, +Zs)
%
Expand Down

0 comments on commit f02cd0a

Please sign in to comment.