]> Repositorios git - scryer-prolog.git/commitdiff
ENHANCED: forget auxiliary constraints set up by the propagator for multiplication
authorMarkus Triska <[email protected]>
Mon, 31 Jul 2023 19:57:25 +0000 (21:57 +0200)
committerMarkus Triska <[email protected]>
Mon, 31 Jul 2023 19:57:25 +0000 (21:57 +0200)
This addresses the issue raised in https://github.com/mthom/scryer-prolog/discussions/1937.

src/lib/clpz.pl

index 9b162a1968cb73232d0047a15006ca31aa47fb15..38e52657e5834d3340d193264cc58256e3caadc4 100644 (file)
@@ -5898,6 +5898,11 @@ in_(L, U, X) :-
         fd_put(X, NXD, XPs).
 
 min_max_factor(L1, U1, L2, U2, L3, U3, Min, Max) :-
+        % use findall/3 to forget auxiliary constraints that are only
+        % needed temporarily for reasoning about domain boundaries
+        findall(Min-Max, min_max_factor_(L1, U1, L2, U2, L3, U3, Min, Max), [Min-Max]).
+
+min_max_factor_(L1, U1, L2, U2, L3, U3, Min, Max) :-
         (   U1 cis_lt n(0),
             L2 cis_lt n(0), U2 cis_gt n(0),
             L3 cis_lt n(0), U3 cis_gt n(0) ->