expr_conds(A0, A),
[I is A, arithmetic:popcount(I, Count)].
+no_popcount_t(Gs, T) :-
+ ( member(arithmetic:popcount(_, _), Gs) ->
+ T = false
+ ; T = true
+ ).
+
clpz_expandable(_ in _).
clpz_expandable(_ #= _).
clpz_expandable(_ #>= _).
phrase(expr_conds(Y0, Y), CsY),
list_goal(CsX, CondX),
list_goal(CsY, CondY),
+ no_popcount_t(CsY, YT),
+ no_popcount_t(CsX, XT),
expansion_simpler(
( CondX ->
- ( var(Y) -> Y is X
+ ( YT, var(Y) -> Y is X
; CondY -> X =:= Y
; T is X, clpz:clpz_equal(T, Y0)
)
; CondY ->
- ( var(X) -> X is Y
+ ( XT, var(X) -> X is Y
; T is Y, clpz:clpz_equal(X0, T)
)
; clpz:clpz_equal(X0, Y0)