3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-07-16 12:05:43 +00:00
z3/src/nlsat/nlsat_clause.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

52 lines
1.1 KiB
C++

/*++
Copyright (c) 2012 Microsoft Corporation
Module Name:
nlsat_clause.cpp
Abstract:
Clauses used in the Nonlinear arithmetic satisfiability procedure.
Author:
Leonardo de Moura (leonardo) 2012-01-02.
Revision History:
--*/
#include "nlsat/nlsat_clause.h"
namespace nlsat {
clause::clause(unsigned id, unsigned sz, literal const * lits, bool learned, assumption_set as):
m_id(id),
m_size(sz),
m_capacity(sz),
m_learned(learned),
m_active(false),
m_removed(false),
m_marked(false),
m_var_hash(0),
m_assumptions(as) {
for (unsigned i = 0; i < sz; ++i) {
m_lits[i] = lits[i];
}
}
bool clause::contains(literal l) const {
for (unsigned i = 0; i < m_size; ++i)
if (m_lits[i] == l)
return true;
return false;
}
bool clause::contains(bool_var v) const {
for (unsigned i = 0; i < m_size; ++i)
if (m_lits[i].var() == v)
return true;
return false;
}
}