Skip to content

Commit

Permalink
better rewriting for ule
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolajBjorner authored and hgvk94 committed May 7, 2020
1 parent 51a3b54 commit 93efb56
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/ast/rewriter/bv_rewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,10 +514,14 @@ br_status bv_rewriter::mk_leq_core(bool is_signed, expr * a, expr * b, expr_ref
// for r1 = r2, (bvule a (2^n - r2 - 1))
// other cases r1 > r2, r1 < r2 are TBD
if (!is_signed && is_num1 && m_util.is_bv_add(b, a1, a2) && is_numeral(a1, r2, sz)) {
if (r1 == r2) {
result = m_util.mk_ule(a2, m_util.mk_numeral(-r2 - 1, sz));
return BR_REWRITE1;
result = m_util.mk_ule(a2, m_util.mk_numeral(-r2 - 1, sz));
if (r1 > r2) {
result = m().mk_and(result, m_util.mk_ule(m_util.mk_numeral(r1-r2, sz), a2));
}
else if (r1 < r2) {
result = m().mk_or(result, m_util.mk_ule(m_util.mk_numeral(r1-r2, sz), a2));
}
return BR_REWRITE2;
}

if (m_le_extra) {
Expand Down

0 comments on commit 93efb56

Please sign in to comment.