mirror of
https://github.com/Z3Prover/z3
synced 2025-04-28 03:15:50 +00:00
merge with master
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
commit
c513f3ca09
883 changed files with 13979 additions and 16480 deletions
|
@ -69,7 +69,7 @@ namespace opt {
|
|||
|
||||
solver* opt_solver::translate(ast_manager& m, params_ref const& p) {
|
||||
UNREACHABLE();
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void opt_solver::collect_param_descrs(param_descrs & r) {
|
||||
|
@ -227,9 +227,13 @@ namespace opt {
|
|||
smt::theory_var v = m_objective_vars[i];
|
||||
bool has_shared = false;
|
||||
inf_eps val = get_optimizer().maximize(v, blocker, has_shared);
|
||||
get_model(m_model);
|
||||
inf_eps val2;
|
||||
m_valid_objectives[i] = true;
|
||||
TRACE("opt", tout << (has_shared?"has shared":"non-shared") << "\n";);
|
||||
if (!m_models[i]) {
|
||||
set_model(i);
|
||||
}
|
||||
if (m_context.get_context().update_model(has_shared)) {
|
||||
if (has_shared && val != current_objective_value(i)) {
|
||||
decrement_value(i, val);
|
||||
|
@ -247,7 +251,7 @@ namespace opt {
|
|||
tout << "objective: " << mk_pp(m_objective_terms[i].get(), m) << "\n";
|
||||
tout << "maximal value: " << val << "\n";
|
||||
tout << "new condition: " << blocker << "\n";
|
||||
model_smt2_pp(tout << "update model:\n", m, *m_models[i], 0); });
|
||||
if (m_models[i]) model_smt2_pp(tout << "update model:\n", m, *m_models[i], 0); });
|
||||
}
|
||||
|
||||
void opt_solver::set_model(unsigned i) {
|
||||
|
@ -261,7 +265,7 @@ namespace opt {
|
|||
expr_ref ge = mk_ge(i, val);
|
||||
TRACE("opt", tout << ge << "\n";);
|
||||
assert_expr(ge);
|
||||
lbool is_sat = m_context.check(0, 0);
|
||||
lbool is_sat = m_context.check(0, nullptr);
|
||||
is_sat = adjust_result(is_sat);
|
||||
if (is_sat == l_true) {
|
||||
set_model(i);
|
||||
|
@ -299,6 +303,7 @@ namespace opt {
|
|||
|
||||
void opt_solver::get_model_core(model_ref & m) {
|
||||
m_context.get_model(m);
|
||||
if (!m) m = m_model; else m_model = m;
|
||||
}
|
||||
|
||||
proof * opt_solver::get_proof() {
|
||||
|
@ -316,7 +321,7 @@ namespace opt {
|
|||
void opt_solver::get_labels(svector<symbol> & r) {
|
||||
r.reset();
|
||||
buffer<symbol> tmp;
|
||||
m_context.get_relevant_labels(0, tmp);
|
||||
m_context.get_relevant_labels(nullptr, tmp);
|
||||
r.append(tmp.size(), tmp.c_ptr());
|
||||
}
|
||||
|
||||
|
@ -340,7 +345,7 @@ namespace opt {
|
|||
m_objective_values.push_back(inf_eps(rational(-1), inf_rational()));
|
||||
m_objective_terms.push_back(term);
|
||||
m_valid_objectives.push_back(true);
|
||||
m_models.push_back(0);
|
||||
m_models.push_back(nullptr);
|
||||
return v;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue