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

fix bug in core generation in legacy core: it ignores complementary literals

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2014-09-14 13:06:01 -07:00
parent a96fa0c555
commit 73070585b8
8 changed files with 25 additions and 21 deletions

View file

@ -356,16 +356,13 @@ private:
}
}
// TBD: this is super-expensive because of the
// bit-blasting model converter.
void extract_model() {
TRACE("sat", tout << "retrieve model\n";);
sat::model const & ll_m = m_solver.get_model();
if (ll_m.empty()) {
if (!m_solver.model_is_current()) {
m_model = 0;
return;
}
sat::model const & ll_m = m_solver.get_model();
model_ref md = alloc(model, m);
atom2bool_var::iterator it = m_map.begin();
atom2bool_var::iterator end = m_map.end();

View file

@ -130,6 +130,7 @@ public:
if (m_asm2weight.find(e, weight)) {
weight += w;
m_asm2weight.insert(e, weight);
m_upper += w;
return;
}
if (is_literal(e)) {
@ -154,6 +155,7 @@ public:
lbool mus_solver() {
init();
init_local();
trace_bounds("maxres");
while (m_lower < m_upper) {
TRACE("opt",
display_vec(tout, m_asms.size(), m_asms.c_ptr());
@ -776,6 +778,7 @@ public:
if (!m.is_true(tmp)) {
upper += m_weights[i];
}
TRACE("opt", tout << mk_pp(n, m) << " |-> " << mk_pp(tmp, m) << "\n";);
CTRACE("opt", !m.is_true(tmp) && !m.is_false(tmp),
tout << mk_pp(n, m) << " |-> " << mk_pp(tmp, m) << "\n";);
}

View file

@ -71,9 +71,9 @@ namespace opt {
}
TRACE("opt",
tout << m_upper << ": ";
tout << "upper: " << m_upper << " assignments: ";
for (unsigned i = 0; i < m_weights.size(); ++i) {
tout << (m_assignment[i]?"1":"0");
tout << (m_assignment[i]?"T":"F");
}
tout << "\n";);
}

View file

@ -830,6 +830,7 @@ namespace opt {
void context::update_bound(bool is_lower) {
expr_ref val(m);
if (!m_model.get()) return;
bool override = true;
for (unsigned i = 0; i < m_objectives.size(); ++i) {
objective const& obj = m_objectives[i];