3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 09:35:32 +00:00

re-organize proof and model converters to be associated with goals instead of external

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-11-18 16:33:54 -08:00
parent 00f5308a0e
commit 4bbece6616
118 changed files with 617 additions and 1070 deletions

View file

@ -505,7 +505,7 @@ private:
SASSERT(!g->proofs_enabled());
TRACE("sat", g->display(tout););
try {
(*m_preprocess)(g, m_subgoals, m_mc, m_dep_core);
(*m_preprocess)(g, m_subgoals, m_dep_core);
}
catch (tactic_exception & ex) {
IF_VERBOSE(0, verbose_stream() << "exception in tactic " << ex.msg() << "\n";);
@ -521,6 +521,7 @@ private:
g = m_subgoals[0];
expr_ref_vector atoms(m);
m_pc = g->pc();
m_mc = g->mc();
TRACE("sat", g->display_with_dependencies(tout););
m_goal2sat(*g, m_params, m_solver, m_map, dep2asm, false, is_lemma);
m_goal2sat.get_interpreted_atoms(atoms);

View file

@ -922,8 +922,7 @@ struct sat2goal::imp {
}
}
virtual void operator()(model_ref & md, unsigned goal_idx) {
SASSERT(goal_idx == 0);
virtual void operator()(model_ref & md) {
TRACE("sat_mc", tout << "before sat_mc\n"; model_v2_pp(tout, *md); display(tout););
// REMARK: potential problem
// model_evaluator can't evaluate quantifiers. Then,

View file

@ -40,9 +40,8 @@ class sat_tactic : public tactic {
void operator()(goal_ref const & g,
goal_ref_buffer & result,
model_converter_ref & mc,
expr_dependency_ref & core) {
mc = 0; core = 0;
core = 0;
fail_if_proof_generation("sat", g);
bool produce_models = g->models_enabled();
bool produce_core = g->unsat_core_enabled();
@ -102,7 +101,7 @@ class sat_tactic : public tactic {
}
}
TRACE("sat_tactic", model_v2_pp(tout, *md););
mc = model2model_converter(md.get());
g->add(model2model_converter(md.get()));
}
}
else {
@ -111,7 +110,9 @@ class sat_tactic : public tactic {
IF_VERBOSE(TACTIC_VERBOSITY_LVL, verbose_stream() << "\"formula constains interpreted atoms, recovering formula from sat solver...\"\n";);
#endif
m_solver.pop_to_base_level();
model_converter_ref mc;
m_sat2goal(m_solver, map, m_params, *(g.get()), mc);
g->add(mc.get());
}
g->inc_depth();
result.push_back(g.get());
@ -175,12 +176,11 @@ public:
void operator()(goal_ref const & g,
goal_ref_buffer & result,
model_converter_ref & mc,
expr_dependency_ref & core) {
imp proc(g->m(), m_params);
scoped_set_imp set(this, &proc);
try {
proc(g, result, mc, core);
proc(g, result, core);
proc.m_solver.collect_statistics(m_stats);
}
catch (sat::solver_exception & ex) {