3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-08 18:31:49 +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

@ -507,7 +507,7 @@ public:
--m_correction_set_size;
}
trace();
if (m_pivot_on_cs && m_csmodel.get() && m_correction_set_size < core.size()) {
if (m_c.num_objectives() == 1 && m_pivot_on_cs && m_csmodel.get() && m_correction_set_size < core.size()) {
exprs cs;
get_current_correction_set(m_csmodel.get(), cs);
m_correction_set_size = cs.size();

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;
}

View file

@ -54,6 +54,7 @@ namespace opt {
virtual symbol const& maxsat_engine() const = 0; // retrieve maxsat engine configuration parameter.
virtual void get_base_model(model_ref& _m) = 0; // retrieve model from initial satisfiability call.
virtual smt::context& smt_context() = 0; // access SMT context for SMT based MaxSMT solver (wmax requires SMT core)
virtual unsigned num_objectives() = 0;
};
/**
@ -228,6 +229,7 @@ namespace opt {
lbool execute_lex();
lbool execute_box();
lbool execute_pareto();
bool scoped_lex();
expr_ref to_expr(inf_eps const& n);
void reset_maxsmts();