3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-07-05 14:56:11 +00:00

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.)
This commit is contained in:
davedets 2026-07-02 12:47:29 -07:00 committed by GitHub
parent 69444de05b
commit 6ac3075022
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
429 changed files with 477 additions and 476 deletions

View file

@ -97,10 +97,10 @@ namespace dimacs {
bool operator!=(iterator const& other) const { return m_eof != other.m_eof; }
};
iterator begin() { return iterator(*this, false); };
iterator begin() { return iterator(*this, false); }
iterator end() { return iterator(*this, true); }
void set_read_theory(std::function<int(char const*)>& r) { m_read_theory_id = r; }
};
};
}

View file

@ -28,7 +28,7 @@
namespace dd {
class pdd;
class solver;
};
}
namespace sat {

View file

@ -497,4 +497,4 @@ namespace sat {
m_tr = 0;
}
};
}

View file

@ -106,5 +106,5 @@ namespace sat {
inline void dec(unsigned c) { m_counter -= c; }
};
};
}

View file

@ -353,4 +353,4 @@ namespace sat {
m_R.reset();
}
};
}

View file

@ -73,5 +73,5 @@ namespace sat {
void operator()(union_find<>& uf);
};
};
}

View file

@ -281,4 +281,4 @@ namespace sat {
};
}

View file

@ -87,5 +87,5 @@ namespace sat {
void display(std::ostream& out) const;
};
};
}

View file

@ -249,4 +249,4 @@ namespace sat {
return out;
}
};
}

View file

@ -198,5 +198,5 @@ namespace sat {
std::ostream & operator<<(std::ostream & out, clause_wrapper const & c);
};
}

View file

@ -88,4 +88,4 @@ namespace sat {
return true;
}
};
}

View file

@ -50,5 +50,5 @@ namespace sat {
bool check_invariant() const;
};
};
}

View file

@ -54,4 +54,4 @@ namespace sat {
m_clauses.shrink(m_j);
}
};
}

View file

@ -134,5 +134,5 @@ namespace sat {
}
};
};
}

View file

@ -230,4 +230,4 @@ namespace sat {
st.update("sat elim literals", m_elim_literals);
}
};
}

View file

@ -48,5 +48,5 @@ namespace sat {
void dec() { m_cleanup_counter--; }
};
};
}

View file

@ -259,4 +259,4 @@ namespace sat {
sat_params::collect_param_descrs(r);
}
};
}

View file

@ -196,5 +196,5 @@ namespace sat {
static void collect_param_descrs(param_descrs & d);
};
};
}

View file

@ -306,4 +306,4 @@ namespace sat {
}
(*this)(roots, to_elim);
}
};
}

View file

@ -47,5 +47,5 @@ namespace sat {
void operator()(union_find<>& uf);
};
};
}

View file

@ -77,7 +77,7 @@ namespace sat {
solver const& s() const { return *m_solver; }
symbol const& name() const { return m_name; }
virtual void set_lookahead(lookahead* s) {};
virtual void set_lookahead(lookahead* s) {}
class scoped_drating {
extension& ext;
public:
@ -138,5 +138,5 @@ namespace sat {
virtual std::string reason_unknown() { return "unknown"; }
};
};
}

View file

@ -221,4 +221,4 @@ namespace sat {
VERIFY(check_disjoint_clauses());
return true;
}
};
}

View file

@ -42,4 +42,4 @@ namespace sat {
bool check_disjoint_clauses() const;
bool operator()() const;
};
};
}

View file

@ -72,5 +72,5 @@ namespace sat {
return out;
}
};
}

View file

@ -25,7 +25,7 @@ Notes:
namespace pb {
class solver;
};
}
namespace sat {

View file

@ -455,4 +455,4 @@ namespace sat {
}
}
};
}

View file

@ -153,4 +153,4 @@ namespace sat {
return out;
}
};
}

View file

@ -61,5 +61,5 @@ namespace sat {
};
};
};
}

View file

@ -276,5 +276,5 @@ namespace sat {
return copied;
}
};
}

View file

@ -112,5 +112,5 @@ namespace sat {
bool copy_solver(solver& s);
};
};
}

View file

@ -322,4 +322,4 @@ namespace sat {
void probing::reset_statistics() {
m_num_assigned = 0;
}
};
}

View file

@ -91,5 +91,5 @@ namespace sat {
void dec(unsigned c) { m_counter -= c; }
};
};
}

View file

@ -282,4 +282,4 @@ namespace sat {
sat_scc_params::collect_param_descrs(d);
}
};
}

View file

@ -65,5 +65,5 @@ namespace sat {
int get_right(literal l) const { return m_big.get_right(l); }
bool connected(literal u, literal v) const { return m_big.connected(u, v); }
};
};
}

View file

@ -2148,4 +2148,4 @@ namespace sat {
m_num_bca = 0;
m_num_ate = 0;
}
};
}

View file

@ -250,5 +250,5 @@ namespace sat {
bool need_cleanup() const { return m_need_cleanup; }
};
};
}

View file

@ -4865,4 +4865,4 @@ namespace sat {
return true;
}
};
}

View file

@ -48,7 +48,7 @@ Revision History:
namespace pb {
class solver;
};
}
namespace sat {
@ -895,4 +895,4 @@ namespace sat {
std::ostream & operator<<(std::ostream & out, mk_stat const & stat);
};
}

View file

@ -49,7 +49,7 @@ namespace sat {
// optional support for user-scopes. Not relevant for sat_tactic integration.
// it is only relevant for incremental mode SAT, which isn't wrapped (yet)
virtual void user_push() { throw default_exception("optional API not supported"); }
virtual void user_pop(unsigned num_scopes) {};
virtual void user_pop(unsigned num_scopes) {}
virtual unsigned num_user_scopes() const { return 0;}
virtual unsigned num_scopes() const { return 0; }
@ -58,5 +58,5 @@ namespace sat {
virtual extension* get_extension() const { return nullptr; }
virtual void set_extension(extension* e) { if (e) throw default_exception("optional API not supported"); }
};
};
}

View file

@ -106,7 +106,7 @@ namespace sat {
int m_orig;
const proof_hint* m_hint;
public:
status(st s, int o, proof_hint const* ps = nullptr) : m_st(s), m_orig(o), m_hint(ps) {};
status(st s, int o, proof_hint const* ps = nullptr) : m_st(s), m_orig(o), m_hint(ps) {}
status(status const& s) : m_st(s.m_st), m_orig(s.m_orig), m_hint(s.m_hint) {}
status(status&& s) noexcept { m_st = st::asserted; m_orig = -1; std::swap(m_st, s.m_st); std::swap(m_orig, s.m_orig); std::swap(m_hint, s.m_hint); }
status& operator=(status const& other) { m_st = other.m_st; m_orig = other.m_orig; return *this; }
@ -170,7 +170,7 @@ namespace sat {
};
};
}

View file

@ -110,4 +110,4 @@ namespace sat {
return out;
}
};
}

View file

@ -125,5 +125,5 @@ namespace sat {
std::ostream& display_watch_list(std::ostream & out, clause_allocator const & ca, watch_list const & wlist, extension* ext);
void conflict_cleanup(watch_list::iterator it, watch_list::iterator it2, watch_list& wlist);
};
}

View file

@ -142,4 +142,4 @@ namespace arith {
#endif
};
}

View file

@ -49,4 +49,4 @@ namespace arith {
expr_ref get_fixed(expr* e);
#endif
};
};
}

View file

@ -78,4 +78,4 @@ namespace bv {
void propagate();
};
};
}

View file

@ -308,7 +308,7 @@ namespace bv {
tmp = m.mk_or(literal2expr(b), tmp);
xs.push_back(tmp);
}
};
}
/**
* The i'th bit in xs is 1 if the least significant bit of x is i or lower.
@ -324,7 +324,7 @@ namespace bv {
tmp = m.mk_or(literal2expr(b), tmp);
xs.push_back(tmp);
}
};
}
/**
* Check non-overflow of unsigned multiplication.

View file

@ -521,7 +521,7 @@ namespace bv {
}
func_decl* f = m.mk_func_decl(th, sorts.size(), sorts.data(), proof);
return m.mk_app(f, args);
};
}
void solver::asserted(literal l) {
atom* a = get_bv2a(l.var());

View file

@ -87,4 +87,4 @@ namespace euf {
void propagate();
};
};
}

View file

@ -576,7 +576,7 @@ namespace euf {
return p.display(out);
}
};
}
inline std::ostream& operator<<(std::ostream& out, euf::solver const& s) {
return s.display(out);

View file

@ -440,4 +440,4 @@ namespace fpa {
}
}
};
}

View file

@ -330,7 +330,7 @@ namespace intblast {
}
}
return r;
};
}
bool solver::is_bv(sat::literal lit) {
expr* e = ctx.bool_var2expr(lit.var());

View file

@ -100,7 +100,7 @@ namespace pb {
virtual bool validate_unit_propagation(solver_interface const& s, literal alit) const = 0;
virtual bool is_watching(literal l) const { UNREACHABLE(); return false; };
virtual bool is_watching(literal l) const { UNREACHABLE(); return false; }
virtual literal_vector literals() const { UNREACHABLE(); return literal_vector(); }
virtual void swap(unsigned i, unsigned j) noexcept { UNREACHABLE(); }
virtual literal get_lit(unsigned i) const { UNREACHABLE(); return sat::null_literal; }

View file

@ -3795,6 +3795,6 @@ namespace pb {
return true;
}
};
}

View file

@ -418,5 +418,5 @@ namespace pb {
};
};
}

View file

@ -26,7 +26,7 @@ Author:
namespace euf {
class solver;
};
}
namespace q {

View file

@ -169,4 +169,4 @@ namespace user_solver {
euf::th_solver* clone(euf::solver& ctx) override;
};
};
}