3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-20 10:10:21 +00:00

consolidate freeze functionality into dependent_expr_state

rename size() to qtail() and introduce shortcuts
ensure tactic goals are not updated if they are in inconsistent state (because indices could be invalidated)
This commit is contained in:
Nikolaj Bjorner 2022-11-30 08:35:29 +07:00
parent 73a652cf4b
commit bec3acd146
21 changed files with 223 additions and 93 deletions

View file

@ -41,7 +41,7 @@ void propagate_values::reduce() {
auto add_shared = [&]() {
shared_occs_mark visited;
shared.reset();
for (unsigned i = 0; i < m_fmls.size(); ++i)
for (unsigned i = 0; i < qtail(); ++i)
shared(m_fmls[i].fml(), visited);
};
@ -78,7 +78,7 @@ void propagate_values::reduce() {
subst.reset();
m_rewriter.reset();
m_rewriter.set_substitution(&subst);
for (unsigned i = 0; i < m_fmls.qhead(); ++i)
for (unsigned i = 0; i < qhead(); ++i)
add_sub(m_fmls[i]);
};
@ -86,10 +86,10 @@ void propagate_values::reduce() {
for (unsigned r = 0; r < m_max_rounds && rw != m_stats.m_num_rewrites; ++r) {
rw = m_stats.m_num_rewrites;
init_sub();
for (unsigned i = m_fmls.qhead(); i < m_fmls.size() && !m_fmls.inconsistent(); ++i)
for (unsigned i = qhead(); i < qtail() && !m_fmls.inconsistent(); ++i)
process_fml(i);
init_sub();
for (unsigned i = m_fmls.size(); i-- > m_fmls.qhead() && !m_fmls.inconsistent();)
for (unsigned i = qtail(); i-- > qhead() && !m_fmls.inconsistent();)
process_fml(i);
if (subst.empty())
break;