From cacc7f31930739f1b97be34bdbe12b54481e11cc Mon Sep 17 00:00:00 2001 From: Markus Triska Date: Mon, 9 Oct 2023 20:42:28 +0200 Subject: [PATCH] FIXED: Queue triggered propagators to be processed after pexp/3 finishes If reification constraints (such as reified equality) are triggered here, then they may wish to disable this propagator and remove attributes from auxiliary variables. If the pexp/3 propagation is interrupted for that purpose, then the attributes will be unintentionally reattached by the following fd_put/3 calls in this propagator. We must ensure that this propagator completely finishes, so we queue the triggered propagators for later processing. geq/2 implements propagator activation outside the queue, and thus should not be used in propagators in the way it was used here. pexp/3 by itself may not seem particularly important. However, it can arise by metamorphosis from Var*Var. Example: ?- A#<==> -1#=C*C, C in 0..1. A = 0, clpz:(C in 0..1). This addresses #2089. --- src/lib/clpz.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/clpz.pl b/src/lib/clpz.pl index 0b789774..4308e038 100644 --- a/src/lib/clpz.pl +++ b/src/lib/clpz.pl @@ -5498,7 +5498,9 @@ run_propagator(pexp(X,Y,Z), MState) --> ) ; nonvar(Y), Y > 0 -> ( { even(Y) } -> - { geq(Z, 0) } + { fd_get(Z, ZD0, ZPs0), + domain_remove_smaller_than(ZD0, 0, ZDG0) }, + fd_put(Z, ZDG0, ZPs0) ; true ), ( { fd_get(X, XD, XL, XU, _), fd_get(Z, ZD, ZL, ZU, ZPs) } -> -- 2.54.0