mirror of
https://github.com/Z3Prover/z3
synced 2025-06-06 06:03:23 +00:00
Merge branch 'opt' of https://git01.codeplex.com/z3 into opt
This commit is contained in:
commit
f4dfb9ac82
2 changed files with 7 additions and 6 deletions
|
@ -218,6 +218,7 @@ namespace opt {
|
||||||
}
|
}
|
||||||
IF_VERBOSE(1, verbose_stream() << "(optimize:sat)\n";);
|
IF_VERBOSE(1, verbose_stream() << "(optimize:sat)\n";);
|
||||||
s.get_model(m_model);
|
s.get_model(m_model);
|
||||||
|
TRACE("opt", model_smt2_pp(tout, m, *m_model, 0););
|
||||||
m_optsmt.setup(*m_opt_solver.get());
|
m_optsmt.setup(*m_opt_solver.get());
|
||||||
update_lower();
|
update_lower();
|
||||||
switch (m_objectives.size()) {
|
switch (m_objectives.size()) {
|
||||||
|
@ -566,7 +567,7 @@ namespace opt {
|
||||||
and_then(mk_simplify_tactic(m),
|
and_then(mk_simplify_tactic(m),
|
||||||
mk_propagate_values_tactic(m),
|
mk_propagate_values_tactic(m),
|
||||||
mk_solve_eqs_tactic(m),
|
mk_solve_eqs_tactic(m),
|
||||||
mk_elim_uncnstr_tactic(m),
|
// NB: mk_elim_uncstr_tactic(m) is not sound with soft constraints
|
||||||
mk_simplify_tactic(m));
|
mk_simplify_tactic(m));
|
||||||
opt_params optp(m_params);
|
opt_params optp(m_params);
|
||||||
tactic_ref tac2, tac3;
|
tactic_ref tac2, tac3;
|
||||||
|
|
|
@ -124,14 +124,14 @@ namespace opt {
|
||||||
|
|
||||||
|
|
||||||
expr_ref_vector ors(m), disj(m);
|
expr_ref_vector ors(m), disj(m);
|
||||||
expr_ref or(m), bound(m.mk_true(), m);
|
expr_ref fml(m), bound(m.mk_true(), m);
|
||||||
for (unsigned i = 0; i < m_upper.size(); ++i) {
|
for (unsigned i = 0; i < m_upper.size(); ++i) {
|
||||||
ors.push_back(m_s->mk_ge(i, m_upper[i]));
|
ors.push_back(m_s->mk_ge(i, m_upper[i]));
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
solver::scoped_push _push(*m_s);
|
solver::scoped_push _push(*m_s);
|
||||||
or = m.mk_or(ors.size(), ors.c_ptr());
|
fml = m.mk_or(ors.size(), ors.c_ptr());
|
||||||
m_s->assert_expr(or);
|
m_s->assert_expr(fml);
|
||||||
lbool is_sat = l_true;
|
lbool is_sat = l_true;
|
||||||
while (!m_cancel) {
|
while (!m_cancel) {
|
||||||
is_sat = m_s->check_sat(0,0);
|
is_sat = m_s->check_sat(0,0);
|
||||||
|
@ -149,8 +149,8 @@ namespace opt {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
set_max(m_lower, m_s->get_objective_values(), disj);
|
set_max(m_lower, m_s->get_objective_values(), disj);
|
||||||
or = m.mk_or(ors.size(), ors.c_ptr());
|
fml = m.mk_or(ors.size(), ors.c_ptr());
|
||||||
m_s->assert_expr(or);
|
m_s->assert_expr(fml);
|
||||||
}
|
}
|
||||||
else if (is_sat == l_undef) {
|
else if (is_sat == l_undef) {
|
||||||
return l_undef;
|
return l_undef;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue