3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 09:05:31 +00:00

Merge branch 'unstable' into interp

This commit is contained in:
Ken McMillan 2013-11-05 12:28:13 -08:00
commit a785a5a4b8
33 changed files with 1995 additions and 1628 deletions

View file

@ -31,7 +31,7 @@ Revision History:
#include"ast_smt2_pp.h"
#include"th_rewriter.h"
#include"var_subst.h"
#include"expr_substitution.h"
#include"expr_safe_replace.h"
#include"pp.h"
#include"scoped_ctrl_c.h"
#include"cancel_eh.h"
@ -787,17 +787,12 @@ extern "C" {
RETURN_Z3(of_expr(0));
}
}
expr_substitution subst(m);
expr_safe_replace subst(m);
for (unsigned i = 0; i < num_exprs; i++) {
subst.insert(from[i], to[i]);
}
th_rewriter m_rw(m);
m_rw.set_substitution(&subst);
expr_ref new_a(m);
proof_ref pr(m);
m_rw(a, new_a, pr);
subst(a, new_a);
mk_c(c)->save_ast_trail(new_a);
r = new_a.get();
RETURN_Z3(of_expr(r));

View file

@ -6449,7 +6449,7 @@ class Tactic:
def _to_goal(a):
if isinstance(a, BoolRef):
goal = Goal()
goal = Goal(ctx = a.ctx)
goal.add(a)
return goal
else:
@ -6932,10 +6932,10 @@ def substitute(t, *m):
>>> x = Int('x')
>>> y = Int('y')
>>> substitute(x + 1, (x, y + 1))
2 + y
y + 1 + 1
>>> f = Function('f', IntSort(), IntSort())
>>> substitute(f(x) + f(y), (f(x), IntVal(1)), (f(y), IntVal(1)))
2
1 + 1
"""
if isinstance(m, tuple):
m1 = _get_args(m)