Skip to content

Commit

Permalink
only normalize when globalfunction
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimosts committed Jul 5, 2023
1 parent 0ab52f4 commit f1a8802
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cpmpy/transformations/decompose_global.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ def decompose_in_tree(lst_of_expr, supported=set(), supported_reified=set(), _to
continue

elif isinstance(expr, Operator):
expr, base_con = normalized_numexpr(expr)
_toplevel.extend(base_con) # should be added toplevel
if any(isinstance(a,GlobalFunction) for a in expr.args):
expr, base_con = normalized_numexpr(expr)
_toplevel.extend(base_con) # should be added toplevel
# recurse into arguments, recreate through constructor (we know it stores no other state)
args = decompose_in_tree(expr.args, supported, supported_reified, _toplevel, nested=True)
newlist.append(Operator(expr.name, args))
Expand Down

0 comments on commit f1a8802

Please sign in to comment.