From 93b835ae0d3718cd900d8353f53dd0beaa9b7775 Mon Sep 17 00:00:00 2001 From: notoria Date: Sun, 7 Mar 2021 20:59:25 +0100 Subject: [PATCH] Use functional notation in CLP(Z) for compatibility --- src/lib/clpz.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/clpz.pl b/src/lib/clpz.pl index bbce6702..af20d680 100644 --- a/src/lib/clpz.pl +++ b/src/lib/clpz.pl @@ -2578,7 +2578,7 @@ parse_clpz(E, R, m(A>>B) => [p(pfunction(>>, A, B, R))], m(A/\B) => [p(pfunction(/\, A, B, R))], m(A\/B) => [p(pfunction(\/, A, B, R))], - m(A xor B) => [p(pxor(A, B, R))], + m(xor(A, B)) => [p(pxor(A, B, R))], g(true) => [g(domain_error(clpz_expression, E))] ]). @@ -3503,7 +3503,7 @@ parse_reified(E, R, D, m(A>>B) => [function(D,>>,A,B,R)], m(A/\B) => [function(D,/\,A,B,R)], m(A\/B) => [function(D,\/,A,B,R)], - m(A xor B) => [skeleton(A,B,D,R,pxor)], + m(xor(A, B)) => [skeleton(A,B,D,R,pxor)], g(true) => [g(domain_error(clpz_expression, E))]] ). @@ -5453,13 +5453,13 @@ run_propagator(pexp(X,Y,Z), MState) --> run_propagator(pxor(X,Y,Z), MState) --> ( nonvar(X), nonvar(Y) -> kill(MState), - Z is X xor Y + Z is xor(X, Y) ; nonvar(Y), nonvar(Z) -> kill(MState), - X is Y xor Z + X is xor(Y, Z) ; nonvar(Z), nonvar(X) -> kill(MState), - Y is Z xor X + Y is xor(Z, X) ; X == Y -> kill(MState), queue_goal(Z = 0) @@ -7653,7 +7653,7 @@ attribute_goal_(pmod(X,M,K)) --> [?(X) mod ?(M) #= ?(K)]. attribute_goal_(prem(X,Y,Z)) --> [?(X) rem ?(Y) #= ?(Z)]. attribute_goal_(pmax(X,Y,Z)) --> [?(Z) #= max(?(X),?(Y))]. attribute_goal_(pmin(X,Y,Z)) --> [?(Z) #= min(?(X),?(Y))]. -attribute_goal_(pxor(X,Y,Z)) --> [?(Z) #= ?(X) xor ?(Y)]. +attribute_goal_(pxor(X,Y,Z)) --> [?(Z) #= xor(?(X), ?(Y))]. attribute_goal_(scalar_product_neq(Cs,Vs,C)) --> [Left #\= Right], { scalar_product_left_right([-1|Cs], [C|Vs], Left, Right) }. -- 2.54.0