3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-24 12:07:52 +00:00

add clausal lookahead to arithmetic solver as part of portfolio

have legacy qfbv-sls solver use nnf pre-processing. It relies on it for correctness of the score updates.
This commit is contained in:
Nikolaj Bjorner 2025-01-20 16:16:46 -08:00
parent a941f5ae84
commit 22e4054674
13 changed files with 678 additions and 92 deletions

View file

@ -112,6 +112,18 @@ namespace sls {
if (p)
p->on_restart();
}
bool context::is_external(sat::bool_var v) {
auto a = atom(v);
if (!a)
return false;
family_id fid = get_fid(a);
if (fid == basic_family_id)
return false;
auto p = m_plugins.get(fid, nullptr);
CTRACE("sls_verbose", p != nullptr, tout << "external " << mk_bounded_pp(a, m) << "\n");
return p != nullptr;
}
lbool context::check() {
//
@ -438,6 +450,7 @@ namespace sls {
sat::literal context::mk_literal(expr* e) {
expr_ref _e(e, m);
SASSERT(!m_input_assertions.contains(e));
sat::literal lit;
bool neg = false;
expr* a, * b, * c;
@ -528,8 +541,11 @@ namespace sls {
for (unsigned i = 0; i < m_atoms.size(); ++i)
if (m_atoms.get(i))
register_terms(m_atoms.get(i));
for (auto e : m_input_assertions)
register_terms(e);
{
flet<bool> _is_input_assertion(m_is_input_assertion, true);
for (auto e : m_input_assertions)
register_terms(e);
}
for (auto p : m_plugins)
if (p)
p->initialize();
@ -564,7 +580,7 @@ namespace sls {
m_parents.reserve(arg->get_id() + 1);
m_parents[arg->get_id()].push_back(e);
}
if (m.is_bool(e))
if (m.is_bool(e) && !m_is_input_assertion)
mk_literal(e);
visit(e);
}
@ -629,7 +645,6 @@ namespace sls {
m_visited.reset();
m_root_literals.reset();
for (auto const& clause : s.clauses()) {
bool has_relevant = false;
unsigned n = 0;