Skip to content

Commit

Permalink
use is_boolexpr
Browse files Browse the repository at this point in the history
  • Loading branch information
Wout4 committed Jan 12, 2024
1 parent c73d21c commit 2452dac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cpmpy/transformations/flatten_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,10 @@ def get_or_make_var(expr,boolean=False):
Determines whether this is a Boolean or Integer variable and returns
the equivalent of: (var, normalize(expr) == var)
"""
if is_boolexpr(expr):
isbool = is_boolexpr(expr)
if isbool:
boolean = True
if __is_flat_var(expr) and boolean == expr.is_bool():
if __is_flat_var(expr) and boolean == isbool:
return (expr, [])

if is_any_list(expr):
Expand Down

0 comments on commit 2452dac

Please sign in to comment.