3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-20 15:34:41 +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

@ -103,7 +103,7 @@ app * defined_names::impl::gen_name(expr * e, sort_ref_buffer & var_sorts, buffe
unsigned num_vars = uv.get_max_found_var_idx_plus_1();
ptr_buffer<expr> new_args;
ptr_buffer<sort> domain;
for (unsigned i = 0; i < num_vars; i++) {
for (unsigned i = 0; i < num_vars; ++i) {
sort * s = uv.get(i);
if (s) {
domain.push_back(s);

View file

@ -91,7 +91,7 @@ class skolemizer {
unsigned sz = m_uv.get_max_found_var_idx_plus_1();
ptr_buffer<sort> sorts;
expr_ref_vector args(m);
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
sort * s = m_uv.get(i);
if (s != nullptr) {
sorts.push_back(s);
@ -114,7 +114,7 @@ class skolemizer {
// (VAR 0) is in the first position of substitution.
// (VAR num_decls-1) is in the last position.
//
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
sort * s = m_uv.get(i);
if (s != nullptr)
substitution.push_back(m.mk_var(i, s));
@ -272,7 +272,7 @@ struct nnf::imp {
m_result_pr_stack(m),
m_skolemizer(m) {
updt_params(p);
for (unsigned i = 0; i < 4; i++) {
for (unsigned i = 0; i < 4; ++i) {
if (proofs_enabled())
m_cache_pr[i] = alloc(act_cache, m);
}
@ -283,7 +283,7 @@ struct nnf::imp {
bool proofs_enabled() const { return m.proofs_enabled(); }
~imp() {
for (unsigned i = 0; i < 4; i++) {
for (unsigned i = 0; i < 4; ++i) {
if (proofs_enabled())
dealloc(m_cache_pr[i]);
}
@ -323,7 +323,7 @@ struct nnf::imp {
}
void reset_cache() {
for (unsigned i = 0; i < 4; i++) {
for (unsigned i = 0; i < 4; ++i) {
m_cache[i].reset();
if (proofs_enabled())
m_cache_pr[i]->reset();
@ -783,7 +783,7 @@ struct nnf::imp {
if (is_forall(q) == fr.m_pol) {
// collect non sk_hack patterns
unsigned num_patterns = q->get_num_patterns();
for (unsigned i = 0; i < num_patterns; i++) {
for (unsigned i = 0; i < num_patterns; ++i) {
expr * pat = q->get_pattern(i);
if (!m_skolemizer.is_sk_hack(pat))
new_patterns.push_back(pat);
@ -899,7 +899,7 @@ struct nnf::imp {
unsigned old_sz1 = new_defs.size();
unsigned old_sz2 = new_def_proofs.size();
for (unsigned i = 0; i < m_todo_defs.size(); i++) {
for (unsigned i = 0; i < m_todo_defs.size(); ++i) {
expr_ref dr(m);
proof_ref dpr(m);
process(m_todo_defs.get(i), dr, dpr);

View file

@ -62,7 +62,7 @@ struct pull_quant::imp {
bool found_quantifier = false;
bool forall_children = false;
for (unsigned i = 0; i < num_children; i++) {
for (unsigned i = 0; i < num_children; ++i) {
expr * child = children[i];
if (is_quantifier(child) && !is_lambda(child)) {
@ -99,7 +99,7 @@ struct pull_quant::imp {
unsigned num_decls = var_sorts.size();
unsigned shift_amount = 0;
TRACE(pull_quant, tout << "Result num decls:" << num_decls << "\n";);
for (unsigned i = 0; i < num_children; i++) {
for (unsigned i = 0; i < num_children; ++i) {
expr * child = children[i];
if (!is_quantifier(child)) {
// increment the free variables in child by num_decls because