3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-13 20:38:43 +00:00

test case for non-termination of substitution/rewriting

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2013-09-24 05:33:16 +03:00
parent 6554ac787a
commit 1733af2641

View file

@ -29,20 +29,26 @@ void tst_expr_substitution() {
reg_decl_plugins(m);
bv_util bv(m);
expr_ref a(m), b(m), c(m);
expr_ref a(m), b(m), c(m), d(m);
expr_ref x(m);
expr_ref new_a(m);
proof_ref pr(m);
x = m.mk_const(symbol("x"), bv.mk_sort(8));
a = mk_bv_and(bv, mk_bv_xor(bv, x,bv.mk_numeral(8,8)), mk_bv_xor(bv,x,x));
b = x;
c = bv.mk_bv_sub(x, bv.mk_numeral(4, 8));
expr_substitution subst(m);
subst.insert(b, c);
th_rewriter rw(m);
// normalizing c does not help.
rw(c, d, pr);
subst.insert(b, d);
rw.set_substitution(&subst);
expr_ref new_a(m);
proof_ref pr(m);
enable_trace("th_rewriter_step");
rw(a, new_a, pr);
std::cout << mk_pp(new_a, m) << "\n";