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

@ -113,7 +113,7 @@ namespace smt {
m_vals[SCOPE] = static_cast<float>(m_context.get_scope_level());
m_vals[NESTED_QUANTIFIERS] = static_cast<float>(stat->get_num_nested_quantifiers());
m_vals[CS_FACTOR] = static_cast<float>(stat->get_case_split_factor());
TRACE(qi_queue_detail, for (unsigned i = 0; i < m_vals.size(); i++) { tout << m_vals[i] << " "; } tout << "\n";);
TRACE(qi_queue_detail, for (unsigned i = 0; i < m_vals.size(); ++i) { tout << m_vals[i] << " "; } tout << "\n";);
return stat;
}
@ -139,7 +139,7 @@ namespace smt {
TRACE(qi_queue_detail,
tout << "new instance of " << q->get_qid() << ", weight " << q->get_weight()
<< ", generation: " << generation << ", scope_level: " << m_context.get_scope_level() << ", cost: " << cost << "\n";
for (unsigned i = 0; i < f->get_num_args(); i++) {
for (unsigned i = 0; i < f->get_num_args(); ++i) {
tout << "#" << f->get_arg(i)->get_expr_id() << " d:" << f->get_arg(i)->get_expr()->get_depth() << " ";
}
tout << "\n";);
@ -340,7 +340,7 @@ namespace smt {
app * n = to_app(lemma);
bool has_unassigned = false;
expr * true_child = 0;
for (unsigned i = 0; i < n->get_num_args(); i++) {
for (unsigned i = 0; i < n->get_num_args(); ++i) {
expr * arg = n->get_arg(i);
switch(m_context.get_assignment(arg)) {
case l_undef: has_unassigned = true; break;
@ -379,7 +379,7 @@ namespace smt {
scope & s = m_scopes[new_lvl];
unsigned old_sz = s.m_instantiated_trail_lim;
unsigned sz = m_instantiated_trail.size();
for (unsigned i = old_sz; i < sz; i++)
for (unsigned i = old_sz; i < sz; ++i)
m_delayed_entries[m_instantiated_trail[i]].m_instantiated = false;
m_instantiated_trail.shrink(old_sz);
m_delayed_entries.shrink(s.m_delayed_entries_lim);
@ -409,7 +409,7 @@ namespace smt {
bool init = false;
float min_cost = 0.0;
unsigned sz = m_delayed_entries.size();
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
entry & e = m_delayed_entries[i];
TRACE(qi_queue, tout << e.m_qb << ", cost: " << e.m_cost << ", instantiated: " << e.m_instantiated << "\n";);
if (!e.m_instantiated && e.m_cost <= m_params.m_qi_lazy_threshold && (!init || e.m_cost < min_cost)) {
@ -419,7 +419,7 @@ namespace smt {
}
TRACE(qi_queue_min_cost, tout << "min_cost: " << min_cost << ", scope_level: " << m_context.get_scope_level() << "\n";);
bool result = true;
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
entry & e = m_delayed_entries[i];
TRACE(qi_queue, tout << e.m_qb << ", cost: " << e.m_cost << " min-cost: " << min_cost << ", instantiated: " << e.m_instantiated << "\n";);
if (!e.m_instantiated && e.m_cost <= min_cost) {
@ -435,7 +435,7 @@ namespace smt {
}
bool result = true;
for (unsigned i = 0; i < m_delayed_entries.size(); i++) {
for (unsigned i = 0; i < m_delayed_entries.size(); ++i) {
entry & e = m_delayed_entries[i];
TRACE(qi_queue, tout << e.m_qb << ", cost: " << e.m_cost << ", instantiated: " << e.m_instantiated << "\n";);
if (!e.m_instantiated && e.m_cost <= m_params.m_qi_lazy_threshold) {
@ -489,7 +489,7 @@ namespace smt {
min = 0.0f;
max = 0.0f;
bool found = false;
for (unsigned i = 0; i < m_delayed_entries.size(); i++) {
for (unsigned i = 0; i < m_delayed_entries.size(); ++i) {
if (!m_delayed_entries[i].m_instantiated) {
float c = m_delayed_entries[i].m_cost;
if (found) {