mirror of
https://github.com/Z3Prover/z3
synced 2026-02-19 23:14:40 +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:
parent
851b8ea31c
commit
317dd92105
475 changed files with 3237 additions and 3237 deletions
|
|
@ -25,7 +25,7 @@ permutation::permutation(unsigned size) {
|
|||
void permutation::reset(unsigned size) {
|
||||
m_p.reset();
|
||||
m_inv_p.reset();
|
||||
for (unsigned i = 0; i < size; i++) {
|
||||
for (unsigned i = 0; i < size; ++i) {
|
||||
m_p.push_back(i);
|
||||
m_inv_p.push_back(i);
|
||||
}
|
||||
|
|
@ -46,7 +46,7 @@ void permutation::move_after(unsigned i, unsigned j) {
|
|||
if (i >= j)
|
||||
return;
|
||||
unsigned i_prime = m_p[i];
|
||||
for (unsigned k = i; k < j; k++) {
|
||||
for (unsigned k = i; k < j; ++k) {
|
||||
m_p[k] = m_p[k+1];
|
||||
m_inv_p[m_p[k]] = k;
|
||||
}
|
||||
|
|
@ -57,7 +57,7 @@ void permutation::move_after(unsigned i, unsigned j) {
|
|||
|
||||
void permutation::display(std::ostream & out) const {
|
||||
unsigned n = m_p.size();
|
||||
for (unsigned i = 0; i < n; i++) {
|
||||
for (unsigned i = 0; i < n; ++i) {
|
||||
if (i > 0)
|
||||
out << " ";
|
||||
out << i << ":" << m_p[i];
|
||||
|
|
@ -68,7 +68,7 @@ bool permutation::check_invariant() const {
|
|||
SASSERT(m_p.size() == m_inv_p.size());
|
||||
unsigned n = m_p.size();
|
||||
bool_vector check_vector(n, false); // To check for duplicate and out-of-range values
|
||||
for (unsigned i = 0; i < n; i++) {
|
||||
for (unsigned i = 0; i < n; ++i) {
|
||||
unsigned pi = m_p[i];
|
||||
SASSERT(m_p[i] < n);
|
||||
SASSERT(m_inv_p[i] < n);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue