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

probably won't fix #6127

recfun decl plugin does not get copied so recursive functions are lost when cloning.
Fix is risky and use case is limited to threads + recursive definitions
This commit is contained in:
Nikolaj Bjorner 2022-07-03 18:10:52 -07:00
parent ac8aaed1d4
commit 6ed2b444b5

View file

@ -48,27 +48,27 @@ namespace smt {
} }
bool theory_recfun::internalize_atom(app * atom, bool gate_ctx) { bool theory_recfun::internalize_atom(app * atom, bool gate_ctx) {
TRACE("recfun", tout << mk_pp(atom, m) << " " << u().has_defs() << "\n");
if (!u().has_defs()) { if (!u().has_defs()) {
// if (u().is_defined(atom))
// throw default_exception("recursive atom definition is out of scope");
return false; return false;
} }
for (expr * arg : *atom) { for (expr * arg : *atom)
ctx.internalize(arg, false); ctx.internalize(arg, false);
} if (!ctx.e_internalized(atom))
if (!ctx.e_internalized(atom)) {
ctx.mk_enode(atom, false, true, true); ctx.mk_enode(atom, false, true, true);
} if (!ctx.b_internalized(atom))
if (!ctx.b_internalized(atom)) { ctx.set_var_theory(ctx.mk_bool_var(atom), get_id());
bool_var v = ctx.mk_bool_var(atom); if (!ctx.relevancy() && u().is_defined(atom))
ctx.set_var_theory(v, get_id());
}
if (!ctx.relevancy() && u().is_defined(atom)) {
push_case_expand(atom); push_case_expand(atom);
}
return true; return true;
} }
bool theory_recfun::internalize_term(app * term) { bool theory_recfun::internalize_term(app * term) {
if (!u().has_defs()) { if (!u().has_defs()) {
// if (u().is_defined(term))
// throw default_exception("recursive term definition is out of scope");
return false; return false;
} }
for (expr* e : *term) { for (expr* e : *term) {