3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 09:05:31 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2016-04-28 21:31:16 -07:00
parent c414c6b5fd
commit c75fd02c95
5 changed files with 145 additions and 33 deletions

View file

@ -42,6 +42,7 @@ Notes:
#include "filter_model_converter.h"
#include "ast_pp_util.h"
#include "inc_sat_solver.h"
#include "qsat.h"
namespace opt {
@ -1439,4 +1440,42 @@ namespace opt {
}
}
}
bool context::is_qsat_opt() {
if (m_objectives.size() != 1) {
return false;
}
if (m_objectives[0].m_type != O_MAXIMIZE &&
m_objectives[0].m_type != O_MINIMIZE) {
return false;
}
for (unsigned i = 0; i < m_hard_constraints.size(); ++i) {
if (has_quantifiers(m_hard_constraints[i].get())) {
return true;
}
}
return false;
}
lbool context::run_qsat_opt() {
SASSERT(is_qsat_opt());
app_ref objective(m);
opt::bound_type bound;
expr_ref value(m);
lbool result = qe::maximize(m_hard_constraints, objective, value, bound, m_params);
if (result != l_undef) {
switch (bound) {
case opt::unbounded:
case opt::strict:
case opt::non_strict:
// set_max
break;
// TBD:
default:
break;
}
}
return l_undef;
}
}

View file

@ -289,12 +289,15 @@ namespace opt {
void display_benchmark();
// pareto
void yield();
expr_ref mk_ge(expr* t, expr* s);
expr_ref mk_cmp(bool is_ge, model_ref& mdl, objective const& obj);
// quantifiers
bool is_qsat_opt();
lbool run_qsat_opt();
};
}