3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-12 20:18:18 +00:00
This commit is contained in:
Nikolaj Bjorner 2020-05-07 10:40:41 -07:00
parent fc6bdb9708
commit da9b037f2a

View file

@ -64,11 +64,10 @@ namespace opt {
expr_ref_vector asms(m); expr_ref_vector asms(m);
vector<expr_ref_vector> cores; vector<expr_ref_vector> cores;
obj_map<expr, rational>::iterator it = soft.begin(), end = soft.end(); for (auto const& kv : soft) {
for (; it != end; ++it) { assert_weighted(wth(), kv.m_key, kv.m_value);
assert_weighted(wth(), it->m_key, it->m_value); if (!is_true(kv.m_key)) {
if (!is_true(it->m_key)) { m_upper += kv.m_value;
m_upper += it->m_value;
} }
} }
wth().init_min_cost(m_upper - m_lower); wth().init_min_cost(m_upper - m_lower);
@ -104,6 +103,7 @@ namespace opt {
SASSERT(m_lower <= m_upper); SASSERT(m_lower <= m_upper);
} }
if (m_model)
update_assignment(); update_assignment();
if (m.inc() && is_sat == l_undef && m_lower == m_upper) { if (m.inc() && is_sat == l_undef && m_lower == m_upper) {