3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-08 20:21:23 +00:00

tune initialization for wmax and sortmax

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2016-11-19 08:04:06 -08:00
parent ea601dd403
commit df0e3a100c
5 changed files with 32 additions and 12 deletions

View file

@ -48,14 +48,18 @@ namespace opt {
rational offset = m_lower;
m_upper = offset;
bool was_sat = false;
expr_ref_vector disj(m);
obj_map<expr, rational>::iterator it = soft.begin(), end = soft.end();
for (; it != end; ++it) {
wth().assert_weighted(it->m_key, it->m_value);
expr_ref tmp(m);
if (!m_model->eval(it->m_key, tmp) || !m.is_true(tmp)) {
bool is_true = m_model->eval(it->m_key, tmp) && m.is_true(tmp);
expr* c = wth().assert_weighted(it->m_key, it->m_value, is_true);
if (!is_true) {
m_upper += it->m_value;
disj.push_back(c);
}
}
s().assert_expr(mk_or(disj));
trace_bounds("wmax");
while (l_true == is_sat && m_lower < m_upper) {
is_sat = s().check_sat(0, 0);