3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-28 11:25:51 +00:00

fix lex bug for maxres case

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2014-10-11 01:05:30 -07:00
parent 70f5eb4a9d
commit f7f4feaa47
5 changed files with 57 additions and 40 deletions

View file

@ -1203,10 +1203,15 @@ namespace opt {
}
case O_MAXSMT: {
maxsmt& ms = *m_maxsmts.find(obj.m_id);
rational value(0);
for (unsigned i = 0; i < obj.m_terms.size(); ++i) {
VERIFY(m_model->eval(obj.m_terms[i], val));
if (!m.is_true(val)) {
value += obj.m_weights[i];
}
// TBD: check that optimal was not changed.
}
TRACE("opt", tout << "value " << value << "\n";);
break;
}
}