3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-23 08:47:37 +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 Nikolaj Bjorner
parent 851b8ea31c
commit 317dd92105
475 changed files with 3237 additions and 3237 deletions

View file

@ -57,7 +57,7 @@ namespace sat {
bool integrity_checker::check_clause(clause const & c) const {
CTRACE(sat_bug, c.was_removed(), s.display(tout << "c: " << c.id() << ": " << c << "\n"));
SASSERT(!c.was_removed());
for (unsigned i = 0; i < c.size(); i++) {
for (unsigned i = 0; i < c.size(); ++i) {
VERIFY(c[i].var() <= s.num_vars());
CTRACE(sat_bug, s.was_eliminated(c[i].var()),
tout << "l: " << c[i].var() << "\n";
@ -74,7 +74,7 @@ namespace sat {
{
if (s.value(c[0]) == l_false || s.value(c[1]) == l_false) {
bool on_prop_stack = false;
for (unsigned i = s.m_qhead; i < s.m_trail.size(); i++) {
for (unsigned i = s.m_qhead; i < s.m_trail.size(); ++i) {
if (s.m_trail[i].var() == c[0].var() ||
s.m_trail[i].var() == c[1].var()) {
on_prop_stack = true;
@ -83,10 +83,10 @@ namespace sat {
}
// the clause has been satisfied or all other literals are assigned to false.
if (!on_prop_stack && s.status(c) != l_true) {
for (unsigned i = 2; i < c.size(); i++) {
for (unsigned i = 2; i < c.size(); ++i) {
CTRACE(sat_bug, s.value(c[i]) != l_false,
tout << c << " status: " << s.status(c) << "\n";
for (unsigned i = 0; i < c.size(); i++) tout << "val(" << i << "): " << s.value(c[i]) << "\n";);
for (unsigned i = 0; i < c.size(); ++i) tout << "val(" << i << "): " << s.value(c[i]) << "\n";);
VERIFY(s.value(c[i]) == l_false);
}
}
@ -133,7 +133,7 @@ namespace sat {
VERIFY(s.m_phase.size() == s.num_vars());
VERIFY(s.m_prev_phase.size() == s.num_vars());
VERIFY(s.m_assigned_since_gc.size() == s.num_vars());
for (bool_var v = 0; v < s.num_vars(); v++) {
for (bool_var v = 0; v < s.num_vars(); ++v) {
if (s.was_eliminated(v)) {
VERIFY(s.get_wlist(literal(v, false)).empty());
VERIFY(s.get_wlist(literal(v, true)).empty());