mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 09:05:31 +00:00
tune lra optimization
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
927d714d7b
commit
c725fe7698
8 changed files with 259 additions and 55 deletions
|
@ -1300,6 +1300,9 @@ namespace opt {
|
|||
}
|
||||
get_memory_statistics(stats);
|
||||
get_rlimit_statistics(m.limit(), stats);
|
||||
if (m_qmax) {
|
||||
m_qmax->collect_statistics(stats);
|
||||
}
|
||||
}
|
||||
|
||||
void context::collect_param_descrs(param_descrs & r) {
|
||||
|
@ -1440,6 +1443,9 @@ namespace opt {
|
|||
m_objectives[0].m_type != O_MINIMIZE) {
|
||||
return false;
|
||||
}
|
||||
if (!m_arith.is_real(m_objectives[0].m_term)) {
|
||||
return false;
|
||||
}
|
||||
for (unsigned i = 0; i < m_hard_constraints.size(); ++i) {
|
||||
if (has_quantifiers(m_hard_constraints[i].get())) {
|
||||
return true;
|
||||
|
@ -1456,12 +1462,21 @@ namespace opt {
|
|||
term = m_arith.mk_uminus(term);
|
||||
}
|
||||
inf_eps value;
|
||||
lbool result = qe::maximize(m_hard_constraints, term, value, m_model, m_params);
|
||||
m_qmax = alloc(qe::qmax, m, m_params);
|
||||
lbool result = (*m_qmax)(m_hard_constraints, term, value, m_model);
|
||||
if (result != l_undef && obj.m_type == O_MINIMIZE) {
|
||||
value.neg();
|
||||
}
|
||||
if (result != l_undef) {
|
||||
m_optsmt.setup(*m_opt_solver.get());
|
||||
m_optsmt.setup(*m_opt_solver.get());
|
||||
if (result == l_undef) {
|
||||
if (obj.m_type == O_MINIMIZE) {
|
||||
m_optsmt.update_upper(obj.m_index, value);
|
||||
}
|
||||
else {
|
||||
m_optsmt.update_lower(obj.m_index, value);
|
||||
}
|
||||
}
|
||||
else {
|
||||
m_optsmt.update_lower(obj.m_index, value);
|
||||
m_optsmt.update_upper(obj.m_index, value);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ Notes:
|
|||
#include "arith_decl_plugin.h"
|
||||
#include "bv_decl_plugin.h"
|
||||
#include "cmd_context.h"
|
||||
|
||||
#include "qsat.h"
|
||||
|
||||
namespace opt {
|
||||
|
||||
|
@ -145,6 +145,7 @@ namespace opt {
|
|||
ref<solver> m_solver;
|
||||
ref<solver> m_sat_solver;
|
||||
scoped_ptr<pareto_base> m_pareto;
|
||||
scoped_ptr<qe::qmax> m_qmax;
|
||||
sref_vector<model> m_box_models;
|
||||
unsigned m_box_index;
|
||||
params_ref m_params;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue