mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 03:45:51 +00:00
fix mb maximization logic, so far not accessible
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
c7ff05cc78
commit
9c099d6b1b
12 changed files with 318 additions and 109 deletions
|
@ -285,9 +285,9 @@ class mbp::impl {
|
|||
public:
|
||||
|
||||
|
||||
opt::inf_eps maximize(expr_ref_vector const& fmls, model& mdl, app* t, expr_ref& bound) {
|
||||
opt::inf_eps maximize(expr_ref_vector const& fmls, model& mdl, app* t, expr_ref& ge, expr_ref& gt) {
|
||||
arith_project_plugin arith(m);
|
||||
return arith.maximize(fmls, mdl, t, bound);
|
||||
return arith.maximize(fmls, mdl, t, ge, gt);
|
||||
}
|
||||
|
||||
void extract_literals(model& model, expr_ref_vector& fmls) {
|
||||
|
@ -428,7 +428,16 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
bool validate_model(model& model, expr_ref_vector const& fmls) {
|
||||
expr_ref val(m);
|
||||
for (unsigned i = 0; i < fmls.size(); ++i) {
|
||||
VERIFY(model.eval(fmls[i], val) && m.is_true(val));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void operator()(bool force_elim, app_ref_vector& vars, model& model, expr_ref_vector& fmls) {
|
||||
SASSERT(validate_model(model, fmls));
|
||||
expr_ref val(m), tmp(m);
|
||||
app_ref var(m);
|
||||
expr_ref_vector unused_fmls(m);
|
||||
|
@ -446,6 +455,7 @@ public:
|
|||
}
|
||||
}
|
||||
while (!vars.empty() && !fmls.empty()) {
|
||||
std::cout << "mbp: " << var << "\n";
|
||||
var = vars.back();
|
||||
vars.pop_back();
|
||||
project_plugin* p = get_plugin(var);
|
||||
|
@ -483,6 +493,7 @@ public:
|
|||
vars.reset();
|
||||
}
|
||||
fmls.append(unused_fmls);
|
||||
SASSERT(validate_model(model, fmls));
|
||||
TRACE("qe", tout << vars << " " << fmls << "\n";);
|
||||
}
|
||||
|
||||
|
@ -508,6 +519,6 @@ void mbp::extract_literals(model& model, expr_ref_vector& lits) {
|
|||
m_impl->extract_literals(model, lits);
|
||||
}
|
||||
|
||||
opt::inf_eps mbp::maximize(expr_ref_vector const& fmls, model& mdl, app* t, expr_ref& bound) {
|
||||
return m_impl->maximize(fmls, mdl, t, bound);
|
||||
opt::inf_eps mbp::maximize(expr_ref_vector const& fmls, model& mdl, app* t, expr_ref& ge, expr_ref& gt) {
|
||||
return m_impl->maximize(fmls, mdl, t, ge, gt);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue