Skip to content

Commit

Permalink
fix #7493
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolajBjorner committed Feb 2, 2025
1 parent 99cbfa7 commit 17d47ca
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/opt/opt_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ namespace opt {
smt::theory_var v = m_objective_vars[i];
bool has_shared = false;
m_last_model = nullptr;
blocker = nullptr;
//
// compute an optimization hint.
// The hint is valid if there are no shared symbols (a pure LP).
Expand All @@ -256,6 +257,7 @@ namespace opt {
if (!m_models[i])
m_models.set(i, m_last_model.get());

TRACE("opt", tout << "maximize " << i << " " << val << " " << m_objective_values[i] << " " << blocker << "\n";);
if (val > m_objective_values[i]) {
m_objective_values[i] = val;
}
Expand Down
6 changes: 2 additions & 4 deletions src/opt/optsmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,6 @@ namespace opt {
for (unsigned i = 0; i < obj_index; ++i)
commit_assignment(i);

// m_s->maximize_objective(obj_index, bound);
// m_s->assert_expr(bound);

unsigned steps = 0;
unsigned step_incs = 0;
rational delta_per_step(1);
Expand All @@ -216,9 +213,10 @@ namespace opt {
SASSERT(delta_per_step.is_pos());
is_sat = m_s->check_sat(0, nullptr);
TRACE("opt", tout << "check " << is_sat << "\n";
tout << "last bound: " << last_bound << "\n";
tout << "last bound: " << last_bound << " bound " << bound << "\n";
tout << "lower: " << m_lower[obj_index] << "\n";
tout << "upper: " << m_upper[obj_index] << "\n";
if (is_sat == l_true) m_s->display(tout);
);
if (is_sat == l_true) {
m_s->maximize_objective(obj_index, bound);
Expand Down
11 changes: 10 additions & 1 deletion src/smt/theory_lra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3858,12 +3858,21 @@ class theory_lra::imp {
vi = get_lpvar(v);

st = lp().maximize_term(vi, term_max);

if (has_int() && lp().has_inf_int()) {
st = lp::lp_status::FEASIBLE;
lp().restore_x();
}
if (m_nla && (st == lp::lp_status::OPTIMAL || st == lp::lp_status::UNBOUNDED)) {
st = lp::lp_status::FEASIBLE;
switch (check_nla()) {
case FC_DONE:
st = lp::lp_status::FEASIBLE;
break;
case FC_GIVEUP:
case FC_CONTINUE:
st = lp::lp_status::UNBOUNDED;
break;
}
lp().restore_x();
}
}
Expand Down

0 comments on commit 17d47ca

Please sign in to comment.