From 5ba14216c8f1e186c32f38223ed060fab194df0c Mon Sep 17 00:00:00 2001 From: wout4 Date: Thu, 21 Sep 2023 10:46:45 +0200 Subject: [PATCH] import --- cpmpy/transformations/normalize.py | 3 +-- tests/test_trans_simplify.py | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cpmpy/transformations/normalize.py b/cpmpy/transformations/normalize.py index 701854d68..ee611e242 100644 --- a/cpmpy/transformations/normalize.py +++ b/cpmpy/transformations/normalize.py @@ -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 @@ -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 == '!=') \ diff --git a/tests/test_trans_simplify.py b/tests/test_trans_simplify.py index 6cc55250f..f47eb3936 100644 --- a/tests/test_trans_simplify.py +++ b/tests/test_trans_simplify.py @@ -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])),'')