3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

Merge pull request #1606 from NikolajBjorner/opt

This integrates several features and improvements to the SAT and finite domain solver.

- The SAT solver by default handle cardinality and PB constraints using a custom plugin that operates directly on cardinality and PB constraints.
- A parallel mode is available for select theories, including QF_BV. By setting parallel.enable=true Z3 will spawn a number of worker threads proportional to the number of available CPU cores to apply cube and conquer solving on the goal.
- A "cube" interface is exposed over the solver API. 
- Model conversion is first class over the textual API, such that subgoals created from running a solver can be passed in text files and a model for the original formula can be recreated from the result.
- This has also led to changes in how models are tracked over tactic subgoals. The API for extracting models from apply_result have been replaced.
- An optional mode handles xor constraints using a custom xor propagator. It is off by default and its value not demonstrated.
- The SAT solver includes new inprocessing technques that are available during simplification. It performs asymmetric tautology elimination by default, and one can turn on more powerful inprocessing techniques (known as ACCE, ABCE, CCE). Asymmetric branching also uses features introduced in Lingeling by exploiting binary implication graphs.

- A breaking change to the API is that parsers for SMT-LIB2 formulas return a vector of formulas as opposed to a conjunction of formulas. The vector of formulas correspond to the set of "assert" instructions in the SMT-LIB input.
This commit is contained in:
Nikolaj Bjorner 2018-05-23 08:47:08 -07:00 committed by GitHub
commit 75eba45926
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
378 changed files with 29494 additions and 6481 deletions

View file

@ -129,12 +129,8 @@ class nlsat_tactic : public tactic {
}
void operator()(goal_ref const & g,
goal_ref_buffer & result,
model_converter_ref & mc,
proof_converter_ref & pc,
expr_dependency_ref & core) {
goal_ref_buffer & result) {
SASSERT(g->is_well_sorted());
mc = nullptr; pc = nullptr; core = nullptr;
tactic_report report("nlsat", *g);
if (g->is_decided()) {
@ -166,9 +162,11 @@ class nlsat_tactic : public tactic {
if (!contains_unsupported(b2a, x2t)) {
// If mk_model is false it means that the model produced by nlsat
// assigns noninteger values to integer variables
model_converter_ref mc;
if (mk_model(*g.get(), b2a, x2t, mc)) {
// result goal is trivially SAT
g->reset();
g->add(mc.get());
}
}
}
@ -177,8 +175,8 @@ class nlsat_tactic : public tactic {
if (g->unsat_core_enabled()) {
vector<nlsat::assumption, false> assumptions;
m_solver.get_core(assumptions);
for (unsigned i = 0; i < assumptions.size(); ++i) {
expr_dependency* d = static_cast<expr_dependency*>(assumptions[i]);
for (nlsat::assumption a : assumptions) {
expr_dependency* d = static_cast<expr_dependency*>(a);
lcore = m.mk_join(lcore, d);
}
}
@ -232,15 +230,12 @@ public:
algebraic_numbers::manager::collect_param_descrs(r);
}
void operator()(goal_ref const & in,
goal_ref_buffer & result,
model_converter_ref & mc,
proof_converter_ref & pc,
expr_dependency_ref & core) override {
void operator()(goal_ref const & in,
goal_ref_buffer & result) override {
try {
imp local_imp(in->m(), m_params);
scoped_set_imp setter(*this, local_imp);
local_imp(in, result, mc, pc, core);
local_imp(in, result);
}
catch (z3_error & ex) {
throw ex;