3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-07-18 02:16:40 +00:00

fix conflict level detection bug with plugins

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-02-02 11:04:15 -08:00
commit 6bb0b196e2
7 changed files with 49 additions and 60 deletions

View file

@ -193,7 +193,6 @@ public:
trace();
if (is_sat != l_true) return is_sat;
while (m_lower < m_upper) {
if (m_lower >= m_upper) break;
TRACE("opt",
display_vec(tout, m_asms);
s().display(tout);
@ -206,6 +205,7 @@ public:
}
switch (is_sat) {
case l_true:
SASSERT(is_true(m_asms));
found_optimum();
return l_true;
case l_false:
@ -223,6 +223,7 @@ public:
break;
}
}
found_optimum();
trace();
return l_true;
}
@ -296,18 +297,24 @@ public:
}
else {
is_sat = check_sat(asms.size(), asms.c_ptr());
}
}
return is_sat;
}
lbool check_sat(unsigned sz, expr* const* asms) {
return s().check_sat(sz, asms);
lbool r = s().check_sat(sz, asms);
if (r == l_true) {
model_ref mdl;
s().get_model(mdl);
if (mdl.get()) {
update_assignment(mdl.get());
}
}
return r;
}
void found_optimum() {
IF_VERBOSE(1, verbose_stream() << "found optimum\n";);
s().get_model(m_model);
SASSERT(is_true(m_asms));
rational upper(0);
for (unsigned i = 0; i < m_soft.size(); ++i) {
m_assignment[i] = is_true(m_soft[i]);
@ -745,6 +752,7 @@ public:
nsoft.push_back(mk_not(m, m_soft[i]));
}
fml = u.mk_lt(nsoft.size(), m_weights.c_ptr(), nsoft.c_ptr(), m_upper);
TRACE("opt", tout << "block upper bound " << fml << "\n";);;
s().assert_expr(fml);
}

View file

@ -570,11 +570,11 @@ namespace opt {
m_opt_solver = alloc(opt_solver, m, m_params, m_fm);
m_opt_solver->set_logic(m_logic);
m_solver = m_opt_solver.get();
m_opt_solver->ensure_pb();
if (opt_params(m_params).priority() == symbol("pareto") ||
(opt_params(m_params).priority() == symbol("lex") && m_objectives.size() > 1)) {
m_opt_solver->ensure_pb();
}
//if (opt_params(m_params).priority() == symbol("pareto") ||
// (opt_params(m_params).priority() == symbol("lex") && m_objectives.size() > 1)) {
//}
}
void context::setup_arith_solver() {