3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-28 19:35:50 +00:00

disable 'optimization' that led to wrong model'

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2013-12-15 02:40:52 +02:00
parent ac893e907f
commit 50f18a77af
4 changed files with 11 additions and 3 deletions

View file

@ -122,7 +122,7 @@ namespace opt {
lbool context::execute_min_max(unsigned index, bool committed) {
lbool result = m_optsmt.lex(index);
if (committed) m_optsmt.commit_assignment(index);
if (committed && result == l_true) m_optsmt.get_model(m_model);
if (result == l_true) m_optsmt.get_model(m_model);
return result;
}
@ -130,7 +130,7 @@ namespace opt {
maxsmt& ms = *m_maxsmts.find(id);
lbool result = ms(get_solver());
if (committed) ms.commit_assignment();
if (committed && result == l_true) ms.get_model(m_model);
if (result == l_true) ms.get_model(m_model);
return result;
}
@ -736,6 +736,9 @@ namespace opt {
maxsmt& ms = *m_maxsmts.find(obj.m_id);
for (unsigned i = 0; i < obj.m_terms.size(); ++i) {
VERIFY(m_model->eval(obj.m_terms[i], val));
CTRACE("opt",ms.get_assignment(i) != (m.mk_true() == val),
tout << mk_pp(obj.m_terms[i], m) << " evaluates to " << val << "\n";
model_smt2_pp(tout, m, *m_model, 0););
SASSERT(ms.get_assignment(i) == (m.mk_true() == val));
}
break;