3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-05 06:45:45 +00:00

add model correction

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2016-04-29 19:08:10 -07:00
parent c75fd02c95
commit 2428bf18f1
11 changed files with 156 additions and 65 deletions

View file

@ -1162,8 +1162,7 @@ namespace qe {
m_level(0),
m_mode(mode),
m_avars(m),
m_free_vars(m),
m_value(m)
m_free_vars(m)
{
reset();
}
@ -1283,17 +1282,15 @@ namespace qe {
}
app* m_objective;
expr_ref m_value;
opt::bound_type m_bound;
opt::inf_eps m_value;
bool m_was_sat;
lbool maximize(expr_ref_vector const& fmls, app* t, expr_ref& value, opt::bound_type& bound) {
lbool maximize(expr_ref_vector const& fmls, app* t, opt::inf_eps& value) {
expr_ref_vector defs(m);
expr_ref fml = negate_core(fmls);
hoist(fml);
m_objective = t;
m_value = 0;
m_bound = opt::unbounded;
m_value = opt::inf_eps();
m_was_sat = false;
m_pred_abs.abstract_atoms(fml, defs);
fml = m_pred_abs.mk_abstract(fml);
@ -1319,7 +1316,6 @@ namespace qe {
throw tactic_exception(s.c_str());
}
value = m_value;
bound = m_bound;
return l_true;
}
@ -1327,16 +1323,16 @@ namespace qe {
TRACE("qe", tout << "maximize: " << core << "\n";);
m_was_sat |= !core.empty();
expr_ref bound(m);
m_bound = m_mbp.maximize(core, mdl, m_objective, m_value, bound);
m_value = m_mbp.maximize(core, mdl, m_objective, bound);
m_ex.assert_expr(bound);
}
};
lbool maximize(expr_ref_vector const& fmls, app* t, expr_ref& value, opt::bound_type& bound, params_ref const& p) {
lbool maximize(expr_ref_vector const& fmls, app* t, opt::inf_eps& value, params_ref const& p) {
ast_manager& m = fmls.get_manager();
qsat qs(m, p, qsat_maximize);
return qs.maximize(fmls, t, value, bound);
return qs.maximize(fmls, t, value);
}
};