3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 09:05:31 +00:00

update core generation to be partial, update maxres to use current model too

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2014-09-02 19:05:28 -07:00
parent 3f8083dfa6
commit b5bbf83847
9 changed files with 36 additions and 17 deletions

View file

@ -367,8 +367,12 @@ private:
void extract_model() {
TRACE("sat", tout << "retrieve model\n";);
model_ref md = alloc(model, m);
sat::model const & ll_m = m_solver.get_model();
if (ll_m.empty()) {
m_model = 0;
return;
}
model_ref md = alloc(model, m);
atom2bool_var::iterator it = m_map.begin();
atom2bool_var::iterator end = m_map.end();
for (; it != end; ++it) {

View file

@ -156,7 +156,7 @@ public:
lbool mus_solver() {
init();
init_local();
while (true) {
while (m_lower < m_upper) {
TRACE("opt",
display_vec(tout, m_asms.size(), m_asms.c_ptr());
s().display(tout);
@ -167,6 +167,7 @@ public:
if (m_cancel) {
return l_undef;
}
model_ref mdl;
switch (is_sat) {
case l_true:
found_optimum();
@ -174,6 +175,7 @@ public:
case l_false:
is_sat = process_unsat();
if (is_sat != l_true) return is_sat;
get_mus_model(mdl);
break;
case l_undef:
return l_undef;
@ -359,14 +361,16 @@ public:
// likewise, if the cores are too big, don't block the cores.
//
process_unsat(cores);
exprs cs;
get_current_correction_set(cs);
unsigned max_core = max_core_size(cores);
if (cs.size() <= std::max(max_core, m_max_correction_set_size)) {
if (!cs.empty() && cs.size() < max_core) {
process_sat(cs);
}
else {
process_unsat(cores);
}
}
m_lower = m_upper;
@ -465,6 +469,7 @@ public:
cs.push_back(m_asms[i].get());
}
}
IF_VERBOSE(2, verbose_stream() << "(opt.maxres correction set size: " << cs.size() << ")\n";);
TRACE("opt", display_vec(tout << "new correction set: ", cs.size(), cs.c_ptr()););
}
@ -554,7 +559,7 @@ public:
if (m_c.sat_enabled()) {
// SAT solver core extracts some model
// during unsat core computation.
s().get_model(mdl);
s().get_model(mdl);
}
else {
w = m_mus.get_best_model(mdl);

View file

@ -451,7 +451,7 @@ namespace opt {
m_maxsat_engine != symbol("sls")) {
return;
}
m_params.set_bool("minimize_core", true);
m_params.set_bool("minimize_core_partial", true);
m_sat_solver = mk_inc_sat_solver(m, m_params);
unsigned sz = get_solver().get_num_assertions();
for (unsigned i = 0; i < sz; ++i) {