3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-11 19:53:34 +00:00

fix #3230 fix #3231 - make rmodel converter additive

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-03-10 14:08:57 -07:00
parent b3d41163f3
commit dd4eb7f97c
2 changed files with 19 additions and 6 deletions

View file

@ -171,6 +171,7 @@ lbool tactic2solver::check_sat_core2(unsigned num_assumptions, expr * const * as
expr_dependency_ref core(m);
std::string reason_unknown = "unknown";
labels_vec labels;
TRACE("tactic", g->display(tout););
try {
switch (::check_sat(*m_tactic, g, md, labels, pr, core, reason_unknown)) {
case l_true:
@ -189,14 +190,15 @@ lbool tactic2solver::check_sat_core2(unsigned num_assumptions, expr * const * as
}
break;
}
TRACE("tactic",
if (m_mc) m_mc->display(tout << "mc:");
if (g->mc()) g->mc()->display(tout << "g:");
if (md) tout << *md.get() << "\n";
);
CTRACE("tactic", md.get(), tout << *md.get() << "\n";);
if (m_mc && md) {
(*m_mc)(md);
}
TRACE("tactic",
if (m_mc) m_mc->display(tout << "mc:\n");
if (g->mc()) g->mc()->display(tout << "\ng\n:");
if (md) tout << "\nmodel:\n" << *md.get() << "\n";
);
m_mc = concat(g->mc(), m_mc.get());
}

View file

@ -127,7 +127,18 @@ public:
~model2mc() override {}
void operator()(model_ref & m) override {
m = m_model;
if (!m || !m_model) {
m = m_model;
return;
}
for (unsigned i = m_model->get_num_constants(); i-- > 0; ) {
func_decl* f = m_model->get_constant(i);
m->register_decl(f, m_model->get_const_interp(f));
}
for (unsigned i = m_model->get_num_functions(); i-- > 0; ) {
func_decl* f = m_model->get_function(i);
m->register_decl(f, m_model->get_func_interp(f));
}
}
void operator()(labels_vec & r) override {