3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-11 11:24:31 +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 GitHub
parent 1bf463d77a
commit 2436943794
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
475 changed files with 3237 additions and 3237 deletions

View file

@ -88,7 +88,7 @@ namespace nlsat {
m_max_degree[x] = k;
if (m_vos_type == FEATURE){
for (unsigned kl = 0; kl <= k; kl++) {
for (unsigned kl = 0; kl <= k; ++kl) {
scoped_numeral curr(pm.m());
if (pm.const_coeff(p, x, kl, curr)) {
pm.m().abs(curr);
@ -115,7 +115,7 @@ namespace nlsat {
return;
if (a->is_ineq_atom()) {
unsigned sz = to_ineq_atom(a)->size();
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
collect(to_ineq_atom(a)->p(i));
}
}
@ -126,13 +126,13 @@ namespace nlsat {
void collect(clause const & c) {
unsigned sz = c.size();
for (unsigned i = 0; i < sz; i++)
for (unsigned i = 0; i < sz; ++i)
collect(c[i]);
}
void collect(clause_vector const & cs) {
unsigned sz = cs.size();
for (unsigned i = 0; i < sz; i++)
for (unsigned i = 0; i < sz; ++i)
collect(*(cs[i]));
}
@ -216,7 +216,7 @@ namespace nlsat {
bool check_invariant() const {return true;} // what is the invariant
void operator()(var_vector &perm) {
var_vector new_order;
for (var x = 0; x < num_vars; x++) {
for (var x = 0; x < num_vars; ++x) {
new_order.push_back(x);
}
if (m_vos_type == BROWN) {
@ -241,12 +241,12 @@ namespace nlsat {
}
TRACE(reorder,
tout << "new order: ";
for (unsigned i = 0; i < num_vars; i++)
for (unsigned i = 0; i < num_vars; ++i)
tout << new_order[i] << " ";
tout << "\n";
);
perm.resize(num_vars, 0);
for (var x = 0; x < num_vars; x++) {
for (var x = 0; x < num_vars; ++x) {
perm[new_order[x]] = x;
}
@ -254,7 +254,7 @@ namespace nlsat {
}
// std::ostream& display(std::ostream & out, display_var_proc const & proc) {
// unsigned sz = m_num_occs.size();
// for (unsigned i = 0; i < sz; i++) {
// for (unsigned i = 0; i < sz; ++i) {
// proc(out, i); out << " -> " << m_max_degree[i] << " : " << m_num_occs[i] << "\n";
// }
// return out;