3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00

fix fourth bug produced by repros by Mark Dunlop

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2019-01-27 18:11:18 -08:00
parent 1297eeb817
commit 94dae2da3a
6 changed files with 36 additions and 20 deletions

View file

@ -375,7 +375,7 @@ public:
get_mus_model(mdl);
is_sat = minimize_core(_core);
core.append(_core.size(), _core.c_ptr());
verify_core(core);
DEBUG_CODE(verify_core(core););
++m_stats.m_num_cores;
if (is_sat != l_true) {
IF_VERBOSE(100, verbose_stream() << "(opt.maxres minimization failed)\n";);
@ -738,7 +738,7 @@ public:
m_correction_set_size = correction_set_size;
}
TRACE("opt", tout << *mdl;);
TRACE("opt_verbose", tout << *mdl;);
rational upper(0);
@ -761,7 +761,7 @@ public:
m_model = mdl;
m_c.model_updated(mdl.get());
TRACE("opt", tout << "updated upper: " << upper << "\nmodel\n" << *m_model;);
TRACE("opt", tout << "updated upper: " << upper << "\n";);
for (soft& s : m_soft) {
s.set_value(m_model->is_true(s.s));
@ -838,16 +838,17 @@ public:
void commit_assignment() override {
if (m_found_feasible_optimum) {
TRACE("opt", tout << "Committing feasible solution\ndefs:" << m_defs << "\nasms:" << m_asms << "\n";);
add(m_defs);
add(m_asms);
TRACE("opt", tout << "Committing feasible solution\ndefs:" << m_defs << "\nasms:" << m_asms << "\n";);
}
// else: there is only a single assignment to these soft constraints.
}
void verify_core(exprs const& core) {
return;
IF_VERBOSE(3, verbose_stream() << "verify core " << s().check_sat(core.size(), core.c_ptr()) << "\n";);
IF_VERBOSE(1, verbose_stream() << "verify core " << s().check_sat(core.size(), core.c_ptr()) << "\n";);
ref<solver> _solver = mk_smt_solver(m, m_params, symbol());
_solver->assert_expr(s().get_assertions());
_solver->assert_expr(core);
@ -855,8 +856,11 @@ public:
IF_VERBOSE(0, verbose_stream() << "core status (l_false:) " << is_sat << " core size " << core.size() << "\n");
CTRACE("opt", is_sat != l_false,
for (expr* c : core) tout << "core: " << mk_pp(c, m) << "\n";
_solver->display(tout););
VERIFY(is_sat == l_false);
_solver->display(tout);
tout << "other solver\n";
s().display(tout);
);
VERIFY(is_sat == l_false || m.canceled());
}
void verify_assumptions() {