mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 09:05:31 +00:00
break on small cores
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
f020b7c7b8
commit
8141dadc89
14 changed files with 80 additions and 31 deletions
|
@ -190,11 +190,11 @@ public:
|
|||
r.reset();
|
||||
r.append(m_core.size(), m_core.c_ptr());
|
||||
}
|
||||
virtual void get_model(model_ref & m) {
|
||||
virtual void get_model(model_ref & mdl) {
|
||||
if (!m_model.get()) {
|
||||
extract_model();
|
||||
}
|
||||
m = m_model;
|
||||
mdl = m_model;
|
||||
}
|
||||
virtual proof * get_proof() {
|
||||
UNREACHABLE();
|
||||
|
@ -331,10 +331,10 @@ private:
|
|||
}
|
||||
sat::literal_vector const& core = m_solver.get_core();
|
||||
TRACE("opt",
|
||||
dep2asm_t::iterator it = dep2asm.begin();
|
||||
dep2asm_t::iterator end = dep2asm.end();
|
||||
for (; it != end; ++it) {
|
||||
tout << mk_pp(it->m_key, m) << " |-> " << sat::literal(it->m_value) << "\n";
|
||||
dep2asm_t::iterator it2 = dep2asm.begin();
|
||||
dep2asm_t::iterator end2 = dep2asm.end();
|
||||
for (; it2 != end2; ++it2) {
|
||||
tout << mk_pp(it2->m_key, m) << " |-> " << sat::literal(it2->m_value) << "\n";
|
||||
}
|
||||
tout << "core: ";
|
||||
for (unsigned i = 0; i < core.size(); ++i) {
|
||||
|
|
|
@ -58,7 +58,8 @@ struct mus::imp {
|
|||
unsigned idx = m_cls2expr.size();
|
||||
m_expr2cls.insert(cls, idx);
|
||||
m_cls2expr.push_back(cls);
|
||||
TRACE("opt", tout << idx << ": " << mk_pp(cls, m) << "\n";);
|
||||
TRACE("opt", tout << idx << ": " << mk_pp(cls, m) << "\n";
|
||||
display_vec(tout, m_cls2expr););
|
||||
return idx;
|
||||
}
|
||||
|
||||
|
@ -113,6 +114,11 @@ struct mus::imp {
|
|||
core.push_back(cls_id);
|
||||
}
|
||||
}
|
||||
TRACE("opt", display_vec(tout << "core exprs:", core_exprs);
|
||||
display_vec(tout << "core:", core);
|
||||
display_vec(tout << "mus:", mus);
|
||||
);
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -144,6 +150,21 @@ struct mus::imp {
|
|||
out << "\n";
|
||||
}
|
||||
|
||||
void display_vec(std::ostream& out, expr_ref_vector const& v) const {
|
||||
for (unsigned i = 0; i < v.size(); ++i) {
|
||||
out << mk_pp(v[i], m) << " ";
|
||||
}
|
||||
out << "\n";
|
||||
}
|
||||
|
||||
|
||||
void display_vec(std::ostream& out, ptr_vector<expr> const& v) const {
|
||||
for (unsigned i = 0; i < v.size(); ++i) {
|
||||
out << mk_pp(v[i], m) << " ";
|
||||
}
|
||||
out << "\n";
|
||||
}
|
||||
|
||||
void set_soft(unsigned sz, expr* const* soft, rational const* weights) {
|
||||
m_model.reset();
|
||||
m_weight.reset();
|
||||
|
|
|
@ -146,9 +146,9 @@ namespace opt {
|
|||
virtual void cancel() { set_cancel(true); }
|
||||
virtual void set_hard_constraints(ptr_vector<expr> & hard);
|
||||
virtual lbool optimize();
|
||||
virtual void get_model(model_ref& m);
|
||||
virtual void set_model(model_ref& m);
|
||||
virtual void fix_model(model_ref& m);
|
||||
virtual void get_model(model_ref& _m);
|
||||
virtual void set_model(model_ref& _m);
|
||||
virtual void fix_model(model_ref& _m);
|
||||
virtual void collect_statistics(statistics& stats) const;
|
||||
virtual proof* get_proof() { return 0; }
|
||||
virtual void get_labels(svector<symbol> & r) {}
|
||||
|
@ -186,7 +186,7 @@ namespace opt {
|
|||
void set_enable_sls(bool f) { m_enable_sls = f; }
|
||||
void set_soft_assumptions();
|
||||
symbol const& maxsat_engine() const { return m_maxsat_engine; }
|
||||
void get_base_model(model_ref& m);
|
||||
void get_base_model(model_ref& _m);
|
||||
|
||||
|
||||
private:
|
||||
|
|
|
@ -94,7 +94,7 @@ namespace opt {
|
|||
virtual void pop_core(unsigned n);
|
||||
virtual lbool check_sat_core(unsigned num_assumptions, expr * const * assumptions);
|
||||
virtual void get_unsat_core(ptr_vector<expr> & r);
|
||||
virtual void get_model(model_ref & m);
|
||||
virtual void get_model(model_ref & _m);
|
||||
virtual proof * get_proof();
|
||||
virtual std::string reason_unknown() const;
|
||||
virtual void get_labels(svector<symbol> & r);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue