diff --git a/src/ast/rewriter/bv_rewriter.cpp b/src/ast/rewriter/bv_rewriter.cpp index 3b52ca37280..fc672584efe 100644 --- a/src/ast/rewriter/bv_rewriter.cpp +++ b/src/ast/rewriter/bv_rewriter.cpp @@ -216,7 +216,7 @@ br_status bv_rewriter::mk_app_core(func_decl * f, unsigned num_args, expr * cons case OP_BUSUB_OVFL: return mk_bvusub_underflow(num_args, args, result); case OP_BSSUB_OVFL: - return mk_bvssub_overflow(num_args, args, result); + return mk_bvssub_under_overflow(num_args, args, result); default: return BR_FAILED; } @@ -3081,19 +3081,29 @@ br_status bv_rewriter::mk_bvusub_underflow(unsigned num, expr * const * args, ex return status; } -br_status bv_rewriter::mk_bvssub_overflow(unsigned num, expr * const * args, expr_ref & result) { +// +// no_overflow := if t2 = min_int then t1 no_underflow(t1 + -t2) +// over_underflow := 0 =s 0 || t2 != min_int & under_overflow+(t1 + -t2) +// := if t2 == min_int then t1 >=s 0 else under_overflow+(t1 + -t2) +// because when 0 { br_status mk_bvsadd_over_underflow(unsigned num, expr * const * args, expr_ref & result); br_status mk_bvusub_underflow(unsigned num, expr * const * args, expr_ref & result); - br_status mk_bvssub_overflow(unsigned num, expr * const * args, expr_ref & result); + // br_status mk_bvssub_overflow(unsigned num, expr * const * args, expr_ref & result); + br_status mk_bvssub_under_overflow(unsigned num, expr * const * args, expr_ref & result); bool is_minus_one_times_t(expr * arg); void mk_t1_add_t2_eq_c(expr * t1, expr * t2, expr * c, expr_ref & result);