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 2022-10-28 14:12:28 -07:00
parent 91cdc082c4
commit 0e651eee04

View file

@ -288,6 +288,8 @@ namespace opt {
if (l_true != m_context.check(0, nullptr)) if (l_true != m_context.check(0, nullptr))
return false; return false;
m_context.get_model(m_last_model); m_context.get_model(m_last_model);
if (!m_last_model)
return false;
update_objective(); update_objective();
return ok; return ok;
}; };
@ -299,7 +301,9 @@ namespace opt {
TRACE("opt", tout << "updated\n";); TRACE("opt", tout << "updated\n";);
m_last_model = nullptr; m_last_model = nullptr;
m_context.get_model(m_last_model); m_context.get_model(m_last_model);
if (!has_shared || val == current_objective_value(i)) if (!m_last_model)
return false;
else if (!has_shared || val == current_objective_value(i))
m_models.set(i, m_last_model.get()); m_models.set(i, m_last_model.get());
else if (!check_bound()) else if (!check_bound())
return false; return false;