diff options
Diffstat (limited to 'src/theory/bv')
-rw-r--r-- | src/theory/bv/theory_bv_rewrite_rules_normalization.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/theory/bv/theory_bv_rewrite_rules_normalization.h b/src/theory/bv/theory_bv_rewrite_rules_normalization.h index 4abd02e73..89bb3d7ac 100644 --- a/src/theory/bv/theory_bv_rewrite_rules_normalization.h +++ b/src/theory/bv/theory_bv_rewrite_rules_normalization.h @@ -492,8 +492,10 @@ template<> inline Node RewriteRule<MultDistrib>::apply(TNode node) { Debug("bv-rewrite") << "RewriteRule<MultDistrib>(" << node << ")" << std::endl; - TNode factor = node[0].getKind() != kind::BITVECTOR_PLUS ? node[0] : node[1]; - TNode sum = node[0].getKind() == kind::BITVECTOR_PLUS? node[0] : node[1]; + bool is_rhs_factor = node[0].getKind() == kind::BITVECTOR_PLUS || + node[0].getKind() == kind::BITVECTOR_SUB; + TNode factor = !is_rhs_factor ? node[0] : node[1]; + TNode sum = is_rhs_factor ? node[0] : node[1]; Assert (factor.getKind() != kind::BITVECTOR_PLUS && factor.getKind() != kind::BITVECTOR_SUB && (sum.getKind() == kind::BITVECTOR_PLUS || |