mirror of
https://github.com/Z3Prover/z3
synced 2025-08-20 18:20:22 +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
|
@ -62,6 +62,13 @@ namespace smt {
|
|||
void operator()(relevancy_propagator & rp) override;
|
||||
};
|
||||
|
||||
class implies_relevancy_eh : public relevancy_eh {
|
||||
app* m_parent;
|
||||
public:
|
||||
implies_relevancy_eh(app* p) :m_parent(p) {}
|
||||
void operator()(relevancy_propagator& rp) override;
|
||||
};
|
||||
|
||||
class ite_relevancy_eh : public relevancy_eh {
|
||||
app * m_parent;
|
||||
public:
|
||||
|
@ -108,6 +115,11 @@ namespace smt {
|
|||
return mk_relevancy_eh(or_relevancy_eh(n));
|
||||
}
|
||||
|
||||
relevancy_eh* relevancy_propagator::mk_implies_relevancy_eh(app* n) {
|
||||
SASSERT(get_manager().is_implies(n));
|
||||
return mk_relevancy_eh(implies_relevancy_eh(n));
|
||||
}
|
||||
|
||||
relevancy_eh * relevancy_propagator::mk_and_relevancy_eh(app * n) {
|
||||
SASSERT(get_manager().is_and(n));
|
||||
return mk_relevancy_eh(and_relevancy_eh(n));
|
||||
|
@ -357,8 +369,38 @@ namespace smt {
|
|||
--j;
|
||||
mark_as_relevant(n->get_arg(j));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void propagate_relevant_implies(app* n) {
|
||||
SASSERT(get_manager().is_implies(n));
|
||||
lbool val = m_context.find_assignment(n);
|
||||
// If val is l_undef, then the expression
|
||||
// is a root, and no boolean variable was created for it.
|
||||
if (val == l_undef)
|
||||
val = l_true;
|
||||
switch (val) {
|
||||
case l_false:
|
||||
propagate_relevant_app(n);
|
||||
break;
|
||||
case l_undef:
|
||||
break;
|
||||
case l_true: {
|
||||
expr* true_arg = nullptr;
|
||||
auto arg0 = n->get_arg(0);
|
||||
auto arg1 = n->get_arg(1);
|
||||
if (m_context.find_assignment(arg0) == l_false) {
|
||||
if (!is_relevant_core(arg0))
|
||||
mark_as_relevant(arg0);
|
||||
return;
|
||||
}
|
||||
if (m_context.find_assignment(arg1) == l_true) {
|
||||
if (!is_relevant_core(arg1))
|
||||
mark_as_relevant(arg1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
\brief Propagate relevancy for an or-application.
|
||||
*/
|
||||
|
@ -470,6 +512,9 @@ namespace smt {
|
|||
case OP_AND:
|
||||
propagate_relevant_and(to_app(n));
|
||||
break;
|
||||
case OP_IMPLIES:
|
||||
propagate_relevant_implies(to_app(n));
|
||||
break;
|
||||
case OP_ITE:
|
||||
propagate_relevant_ite(to_app(n));
|
||||
break;
|
||||
|
@ -505,6 +550,8 @@ namespace smt {
|
|||
propagate_relevant_or(to_app(n));
|
||||
else if (m.is_and(n))
|
||||
propagate_relevant_and(to_app(n));
|
||||
else if (m.is_implies(n))
|
||||
propagate_relevant_implies(to_app(n));
|
||||
}
|
||||
relevancy_ehs * ehs = get_watches(n, val);
|
||||
while (ehs != nullptr) {
|
||||
|
@ -644,6 +691,11 @@ namespace smt {
|
|||
static_cast<relevancy_propagator_imp&>(rp).propagate_relevant_or(m_parent);
|
||||
}
|
||||
|
||||
void implies_relevancy_eh::operator()(relevancy_propagator& rp) {
|
||||
if (rp.is_relevant(m_parent))
|
||||
static_cast<relevancy_propagator_imp&>(rp).propagate_relevant_implies(m_parent);
|
||||
}
|
||||
|
||||
void ite_relevancy_eh::operator()(relevancy_propagator & rp) {
|
||||
if (rp.is_relevant(m_parent)) {
|
||||
static_cast<relevancy_propagator_imp&>(rp).propagate_relevant_ite(m_parent);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue