mirror of
https://github.com/Z3Prover/z3
synced 2026-05-20 08:59:34 +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
1bf463d77a
commit
2436943794
475 changed files with 3237 additions and 3237 deletions
|
|
@ -42,7 +42,7 @@ namespace sat {
|
|||
|
||||
var_approx_set clause::approx(unsigned num, literal const * lits) {
|
||||
var_approx_set r;
|
||||
for (unsigned i = 0; i < num; i++)
|
||||
for (unsigned i = 0; i < num; ++i)
|
||||
r.insert(lits[i].var());
|
||||
return r;
|
||||
}
|
||||
|
|
@ -75,12 +75,12 @@ namespace sat {
|
|||
|
||||
void clause::elim(literal l) {
|
||||
unsigned i;
|
||||
for (i = 0; i < m_size; i++)
|
||||
for (i = 0; i < m_size; ++i)
|
||||
if (m_lits[i] == l)
|
||||
break;
|
||||
SASSERT(i < m_size);
|
||||
i++;
|
||||
for (; i < m_size; i++)
|
||||
for (; i < m_size; ++i)
|
||||
m_lits[i-1] = m_lits[i];
|
||||
m_lits[m_size-1] = l;
|
||||
m_size--;
|
||||
|
|
@ -151,7 +151,7 @@ namespace sat {
|
|||
memcpy(m_clause->m_lits, lits, sizeof(literal) * num_lits);
|
||||
}
|
||||
SASSERT(m_clause->m_size <= m_clause->m_capacity);
|
||||
for (unsigned i = 0; i < num_lits; i++) {
|
||||
for (unsigned i = 0; i < num_lits; ++i) {
|
||||
SASSERT((*m_clause)[i] == lits[i]);
|
||||
}
|
||||
}
|
||||
|
|
@ -205,7 +205,7 @@ namespace sat {
|
|||
|
||||
std::ostream & operator<<(std::ostream & out, clause const & c) {
|
||||
out << "(";
|
||||
for (unsigned i = 0; i < c.size(); i++) {
|
||||
for (unsigned i = 0; i < c.size(); ++i) {
|
||||
if (i > 0) out << " ";
|
||||
out << c[i];
|
||||
}
|
||||
|
|
@ -225,7 +225,7 @@ namespace sat {
|
|||
|
||||
bool clause_wrapper::contains(literal l) const {
|
||||
unsigned sz = size();
|
||||
for (unsigned i = 0; i < sz; i++)
|
||||
for (unsigned i = 0; i < sz; ++i)
|
||||
if (operator[](i) == l)
|
||||
return true;
|
||||
return false;
|
||||
|
|
@ -233,7 +233,7 @@ namespace sat {
|
|||
|
||||
bool clause_wrapper::contains(bool_var v) const {
|
||||
unsigned sz = size();
|
||||
for (unsigned i = 0; i < sz; i++)
|
||||
for (unsigned i = 0; i < sz; ++i)
|
||||
if (operator[](i).var() == v)
|
||||
return true;
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue