3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-18 22:54:21 +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

@ -27,7 +27,7 @@ Revision History:
static void display_uninterp_sorts(std::ostream & out, model_core const & md) {
ast_manager & m = md.get_manager();
unsigned sz = md.get_num_uninterpreted_sorts();
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
sort * s = md.get_uninterpreted_sort(i);
out << "(define-sort " << mk_pp(s, m);
for (expr* e : md.get_universe(s)) {
@ -40,7 +40,7 @@ static void display_uninterp_sorts(std::ostream & out, model_core const & md) {
static void display_constants(std::ostream & out, model_core const & md) {
ast_manager & m = md.get_manager();
unsigned sz = md.get_num_constants();
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
func_decl * c = md.get_constant(i);
char const * d = "(define ";
std::string n = c->get_name().str();
@ -52,23 +52,23 @@ static void display_constants(std::ostream & out, model_core const & md) {
static void display_functions(std::ostream & out, model_core const & md) {
ast_manager & m = md.get_manager();
unsigned sz = md.get_num_functions();
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
func_decl * f = md.get_function(i);
out << "(define (" << f->get_name();
unsigned arity = f->get_arity();
func_interp * fi = md.get_func_interp(f);
for (unsigned j = 0; j < arity; j++) {
for (unsigned j = 0; j < arity; ++j) {
out << " " << "x!" << j;
}
out << ")\n";
unsigned num_entries = fi->num_entries();
for (unsigned j = 0; j < num_entries; j++) {
for (unsigned j = 0; j < num_entries; ++j) {
func_entry const * curr = fi->get_entry(j);
out << " (if ";
if (arity > 1)
out << "(and ";
for (unsigned j = 0; j < arity; j++) {
for (unsigned j = 0; j < arity; ++j) {
out << "(= x!" << j << " " << mk_ismt2_pp(curr->get_arg(j), m) << ")";
if (j + 1 < arity)
out << " ";
@ -84,7 +84,7 @@ static void display_functions(std::ostream & out, model_core const & md) {
else {
out << " " << mk_ismt2_pp(fi->get_else(), m, params_ref(), 5, arity, "x");
}
for (unsigned j = 0; j < num_entries; j++)
for (unsigned j = 0; j < num_entries; ++j)
out << ")";
out << ")\n";
}