3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-07-05 23:06:12 +00:00
z3/src/sat/sat_clause_use_list.cpp
davedets 6ac3075022
Remove unnecessary semicolons (Attempt 2) (#10020)
This is another PR towards the goal of getting Z3 to compile cleanly
when included via FetchContents into clang-tidy, which uses a pretty
strict set of warnings.

This is a second version of https://github.com/Z3Prover/z3/pull/9957. I
address @NikolajBjorner 's comments about not changing the semicolons
after macro invocations, because some editors work better with them
present. It now, to the best of my ability, only deletes semis:

* after the closing brace of namespace decl.
* after the closing brace of an extern "C" decl.
* after a function definition.

This PR is very large, but it consists entirely of deletions of
semicolons in these situations.

(If there was a way to update the previous PR, which had been closed,
and that is preferable, please let me know. I couldn't figure it out.)
2026-07-02 12:47:29 -07:00

57 lines
1.1 KiB
C++

/*++
Copyright (c) 2011 Microsoft Corporation
Module Name:
sat_clause_use_list.cpp
Abstract:
Clause use list
Author:
Leonardo de Moura (leonardo) 2011-05-31.
Revision History:
--*/
#include "sat/sat_clause.h"
#include "sat/sat_clause_use_list.h"
namespace sat {
bool clause_use_list::check_invariant() const {
unsigned sz = 0;
for (clause* c : m_clauses)
if (!c->was_removed())
sz++;
VERIFY(sz == m_size);
unsigned redundant = 0;
for (clause* c : m_clauses)
if (c->is_learned())
redundant++;
VERIFY(redundant == m_num_redundant);
return true;
}
void clause_use_list::iterator::consume() {
while (true) {
if (m_i == m_size)
return;
if (!m_clauses[m_i]->was_removed()) {
m_clauses[m_j] = m_clauses[m_i];
return;
}
m_i++;
}
}
clause_use_list::iterator::~iterator() {
while (m_i < m_size)
next();
m_clauses.shrink(m_j);
}
}