Skip to content

Commit

Permalink
import
Browse files Browse the repository at this point in the history
  • Loading branch information
Wout4 committed Sep 21, 2023
1 parent 064b202 commit 5ba1421
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions cpmpy/transformations/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from ..expressions.core import BoolVal, Expression, Comparison, Operator
from ..expressions.utils import eval_comparison, is_false_cst, is_true_cst, is_boolexpr, is_num
from ..expressions.variables import NDVarArray
from ..expressions.variables import NDVarArray, _NumVarImpl
from ..exceptions import NotSupportedError
from ..expressions.globalconstraints import GlobalConstraint

Expand Down Expand Up @@ -233,7 +233,6 @@ def normalize_boolexpr(lst_of_expr):
"""
exprname = expr.name # so it can be modified
lexpr, rexpr = expr.args
rewritten = False

# rewrite 'Var == Expr' to normalzed 'Expr == Var'
if (expr.name == '==' or expr.name == '!=') \
Expand Down
2 changes: 2 additions & 0 deletions tests/test_trans_simplify.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,5 @@ def test_normalize(self):
('[(~BV5) -> (~BV1), (~BV5) -> (~BV3), (~BV0) -> (~BV1), (~BV0) -> (~BV3), '
'(~BV2) -> (~BV1), (~BV2) -> (~BV3)]'))
self.assertEqual(str(normalize_boolexpr([(b.implies(c)).implies(f & a)])),('[(~BV5) -> (BV1), (~BV5) -> (~BV2), (~BV0) -> (BV1), (~BV0) -> (~BV2)]'))
#self.assertEqual(str(normalize_boolexpr([b == a + c])),'')
self.assertEqual(str(normalize_boolexpr([b + d == a + c])),'')

0 comments on commit 5ba1421

Please sign in to comment.