Skip to content

Commit 20dc59e

Browse files
fix #2523
Signed-off-by: Nikolaj Bjorner <[email protected]>
1 parent 2e6908b commit 20dc59e

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/opt/optsmt.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ namespace opt {
199199
m_s->maximize_objective(obj_index, bound);
200200
m_s->get_model(m_model);
201201
SASSERT(m_model);
202-
m_s->get_labels(m_labels);
203202
inf_eps obj = m_s->saved_objective_value(obj_index);
204203
update_lower_lex(obj_index, obj, is_maximize);
205204
if (!is_int || !m_lower[obj_index].is_finite()) {
@@ -374,7 +373,8 @@ namespace opt {
374373
m_s->maximize_objective(i, tmp);
375374
m_lower[i] = m_s->saved_objective_value(i);
376375
}
377-
376+
m_best_model = m_model;
377+
m_s->get_labels(m_labels);
378378
m_context.set_model(m_model);
379379
}
380380
}
@@ -525,7 +525,6 @@ namespace opt {
525525

526526
m_s->maximize_objective(obj_index, bound);
527527
m_s->get_model(m_model);
528-
m_s->get_labels(m_labels);
529528
inf_eps obj = m_s->saved_objective_value(obj_index);
530529
update_lower_lex(obj_index, obj, is_maximize);
531530
TRACE("opt", tout << "strengthen bound: " << bound << "\n";);
@@ -590,7 +589,7 @@ namespace opt {
590589
}
591590

592591
void optsmt::get_model(model_ref& mdl, svector<symbol> & labels) {
593-
mdl = m_model.get();
592+
mdl = m_best_model.get();
594593
labels = m_labels;
595594
}
596595

src/opt/optsmt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace opt {
3939
expr_ref_vector m_lower_fmls;
4040
svector<smt::theory_var> m_vars;
4141
symbol m_optsmt_engine;
42-
model_ref m_model;
42+
model_ref m_model, m_best_model;
4343
svector<symbol> m_labels;
4444
sref_vector<model> m_models;
4545
public:

src/smt/theory_seq.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,7 +1472,6 @@ bool theory_seq::branch_variable_mb() {
14721472
break;
14731473
}
14741474
}
1475-
CTRACE("seq", change, get_context().display(tout << "branch_variable_mb\n"););
14761475
return change;
14771476
}
14781477

@@ -2290,6 +2289,7 @@ void theory_seq::propagate_lit(dependency* dep, unsigned n, literal const* _lits
22902289
return;
22912290
TRACE("seq",
22922291
tout << "scope: " << ctx.get_scope_level() << "\n";
2292+
tout << lits << "\n";
22932293
ctx.display_detailed_literal(tout << "assert:", lit);
22942294
ctx.display_literals_verbose(tout << " <- ", lits);
22952295
if (!lits.empty()) tout << "\n"; display_deps(tout, dep););
@@ -2601,7 +2601,6 @@ bool theory_seq::is_var(expr* a) const {
26012601
!m_util.str.is_unit(a) &&
26022602
!m_util.str.is_itos(a) &&
26032603
!m_util.str.is_nth_i(a) &&
2604-
// !m_util.str.is_extract(a) &&
26052604
!m.is_ite(a);
26062605
}
26072606

0 commit comments

Comments
 (0)