3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-23 08:47:37 +00:00

Standardize for-loop increments to prefix form (++i) (#8199)

* Initial plan

* Convert postfix to prefix increment in for loops

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

* Fix member variable increment conversion bug

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

* Update API generator to produce prefix increments

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
Copilot 2026-01-14 19:55:31 -08:00 committed by Nikolaj Bjorner
parent 851b8ea31c
commit 317dd92105
475 changed files with 3237 additions and 3237 deletions

View file

@ -733,7 +733,7 @@ namespace bv {
unsigned num_vars = get_num_vars();
if (num_vars > 0)
out << "bv-solver:\n";
for (unsigned v = 0; v < num_vars; v++)
for (unsigned v = 0; v < num_vars; ++v)
out << pp(v);
return out;
}
@ -896,7 +896,7 @@ namespace bv {
unsigned sz = m_bits[v1].size();
if (sz == 1)
return;
for (unsigned idx = 0; !s().inconsistent() && idx < sz; idx++) {
for (unsigned idx = 0; !s().inconsistent() && idx < sz; ++idx) {
literal bit1 = m_bits[v1][idx];
literal bit2 = m_bits[v2][idx];
CTRACE(bv, bit1 == ~bit2, tout << pp(v1) << pp(v2) << "idx: " << idx << "\n";);
@ -1025,7 +1025,7 @@ namespace bv {
};
scoped_reset _sr(*this, bits1);
DEBUG_CODE(for (unsigned i = 0; i < bv_size; i++) SASSERT(m_merge_aux[0][i] == euf::null_theory_var || m_merge_aux[1][i] == euf::null_theory_var););
DEBUG_CODE(for (unsigned i = 0; i < bv_size; ++i) SASSERT(m_merge_aux[0][i] == euf::null_theory_var || m_merge_aux[1][i] == euf::null_theory_var););
// save info about bits1
for (auto& zo : bits1)
@ -1046,7 +1046,7 @@ namespace bv {
bits1.push_back(zo);
}
// reset m_merge_aux vector
DEBUG_CODE(for (unsigned i = 0; i < bv_size; i++) { SASSERT(m_merge_aux[0][i] == euf::null_theory_var || m_merge_aux[1][i] == euf::null_theory_var); });
DEBUG_CODE(for (unsigned i = 0; i < bv_size; ++i) { SASSERT(m_merge_aux[0][i] == euf::null_theory_var || m_merge_aux[1][i] == euf::null_theory_var); });
return true;
}