3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 03:45:51 +00:00

incremental sat

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2014-07-30 11:12:15 -07:00
parent 4f0de9a0cf
commit 3fefed69b7
4 changed files with 129 additions and 49 deletions

View file

@ -41,7 +41,7 @@ Notes:
#include "uint_set.h"
#include "opt_sls_solver.h"
#include "pb_preprocess_tactic.h"
#include "inc_sat_solver.h"
namespace opt {
@ -129,20 +129,29 @@ namespace opt {
return true;
}
void maxsmt_solver_base::enable_inc_bvsat() {
}
void maxsmt_solver_base::enable_noninc_bvsat() {
tactic_ref pb2bv = mk_card2bv_tactic(m, m_params);
tactic_ref bv2sat = mk_qfbv_tactic(m, m_params);
tactic_ref tac = and_then(pb2bv.get(), bv2sat.get());
solver* sat_solver = mk_tactic2solver(m, tac.get(), m_params);
unsigned sz = s().get_num_assertions();
for (unsigned i = 0; i < sz; ++i) {
sat_solver->assert_expr(s().get_assertion(i));
}
unsigned lvl = m_s->get_scope_level();
while (lvl > 0) { sat_solver->push(); --lvl; }
m_s = sat_solver;
m_sat_enabled = true;
}
void maxsmt_solver_base::enable_bvsat() {
if (m_enable_sat && !m_sat_enabled && probe_bv()) {
tactic_ref pb2bv = mk_card2bv_tactic(m, m_params);
tactic_ref bv2sat = mk_qfbv_tactic(m, m_params);
tactic_ref tac = and_then(pb2bv.get(), bv2sat.get());
solver* sat_solver = mk_tactic2solver(m, tac.get(), m_params);
unsigned sz = s().get_num_assertions();
for (unsigned i = 0; i < sz; ++i) {
sat_solver->assert_expr(s().get_assertion(i));
}
unsigned lvl = m_s->get_scope_level();
while (lvl > 0) { sat_solver->push(); --lvl; }
m_s = sat_solver;
m_sat_enabled = true;
enable_noninc_bvsat();
}
}