3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-03-17 10:33:48 +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

@ -45,7 +45,7 @@ static void tst_sine(std::ostream & out, unsigned N, unsigned k) {
scoped_mpq a(nm);
nm.set(a, 0);
tst_sine_core(out, nm, im, a, 1);
for (unsigned i = 0; i < N; i++) {
for (unsigned i = 0; i < N; ++i) {
nm.set(a, 4 * (rand() % PREC), PREC);
if (rand() % 2 == 0)
nm.neg(a);
@ -71,7 +71,7 @@ static void tst_cosine(std::ostream & out, unsigned N, unsigned k) {
scoped_mpq a(nm);
nm.set(a, 0);
tst_cosine_core(out, nm, im, a, 1);
for (unsigned i = 0; i < N; i++) {
for (unsigned i = 0; i < N; ++i) {
nm.set(a, 4 * (rand() % PREC), PREC);
if (rand() % 2 == 0)
nm.neg(a);
@ -111,7 +111,7 @@ static void tst_float_sine(std::ostream & out, unsigned N, unsigned k) {
// fm.set(a, EBITS, SBITS, MPF_ROUND_TOWARD_POSITIVE, 25336, 100000);
// tst_float_sine_core(out, fm, im, a, k);
// return;
for (unsigned i = 0; i < N; i++) {
for (unsigned i = 0; i < N; ++i) {
unsigned n = 4 * (rand() % PREC);
unsigned d = PREC;
TRACE(sine, tout << "next-val : " << n << "/" << d << "\n";);
@ -140,7 +140,7 @@ static void tst_e(std::ostream & out) {
unsynch_mpq_manager nm;
interval_manager<im_default_config> im(rl, nm);
im_default_config::interval r;
for (unsigned i = 0; i < 64; i++) {
for (unsigned i = 0; i < 64; ++i) {
im.e(i, r);
out << nm.to_string(im.lower(r)) << " <= E\n";
out << "E <= " << nm.to_string(im.upper(r)) << "\n";
@ -156,7 +156,7 @@ static void tst_e_float(std::ostream & out) {
interval_manager<im_float_config<mpf_manager> > im(rl, fm);
scoped_mpq q(qm);
im_float_config<mpf_manager>::interval r;
for (unsigned i = 0; i < 64; i++) {
for (unsigned i = 0; i < 64; ++i) {
im.e(i, r);
out << fm.to_rational_string(im.lower(r)) << " <= E\n";
out << "E <= " << fm.to_rational_string(im.upper(r)) << "\n";