Our rewriter was returning `REWRITE_DONE` prematurely for `bvneg`. This
commit makes the status returned more conservative.
}
}
- return RewriteResponse(REWRITE_DONE, resultNode);
+ // There are cases where we need to rewrite the resulting term again. For
+ // example, if we rewrite (bvneg (bvneg (bvneg #b0))) to (bvneg #b0) then we
+ // have to rewrite again.
+ return RewriteResponse(resultNode != node ? REWRITE_AGAIN : REWRITE_DONE,
+ resultNode);
}
RewriteResponse TheoryBVRewriter::RewriteUdiv(TNode node, bool prerewrite){
regress0/bv/issue-4130.smt2
regress0/bv/issue3621.smt2
regress0/bv/issue5396.smt2
+ regress0/bv/issue8159-1-rewrite-bvneg.smt2
regress0/bv/mul-neg-unsat.smt2
regress0/bv/mul-negpow2.smt2
regress0/bv/mult-pow2-negative.smt2
--- /dev/null
+; COMMAND-LINE: --incremental
+(set-logic QF_BV)
+(assert (= (_ bv1 1) (bvsmod (_ bv0 1) (bvneg (bvneg (_ bv0 1))))))
+(push)
+(set-info :status unsat)
+(check-sat)