3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-10 19:27:06 +00:00

return an empty model when the status of the solver is neither FEASIBLE nor OPTIMAL

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2020-04-13 16:36:44 -07:00
parent cb4ceeab3a
commit 6d8e5400fd

View file

@ -1207,7 +1207,11 @@ void lar_solver::get_infeasibility_explanation_for_inf_sign(
// (x, y) != (x', y') => (x + delta*y) != (x' + delta*y')
void lar_solver::get_model(std::unordered_map<var_index, mpq> & variable_values) const {
lp_assert(get_status() == lp_status::OPTIMAL || get_status() == lp_status::FEASIBLE);
if (!(get_status() == lp_status::OPTIMAL || get_status() == lp_status::FEASIBLE)) {
variable_values.clear();
return;
}
lp_assert(m_mpq_lar_core_solver.m_r_solver.calc_current_x_is_feasible_include_non_basis());
variable_values.clear();
mpq delta = m_mpq_lar_core_solver.find_delta_for_strict_bounds(mpq(1, 2)); // start from 0.5 to have less clashes