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

tune lexicographic products, avoid push/pop and ensure correction sets are not used for multiple objectives

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2015-09-13 16:00:45 +02:00
parent e3840a7fc6
commit b25e8e2288
3 changed files with 19 additions and 2 deletions

View file

@ -314,12 +314,27 @@ namespace opt {
}
}
/**
\brief there is no need to use push/pop when all objectives are maxsat and engine
is maxres.
*/
bool context::scoped_lex() {
if (m_maxsat_engine == symbol("maxres")) {
for (unsigned i = 0; i < m_objectives.size(); ++i) {
if (m_objectives[i].m_type != O_MAXSMT) return true;
}
return false;
}
return true;
}
lbool context::execute_lex() {
lbool r = l_true;
bool sc = scoped_lex();
IF_VERBOSE(1, verbose_stream() << "(optsmt:lex)\n";);
for (unsigned i = 0; r == l_true && i < m_objectives.size(); ++i) {
bool is_last = i + 1 == m_objectives.size();
r = execute(m_objectives[i], i + 1 < m_objectives.size(), !is_last);
r = execute(m_objectives[i], i + 1 < m_objectives.size(), sc && !is_last);
if (r == l_true && !get_lower_as_num(i).is_finite()) {
return r;
}