From: Markus Triska Date: Mon, 2 Oct 2023 21:17:06 +0000 (+0200) Subject: FIXED: corrections to expansion_simpler/2 X-Git-Tag: remove~58^2 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=f3b848537aef601b13bd525df09ee74f5bbeeae9;p=scryer-prolog.git FIXED: corrections to expansion_simpler/2 Example: ?- X = 0, Y = 0, Z #= X-1 + Y-1. X = 0, Y = 0, Z = -2. This addresses #2064. See ca5a5b4392bfbed8cfdbb3b2e7dbaa42ea193007 for a previous issue in this logic. --- diff --git a/src/lib/clpz.pl b/src/lib/clpz.pl index f438043d..c4ba62fa 100644 --- a/src/lib/clpz.pl +++ b/src/lib/clpz.pl @@ -3099,13 +3099,13 @@ expansion_simpler(Var is Expr0, Goal) :- ground(Expr0), !, phrase(expr_conds(Expr0, Expr), Gs), ( maplist(call, Gs) -> Value is Expr, Goal = (Var = Value) - ; Goal = false + ; Goal = (Var is Expr0) ). expansion_simpler(Var =:= Expr0, Goal) :- ground(Expr0), !, phrase(expr_conds(Expr0, Expr), Gs), ( maplist(call, Gs) -> Value is Expr, Goal = (Var =:= Value) - ; Goal = false + ; Goal = (Var =:= Expr0) ). expansion_simpler(between:between(L,U,V), Goal) :- maplist(integer, [L,U,V]),