mirror of
https://github.com/Z3Prover/z3
synced 2025-06-20 12:53:38 +00:00
allow callbacks to be nested
This commit is contained in:
parent
53f89a81c1
commit
f1d97c7a3a
1 changed files with 14 additions and 7 deletions
|
@ -11570,47 +11570,54 @@ def user_prop_fresh(ctx, _new_ctx):
|
||||||
|
|
||||||
def user_prop_fixed(ctx, cb, id, value):
|
def user_prop_fixed(ctx, cb, id, value):
|
||||||
prop = _prop_closures.get(ctx)
|
prop = _prop_closures.get(ctx)
|
||||||
prop.cb = cb
|
old_cb = prop.cb
|
||||||
|
prop.cb = cb
|
||||||
id = _to_expr_ref(to_Ast(id), prop.ctx())
|
id = _to_expr_ref(to_Ast(id), prop.ctx())
|
||||||
value = _to_expr_ref(to_Ast(value), prop.ctx())
|
value = _to_expr_ref(to_Ast(value), prop.ctx())
|
||||||
prop.fixed(id, value)
|
prop.fixed(id, value)
|
||||||
prop.cb = None
|
prop.cb = old_cb
|
||||||
|
|
||||||
def user_prop_created(ctx, cb, id):
|
def user_prop_created(ctx, cb, id):
|
||||||
prop = _prop_closures.get(ctx)
|
prop = _prop_closures.get(ctx)
|
||||||
|
old_cb = prop.cb
|
||||||
prop.cb = cb
|
prop.cb = cb
|
||||||
id = _to_expr_ref(to_Ast(id), prop.ctx())
|
id = _to_expr_ref(to_Ast(id), prop.ctx())
|
||||||
prop.created(id)
|
prop.created(id)
|
||||||
prop.cb = None
|
prop.cb = old_cb
|
||||||
|
|
||||||
|
|
||||||
def user_prop_final(ctx, cb):
|
def user_prop_final(ctx, cb):
|
||||||
prop = _prop_closures.get(ctx)
|
prop = _prop_closures.get(ctx)
|
||||||
|
old_cb = prop.cb
|
||||||
prop.cb = cb
|
prop.cb = cb
|
||||||
prop.final()
|
prop.final()
|
||||||
prop.cb = None
|
prop.cb = old_cb
|
||||||
|
|
||||||
def user_prop_eq(ctx, cb, x, y):
|
def user_prop_eq(ctx, cb, x, y):
|
||||||
prop = _prop_closures.get(ctx)
|
prop = _prop_closures.get(ctx)
|
||||||
|
old_cb = prop.cb
|
||||||
prop.cb = cb
|
prop.cb = cb
|
||||||
x = _to_expr_ref(to_Ast(x), prop.ctx())
|
x = _to_expr_ref(to_Ast(x), prop.ctx())
|
||||||
y = _to_expr_ref(to_Ast(y), prop.ctx())
|
y = _to_expr_ref(to_Ast(y), prop.ctx())
|
||||||
prop.eq(x, y)
|
prop.eq(x, y)
|
||||||
prop.cb = None
|
prop.cb = old_cb
|
||||||
|
|
||||||
def user_prop_diseq(ctx, cb, x, y):
|
def user_prop_diseq(ctx, cb, x, y):
|
||||||
prop = _prop_closures.get(ctx)
|
prop = _prop_closures.get(ctx)
|
||||||
|
old_cb = prop.cb
|
||||||
prop.cb = cb
|
prop.cb = cb
|
||||||
x = _to_expr_ref(to_Ast(x), prop.ctx())
|
x = _to_expr_ref(to_Ast(x), prop.ctx())
|
||||||
y = _to_expr_ref(to_Ast(y), prop.ctx())
|
y = _to_expr_ref(to_Ast(y), prop.ctx())
|
||||||
prop.diseq(x, y)
|
prop.diseq(x, y)
|
||||||
prop.cb = None
|
prop.cb = old_cb
|
||||||
|
|
||||||
def user_prop_decide(ctx, cb, t, idx, phase):
|
def user_prop_decide(ctx, cb, t, idx, phase):
|
||||||
prop = _prop_closures.get(ctx)
|
prop = _prop_closures.get(ctx)
|
||||||
|
old_cb = prop.cb
|
||||||
prop.cb = cb
|
prop.cb = cb
|
||||||
t = _to_expr_ref(to_Ast(t_ref), prop.ctx())
|
t = _to_expr_ref(to_Ast(t_ref), prop.ctx())
|
||||||
prop.decide(t, idx, phase)
|
prop.decide(t, idx, phase)
|
||||||
prop.cb = None
|
prop.cb = old_cb
|
||||||
|
|
||||||
|
|
||||||
_user_prop_push = Z3_push_eh(user_prop_push)
|
_user_prop_push = Z3_push_eh(user_prop_push)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue