3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-17 16:52:15 +00:00

added facility to persist model transformations

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-11-02 00:05:52 -05:00
commit fd49a0c89c
195 changed files with 3601 additions and 2139 deletions

View file

@ -315,14 +315,13 @@ public:
void found_optimum() {
IF_VERBOSE(1, verbose_stream() << "found optimum\n";);
rational upper(0);
m_lower.reset();
for (unsigned i = 0; i < m_soft.size(); ++i) {
m_assignment[i] = is_true(m_soft[i]);
if (!m_assignment[i]) {
upper += m_weights[i];
m_lower += m_weights[i];
}
}
SASSERT(upper == m_lower);
m_upper = m_lower;
m_found_feasible_optimum = true;
}
@ -399,10 +398,11 @@ public:
void get_current_correction_set(model* mdl, exprs& cs) {
cs.reset();
if (!mdl) return;
for (unsigned i = 0; i < m_asms.size(); ++i) {
if (is_false(mdl, m_asms[i].get())) {
cs.push_back(m_asms[i].get());
for (expr* a : m_asms) {
if (is_false(mdl, a)) {
cs.push_back(a);
}
TRACE("opt", expr_ref tmp(m); mdl->eval(a, tmp, true); tout << mk_pp(a, m) << ": " << tmp << "\n";);
}
TRACE("opt", display_vec(tout << "new correction set: ", cs););
}
@ -511,6 +511,7 @@ public:
trace();
if (m_c.num_objectives() == 1 && m_pivot_on_cs && m_csmodel.get() && m_correction_set_size < core.size()) {
exprs cs;
TRACE("opt", tout << "cs " << m_correction_set_size << " " << core.size() << "\n";);
get_current_correction_set(m_csmodel.get(), cs);
m_correction_set_size = cs.size();
if (m_correction_set_size < core.size()) {

View file

@ -818,7 +818,7 @@ namespace opt {
bool is_max = is_maximize(fml, term, orig_term, index);
bool is_min = !is_max && is_minimize(fml, term, orig_term, index);
if (is_min && get_pb_sum(term, terms, weights, offset)) {
TRACE("opt", tout << "try to convert minimization" << mk_pp(term, m) << "\n";);
TRACE("opt", tout << "try to convert minimization\n" << mk_pp(term, m) << "\n";);
// minimize 2*x + 3*y
// <=>
// (assert-soft (not x) 2)

View file

@ -47,8 +47,9 @@ namespace opt {
m_dump_benchmarks(false),
m_first(true),
m_was_unknown(false) {
solver::updt_params(p);
m_params.updt_params(p);
if (m_params.m_case_split_strategy == CS_ACTIVITY_DELAY_NEW) {
if (m_params.m_case_split_strategy == CS_ACTIVITY_DELAY_NEW) {
m_params.m_relevancy_lvl = 0;
}
// m_params.m_auto_config = false;