3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 03:45:51 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2018-04-10 10:43:55 +08:00
parent 00685ff04f
commit d57bca8f8c
8 changed files with 78 additions and 61 deletions

View file

@ -552,7 +552,7 @@ class elim_uncnstr_tactic : public tactic {
// The result of bv_le is not just introducing a new fresh name,
// we need a side condition.
// TODO: the correct proof step
return 0;
return nullptr;
}
if (uncnstr(arg1)) {
// v <= t
@ -804,20 +804,17 @@ class elim_uncnstr_tactic : public tactic {
ast_manager & m() { return m_manager; }
void init_mc(bool produce_models) {
if (!produce_models) {
m_mc = 0;
return;
m_mc = nullptr;
if (produce_models) {
m_mc = alloc(mc, m(), "elim_uncstr");
}
m_mc = alloc(mc, m(), "elim_uncstr");
}
void init_rw(bool produce_proofs) {
m_rw = alloc(rw, m(), produce_proofs, m_vars, m_mc.get(), m_max_memory, m_max_steps);
}
void operator()(goal_ref const & g,
goal_ref_buffer & result) {
bool produce_models = g->models_enabled();
void operator()(goal_ref const & g, goal_ref_buffer & result) {
bool produce_proofs = g->proofs_enabled();
TRACE("elim_uncnstr_bug", g->display(tout););
@ -832,14 +829,9 @@ class elim_uncnstr_tactic : public tactic {
}
bool modified = true;
TRACE("elim_uncnstr", tout << "unconstrained variables...\n";
obj_hashtable<expr>::iterator it = m_vars.begin();
obj_hashtable<expr>::iterator end = m_vars.end();
for (; it != end; ++it) {
expr * v = *it;
tout << mk_ismt2_pp(v, m()) << " ";
}
for (expr * v : m_vars) tout << mk_ismt2_pp(v, m()) << " ";
tout << "\n";);
init_mc(produce_models);
init_mc(g->models_enabled());
init_rw(produce_proofs);
expr_ref new_f(m());
@ -866,14 +858,9 @@ class elim_uncnstr_tactic : public tactic {
else {
app_ref_vector & fresh_vars = m_rw->cfg().m_fresh_vars;
m_num_elim_apps = fresh_vars.size();
if (produce_models && !fresh_vars.empty()) {
generic_model_converter * fmc = alloc(generic_model_converter, m(), "elim_uncnstr");
for (app * f : fresh_vars)
fmc->hide(f);
g->add(concat(fmc, m_mc.get()));
}
else {
g->set((model_converter*)nullptr);
if (m_mc.get()) {
for (app * f : fresh_vars) m_mc->hide(f);
g->add(m_mc.get());
}
}
m_mc = 0;