]> Repositorios git - scryer-prolog.git/commitdiff
Don't add variable
authornotoria <[email protected]>
Sat, 27 May 2023 11:19:19 +0000 (13:19 +0200)
committerMark <[email protected]>
Fri, 23 Jun 2023 20:11:31 +0000 (14:11 -0600)
?- Z #= 0, Z #= X mod Y.
   Z = 0, clpz:(_A*Y#=X), clpz:(Y in inf.. -1\/1..sup) % Unexpected.

The expected result:
   Z = 0, clpz:(X mod Y#=0), clpz:(Y in inf.. -1\/1..sup).

src/lib/clpz.pl

index 43b8f26e84284b94a66a598a6629bdee0cbe7cbe..4cdcdc9acb9df0ab9214287051cc8ea7d5006502 100644 (file)
@@ -5019,8 +5019,6 @@ run_propagator(pmod(X,Y,Z), MState) -->
                 % queue_goal(X #=< XMax)
             ;   true
             )
-            % kill(MState),
-            % queue_goal(X #= Z + Y * _) % Add a variable to be efficient.
         ;   nonvar(Z), nonvar(X) ->
             (   Z > 0 ->
                 (   X < 0 -> true
@@ -5180,7 +5178,7 @@ run_propagator(pmodz(X,Y,Z), MState) -->
             )
         ).
 
-run_propagator(pmody(X,Y,Z), MState) -->
+run_propagator(pmody(_X,Y,Z), _MState) -->
         (   nonvar(Y) -> true % Nothing to do.
         % ;   nonvar(X) -> true
         ;   nonvar(Z) ->
@@ -5196,7 +5194,7 @@ run_propagator(pmody(X,Y,Z), MState) -->
                   domain_remove_greater_than(YD, YMax, YD1) },
                 fd_put(Y, YD1, YPs)
                 % queue_goal(Y #< Z)
-            ;   Z =:= 0 -> kill(MState), queue_goal(X / Y #= _)
+            ;   Z =:= 0 % Multiple solutions so do nothing special.
             )
         ;   (   { fd_get(Z, _, n(ZL), _, _), ZL > 0 } ->
                 { fd_get(Y, YD, YPs),