mirror of
https://github.com/Z3Prover/z3
synced 2025-08-11 05:30:51 +00:00
adding incremental cubing from API
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
260c27d58a
commit
e507a6ccd1
18 changed files with 194 additions and 9 deletions
|
@ -344,6 +344,25 @@ public:
|
|||
expr_ref result(lit2expr[l.index()].get(), m);
|
||||
return result;
|
||||
}
|
||||
virtual expr_ref cube() {
|
||||
sat::literal_vector lits;
|
||||
lbool result = m_solver.cube(lits);
|
||||
if (result == l_false || lits.empty()) {
|
||||
return expr_ref(m.mk_false(), m);
|
||||
}
|
||||
if (result == l_true) {
|
||||
return expr_ref(m.mk_true(), m);
|
||||
}
|
||||
expr_ref_vector fmls(m);
|
||||
expr_ref_vector lit2expr(m);
|
||||
lit2expr.resize(m_solver.num_vars() * 2);
|
||||
m_map.mk_inv(lit2expr);
|
||||
for (sat::literal l : lits) {
|
||||
fmls.push_back(lit2expr[l.index()].get());
|
||||
}
|
||||
return mk_and(fmls);
|
||||
}
|
||||
|
||||
virtual void get_lemmas(expr_ref_vector & lemmas) {
|
||||
if (!m_internalized) return;
|
||||
sat2goal s2g;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue