3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-07-06 15:26:15 +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

@ -100,7 +100,7 @@ struct goal2nlsat::imp {
m_pm.factor(p, fs, m_fparams);
TRACE(goal2nlsat_bug, tout << "factors:\n" << fs << "\n";);
SASSERT(fs.distinct_factors() > 0);
for (unsigned i = 0; i < fs.distinct_factors(); i++) {
for (unsigned i = 0; i < fs.distinct_factors(); ++i) {
ps.push_back(fs[i]);
is_even.push_back(fs.get_degree(i) % 2 == 0);
}
@ -245,7 +245,7 @@ struct goal2nlsat::imp {
lits = &f;
}
sbuffer<nlsat::literal> ls;
for (unsigned i = 0; i < num_lits; i++) {
for (unsigned i = 0; i < num_lits; ++i) {
ls.push_back(process_literal(lits[i]));
}
m_solver.mk_clause(ls.size(), ls.data(), dep);
@ -256,7 +256,7 @@ struct goal2nlsat::imp {
if (has_term_ite(g))
throw tactic_exception("eliminate term-ite before applying nlsat");
unsigned sz = g.size();
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
process(g.form(i), g.dep(i));
}
}

View file

@ -60,13 +60,13 @@ class nlsat_tactic : public tactic {
}
bool contains_unsupported(expr_ref_vector & b2a, expr_ref_vector & x2t) {
for (unsigned x = 0; x < x2t.size(); x++) {
for (unsigned x = 0; x < x2t.size(); ++x) {
if (!is_uninterp_const(x2t.get(x))) {
TRACE(unsupported, tout << "unsupported atom:\n" << mk_ismt2_pp(x2t.get(x), m) << "\n";);
return true;
}
}
for (unsigned b = 0; b < b2a.size(); b++) {
for (unsigned b = 0; b < b2a.size(); ++b) {
expr * a = b2a.get(b);
if (a == nullptr)
continue;
@ -82,7 +82,7 @@ class nlsat_tactic : public tactic {
bool eval_model(model& model, goal& g) {
unsigned sz = g.size();
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
if (model.is_false(g.form(i))) {
TRACE(nlsat, tout << mk_pp(g.form(i), m) << " -> " << model(g.form(i)) << "\n";);
IF_VERBOSE(0, verbose_stream() << mk_pp(g.form(i), m) << " -> " << model(g.form(i)) << "\n";);
@ -99,7 +99,7 @@ class nlsat_tactic : public tactic {
bool ok = true;
model_ref md = alloc(model, m);
arith_util util(m);
for (unsigned x = 0; x < x2t.size(); x++) {
for (unsigned x = 0; x < x2t.size(); ++x) {
expr * t = x2t.get(x);
if (!is_uninterp_const(t))
continue;
@ -116,7 +116,7 @@ class nlsat_tactic : public tactic {
}
md->register_decl(to_app(t)->get_decl(), v);
}
for (unsigned b = 0; b < b2a.size(); b++) {
for (unsigned b = 0; b < b2a.size(); ++b) {
expr * a = b2a.get(b);
if (a == nullptr || !is_uninterp_const(a))
continue;