mirror of
https://github.com/Z3Prover/z3
synced 2025-10-12 02:38:07 +00:00
Parallel solving (#7756)
* very basic setup * ensure solve_eqs is fully disabled when smt.solve_eqs=false, #7743 Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * respect smt configuration parameter in elim_unconstrained simplifier Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * indentation * add bash files for test runs * add option to selectively disable variable solving for only ground expressions Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * remove verbose output Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * fix #7745 axioms for len(substr(...)) escaped due to nested rewriting * ensure atomic constraints are processed by arithmetic solver * #7739 optimization add simplification rule for at(x, offset) = "" Introducing j just postpones some rewrites that prevent useful simplifications. Z3 already uses common sub-expressions. The example highlights some opportunities for simplification, noteworthy at(..) = "". The example is solved in both versions after adding this simplification. * fix unsound len(substr) axiom Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * FreshConst is_sort (#7748) * #7750 add pre-processing simplification * Add parameter validation for selected API functions * updates to ac-plugin fix incrementality bugs by allowing destructive updates during saturation at the cost of redoing saturation after a pop. * enable passive, add check for bloom up-to-date * add top-k fixed-sized min-heap priority queue for top scoring literals * set up worker thread batch manager for multithreaded batch cubes paradigm, need to debug as I am getting segfault still * fix bug in parallel solving batch setup * fix bug * allow for internalize implies * disable pre-processing during cubing * debugging * process cubes as lists of individual lits --------- Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com> Co-authored-by: humnrdble <83878671+humnrdble@users.noreply.github.com>
This commit is contained in:
parent
435ea6ea99
commit
d593bb89f3
6 changed files with 299 additions and 39 deletions
|
@ -696,6 +696,10 @@ namespace smt {
|
|||
mk_or_cnstr(to_app(n));
|
||||
add_or_rel_watches(to_app(n));
|
||||
break;
|
||||
case OP_IMPLIES:
|
||||
mk_implies_cnstr(to_app(n));
|
||||
add_implies_rel_watches(to_app(n));
|
||||
break;
|
||||
case OP_EQ:
|
||||
if (m.is_iff(n))
|
||||
mk_iff_cnstr(to_app(n), false);
|
||||
|
@ -711,8 +715,7 @@ namespace smt {
|
|||
mk_iff_cnstr(to_app(n), true);
|
||||
break;
|
||||
case OP_DISTINCT:
|
||||
case OP_IMPLIES:
|
||||
throw default_exception("formula has not been simplified");
|
||||
throw default_exception(std::string("formula has not been simplified") + " : " + mk_pp(n, m));
|
||||
case OP_OEQ:
|
||||
UNREACHABLE();
|
||||
default:
|
||||
|
@ -1712,6 +1715,14 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
|
||||
void context::add_implies_rel_watches(app* n) {
|
||||
if (relevancy()) {
|
||||
relevancy_eh* eh = m_relevancy_propagator->mk_implies_relevancy_eh(n);
|
||||
add_rel_watch(~get_literal(n->get_arg(0)), eh);
|
||||
add_rel_watch(get_literal(n->get_arg(1)), eh);
|
||||
}
|
||||
}
|
||||
|
||||
void context::add_ite_rel_watches(app * n) {
|
||||
if (relevancy()) {
|
||||
relevancy_eh * eh = m_relevancy_propagator->mk_ite_relevancy_eh(n);
|
||||
|
@ -1758,9 +1769,24 @@ namespace smt {
|
|||
mk_gate_clause(buffer.size(), buffer.data());
|
||||
}
|
||||
|
||||
void context::mk_implies_cnstr(app* n) {
|
||||
literal l = get_literal(n);
|
||||
literal_buffer buffer;
|
||||
buffer.push_back(~l);
|
||||
auto arg1 = n->get_arg(0);
|
||||
literal l_arg1 = get_literal(arg1);
|
||||
mk_gate_clause(l, l_arg1);
|
||||
buffer.push_back(~l_arg1);
|
||||
auto arg2 = n->get_arg(1);
|
||||
literal l_arg2 = get_literal(arg2);
|
||||
mk_gate_clause(l, ~l_arg2);
|
||||
buffer.push_back(l_arg2);
|
||||
mk_gate_clause(buffer.size(), buffer.data());
|
||||
}
|
||||
|
||||
void context::mk_iff_cnstr(app * n, bool sign) {
|
||||
if (n->get_num_args() != 2)
|
||||
throw default_exception("formula has not been simplified");
|
||||
throw default_exception(std::string("formula has not been simplified") + " : " + mk_pp(n, m));
|
||||
literal l = get_literal(n);
|
||||
literal l1 = get_literal(n->get_arg(0));
|
||||
literal l2 = get_literal(n->get_arg(1));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue