mirror of
https://github.com/Z3Prover/z3
synced 2025-04-13 12:28:44 +00:00
import improvements to lookahead
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
6d893e0599
commit
72b220e84a
|
@ -321,9 +321,9 @@ namespace sat {
|
|||
double sum = 0;
|
||||
unsigned skip_candidates = 0;
|
||||
bool autarky = get_config().m_lookahead_global_autarky;
|
||||
for (bool_var x : m_freevars) {
|
||||
SASSERT(is_undef(x));
|
||||
if (!m_select_lookahead_vars.empty()) {
|
||||
if (!m_select_lookahead_vars.empty()) {
|
||||
for (bool_var x : m_freevars) {
|
||||
SASSERT(is_undef(x));
|
||||
if (m_select_lookahead_vars.contains(x)) {
|
||||
if (!autarky || newbies || in_reduced_clause(x)) {
|
||||
m_candidates.push_back(candidate(x, m_rating[x]));
|
||||
|
@ -334,10 +334,15 @@ namespace sat {
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (newbies || active_prefix(x)) {
|
||||
m_candidates.push_back(candidate(x, m_rating[x]));
|
||||
sum += m_rating[x];
|
||||
}
|
||||
}
|
||||
if (m_candidates.empty() && (m_select_lookahead_vars.empty() || newbies)) {
|
||||
for (bool_var x : m_freevars) {
|
||||
SASSERT(is_undef(x));
|
||||
if (newbies || active_prefix(x)) {
|
||||
m_candidates.push_back(candidate(x, m_rating[x]));
|
||||
sum += m_rating[x];
|
||||
}
|
||||
}
|
||||
}
|
||||
TRACE("sat", display_candidates(tout << "sum: " << sum << "\n"););
|
||||
if (skip_candidates > 0) {
|
||||
|
@ -2285,7 +2290,7 @@ namespace sat {
|
|||
for (unsigned i = 0; i < m_trail.size() && !m_s.inconsistent(); ++i) {
|
||||
literal lit = m_trail[i];
|
||||
if (m_s.value(lit) == l_undef && !m_s.was_eliminated(lit.var())) {
|
||||
m_s.assign(lit, justification());
|
||||
m_s.assign_scoped(lit);
|
||||
++num_units;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -264,7 +264,7 @@ namespace sat {
|
|||
}
|
||||
|
||||
void model_converter::insert(entry & e, literal_vector const& c) {
|
||||
SASSERT(c.contains(literal(e.var(), false)) || c.contains(literal(e.var(), true)));
|
||||
SASSERT(e.var() == null_bool_var || c.contains(literal(e.var(), false)) || c.contains(literal(e.var(), true)));
|
||||
SASSERT(m_entries.begin() <= &e);
|
||||
SASSERT(&e < m_entries.end());
|
||||
for (literal l : c) e.m_clauses.push_back(l);
|
||||
|
|
Loading…
Reference in a new issue