3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-25 10:05:32 +00:00

allow copy within a user scope #6827

this will allow copying the solver state within a scope.
The new solver state has its state at level 0. It is not possible to pop scopes from the new solver (you can still pop scopes from the original solver). The reason for this semantics is the relative difficulty of implementing (getting it right) of a state copy that preserves scopes.
This commit is contained in:
Nikolaj Bjorner 2023-07-31 19:46:08 -07:00
parent 403340498c
commit adad468cd7
9 changed files with 23 additions and 24 deletions

View file

@ -161,6 +161,9 @@ void asserted_formulas::assert_expr(expr * e, proof * _in_pr) {
if (inconsistent())
return;
if (m.is_true(e))
return;
if (m_smt_params.m_preprocess) {
TRACE("assert_expr_bug", tout << r << "\n";);
set_eliminate_and(false); // do not eliminate and before nnf.
@ -507,7 +510,8 @@ void asserted_formulas::simplify_fmls::operator()() {
else {
af.push_assertion(result, result_pr, new_fmls);
}
if (af.canceled()) return;
if (af.canceled())
return;
}
af.swap_asserted_formulas(new_fmls);
TRACE("asserted_formulas", af.display(tout););

View file

@ -294,9 +294,6 @@ solver* tactic2solver::translate(ast_manager& m, params_ref const& p) {
tactic* t = m_tactic->translate(m);
tactic2solver* r = alloc(tactic2solver, m, t, p, m_produce_proofs, m_produce_models, m_produce_unsat_cores, m_logic);
r->m_result = nullptr;
if (!m_scopes.empty()) {
throw default_exception("translation of contexts is only supported at base level");
}
ast_translation tr(m_assertions.get_manager(), m, false);
for (unsigned i = 0; i < get_num_assertions(); ++i) {