Skip to content

Commit

Permalink
remove part from only_bv_implies
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimosts committed Sep 18, 2023
1 parent e7c29f5 commit c94ec61
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions cpmpy/transformations/reification.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,13 @@ def only_bv_implies(constraints):
AFTER `flatten()`
"""
newcons = []
constraints = flatten_constraint(only_bv_reifies(constraints))

for cpm_expr in constraints:
# Operators: check BE -> BV
if cpm_expr.name == '->':
a0,a1 = cpm_expr.args
if not isinstance(a0, _BoolVarImpl) and \
isinstance(a1, _BoolVarImpl):
# BE -> BV :: ~BV -> ~BE
newexpr = (~a1).implies(recurse_negation(a0))
#newexpr = (~a1).implies(~a0) # XXX when push_down_neg is separate, negated_normal no longer needed separately
newcons.extend(only_bv_implies(flatten_constraint(newexpr)))
elif isinstance(a1, Comparison) and \
if isinstance(a1, Comparison) and \
a1.name == '==' and a1.args[0].is_bool() and a1.args[1].is_bool():
# BV0 -> BV2 == BV3 :: BV0 -> (BV2->BV3 & BV3->BV2)
# :: BV0 -> (BV2->BV3) & BV0 -> (BV3->BV2)
Expand Down

0 comments on commit c94ec61

Please sign in to comment.