Skip to content

Commit

Permalink
Add missing case in flatten (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wout4 authored Jan 31, 2024
1 parent 716134e commit 221b033
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cpmpy/transformations/flatten_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,12 @@ def flatten_constraint(expr):
# Reification (double implication): Boolexpr == Var
# normalize the lhs (does not have to be a var, hence we call normalize instead of get_or_make_var
if exprname == '==' and lexpr.is_bool():
(lhs, lcons) = normalized_boolexpr(lexpr)
if rvar.is_bool():
# this is a reification
(lhs, lcons) = normalized_boolexpr(lexpr)
else:
# integer comparison
(lhs, lcons) = get_or_make_var(lexpr)
else:
(lhs, lcons) = normalized_numexpr(lexpr)

Expand Down

0 comments on commit 221b033

Please sign in to comment.