3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-07-25 08:22:35 +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

@ -278,5 +278,5 @@ namespace smt {
out << "eq_adapter: #" << n1->get_owner_id() << " #" << n2->get_owner_id() << "\n";
}
}
};
}

View file

@ -86,6 +86,6 @@ namespace smt {
void collect_statistics(::statistics & st) const;
void display_already_processed(std::ostream & out) const;
};
};
}

View file

@ -587,4 +587,4 @@ namespace smt {
}
#endif
};
}

View file

@ -130,6 +130,6 @@ namespace smt {
#endif
};
};
}

View file

@ -165,4 +165,4 @@ namespace smt {
#endif
};
}

View file

@ -76,6 +76,6 @@ namespace smt {
bool slow_contains(void const * data, unsigned data_hash, unsigned num_args, enode * const * args) const;
#endif
};
};
}

View file

@ -69,5 +69,5 @@ namespace smt {
};
mam * mk_mam(context & ctx);
};
}

View file

@ -518,5 +518,5 @@ namespace smt {
#endif
}
};
}

View file

@ -101,6 +101,6 @@ namespace smt {
m_on_binding = on_binding;
}
};
};
}

View file

@ -105,5 +105,5 @@ namespace smt {
};
};
}

View file

@ -53,5 +53,5 @@ namespace smt {
void pop_scope_eh(unsigned num_scopes);
};
};
}

View file

@ -214,4 +214,4 @@ namespace smt {
};
};
}

View file

@ -124,4 +124,4 @@ namespace smt {
return result;
}
};
}

View file

@ -65,6 +65,6 @@ namespace smt {
bool empty() const { return m_table.empty(); }
};
};
}

View file

@ -169,4 +169,4 @@ namespace smt {
return l_undef;
return m_thr->check_lp_feasible(ineqs, lit_core, eq_core);
}
};
}

View file

@ -51,4 +51,4 @@ namespace smt {
lbool check_lp_feasible(vector<std::pair<bool, expr_ref>> &ineqs, literal_vector &lit_core,
enode_pair_vector &eq_core);
};
};
}

View file

@ -99,6 +99,6 @@ namespace smt {
}
typedef std::pair<literal, b_justification> justified_literal;
};
}

View file

@ -131,6 +131,6 @@ namespace smt {
m_atom = false;
}
};
};
}

View file

@ -52,6 +52,6 @@ namespace smt {
};
case_split_queue * mk_case_split_queue(context & ctx, smt_params & p);
};
}

View file

@ -258,5 +258,5 @@ namespace smt {
return true;
}
};
}

View file

@ -216,6 +216,6 @@ namespace smt {
bool check_invariant() const;
};
};
}

View file

@ -182,7 +182,7 @@ namespace smt {
m_bindings(nullptr) {
}
};
}

View file

@ -50,6 +50,6 @@ namespace smt {
bool is_unsat(expr * n, unsigned num_bindings = 0, enode * const * bindings = nullptr);
};
};
}

View file

@ -126,4 +126,4 @@ namespace smt {
return out << mk_pp(disj, m, 3);
}
};
}

View file

@ -279,6 +279,6 @@ namespace smt {
typedef ptr_vector<clause> clause_vector;
typedef obj_hashtable<clause> clause_set;
};
}

View file

@ -291,6 +291,6 @@ namespace smt {
}
}
};
}

View file

@ -94,6 +94,6 @@ namespace smt {
};
std::ostream& operator<<(std::ostream& out, clause_proof::status st);
};
}

View file

@ -1485,5 +1485,5 @@ namespace smt {
return alloc(conflict_resolution, m, ctx, dack_manager, params, assigned_literals, watches);
}
};
}

View file

@ -276,6 +276,6 @@ namespace smt {
);
};
}

View file

@ -4884,7 +4884,7 @@ namespace smt {
m_model->add_rec_funs();
}
};
}
#ifdef Z3DEBUG

View file

@ -1924,4 +1924,4 @@ namespace smt {
std::ostream& operator<<(std::ostream& out, enode_pp const& p);
};
}

View file

@ -420,5 +420,5 @@ namespace smt {
}
}
};
}

View file

@ -786,5 +786,5 @@ namespace smt {
IF_VERBOSE(2, verbose_stream() << str);
}
};
}

View file

@ -145,4 +145,4 @@ namespace smt {
if (m_fparams.m_profile_res_sub)
display_profile_res_sub(out);
}
};
}

View file

@ -374,5 +374,5 @@ namespace smt {
get_enode()->m_func_decl_id = UINT_MAX;
}
};
}

View file

@ -480,6 +480,6 @@ namespace smt {
};
inline mk_pp pp(enode* n, ast_manager& m) { return mk_pp(n->get_expr(), m); }
};
}

View file

@ -78,6 +78,6 @@ namespace smt {
};
const eq_justification null_eq_justification(static_cast<justification*>(nullptr));
};
}

View file

@ -35,5 +35,5 @@ namespace smt {
QUANTIFIERS //!< Logical context contains universal quantifiers.
};
};
}

View file

@ -295,4 +295,4 @@ namespace smt {
m_manager.is_label(n, pos, m_buffer); // copy symbols to buffer
}
};
}

View file

@ -35,7 +35,7 @@ namespace smt {
unsigned count_at_labels_lit(expr* n, bool polarity);
public:
check_at_labels(ast_manager& m) : m_manager(m) {};
check_at_labels(ast_manager& m) : m_manager(m) {}
/**
\brief Check that 'n' as a formula contains at most one @ label within each and-or path.
@ -105,6 +105,6 @@ namespace smt {
void operator()(expr * n) override;
};
};
}

View file

@ -36,6 +36,6 @@ namespace smt {
unsigned* class_ids);
};
}

View file

@ -1867,4 +1867,4 @@ namespace smt {
}
SASSERT(th->is_attached_to_var(n));
}
};
}

View file

@ -440,5 +440,5 @@ namespace smt {
return m.mk_th_lemma(m_th_id, m.mk_or(lits), 0, nullptr, m_params.size(), m_params.data());
}
};
}

View file

@ -423,6 +423,6 @@ namespace smt {
char const * get_name() const override { return "theory-lemma"; }
};
};
}

View file

@ -352,4 +352,4 @@ namespace smt {
m_imp->m_kernel.user_propagate_initialize_value(var, value);
}
};
}

View file

@ -346,4 +346,4 @@ namespace smt {
context & get_context();
context const& get_context() const;
};
};
}

View file

@ -116,5 +116,5 @@ namespace smt {
}
};
}

View file

@ -54,6 +54,6 @@ namespace smt {
bool backward_subsumption(unsigned num_lits1, literal const * lits1, unsigned num_lits2, literal const * lits2);
};
}

View file

@ -582,4 +582,4 @@ namespace smt {
}
}
};
}

View file

@ -104,5 +104,5 @@ namespace smt {
void operator()(expr* e);
};
};
}

View file

@ -64,7 +64,7 @@ namespace smt {
class hint_solver;
class non_auf_macro_solver;
class instantiation_set;
};
}
class model_finder : public quantifier2macro_infos {
typedef mf::quantifier_analyzer quantifier_analyzer;
@ -123,5 +123,5 @@ namespace smt {
quantifier_macro_info* operator()(quantifier* q) override;
};
};
}

View file

@ -533,4 +533,4 @@ namespace smt {
return m_model.get();
}
};
}

View file

@ -240,7 +240,7 @@ namespace smt {
}
}
};
};
}

View file

@ -962,4 +962,4 @@ namespace smt {
return alloc(default_qm_plugin);
}
};
}

View file

@ -187,4 +187,4 @@ namespace smt {
vector<std::tuple<enode*, enode*>>& used_enodes) { return false; }
};
};
}

View file

@ -404,5 +404,5 @@ namespace smt {
return new_expr;
}
};
}

View file

@ -98,6 +98,6 @@ namespace smt {
bool instantiate_not_sat(quantifier * q);
bool instantiate_not_sat(quantifier * q, unsigned num_candidates, expr * const * candidates);
};
};
}

View file

@ -720,6 +720,6 @@ namespace smt {
}
relevancy_propagator * mk_relevancy_propagator(context & ctx) { return alloc(relevancy_propagator_imp, ctx); }
};
}

View file

@ -196,6 +196,6 @@ namespace smt {
relevancy_propagator * mk_relevancy_propagator(context & ctx);
};
}

View file

@ -941,6 +941,6 @@ namespace smt {
setup_unknown();
}
};
}

View file

@ -124,6 +124,6 @@ namespace smt {
symbol const & get_logic() const { return m_logic; }
void operator()(config_mode cm);
};
};
}

View file

@ -25,5 +25,5 @@ namespace smt {
memset(this, 0, sizeof(statistics));
}
};
}

View file

@ -52,7 +52,7 @@ namespace smt {
void reset();
};
};
}

View file

@ -261,5 +261,5 @@ namespace smt {
return get_th_var(ctx.get_enode(e));
}
};
}

View file

@ -655,6 +655,6 @@ namespace smt {
virtual bool is_fixed_propagated(theory_var v, expr_ref& val, literal_vector & explain) { return false; }
};
};
}

View file

@ -72,6 +72,6 @@ namespace smt {
// if defined, then clauses have an extra mask field used to optimize backward subsumption, and backward/forward subsumption resolution.
#define APPROX_LIT_SET
};
}

View file

@ -30,6 +30,6 @@ namespace smt {
bool is_value_sort(ast_manager& m, expr* e);
};
}

View file

@ -27,4 +27,4 @@ namespace smt {
// template class theory_arith<smi_ext>;
template class smt::theory_arith<inf_ext>;
};
}

View file

@ -1277,6 +1277,6 @@ namespace smt {
// typedef theory_arith<smi_ext> theory_smi_arith;
};
}

View file

@ -147,7 +147,7 @@ namespace smt {
result_map[it->m_var] = -1;
}
}
};
}
#ifdef Z3DEBUG
/**
@ -2295,6 +2295,6 @@ namespace smt {
}
#endif
};
}

View file

@ -3570,5 +3570,5 @@ namespace smt {
}
};
}

View file

@ -346,6 +346,6 @@ namespace smt {
tout << enode_pp(_x, ctx) << " = " << enode_pp(_y, ctx) << "\n";);
ctx.assign_eq(_x, _y, eq_justification(js));
}
};
}

View file

@ -1110,6 +1110,6 @@ namespace smt {
return m_liberal_final_check || !m_changed_assignment ? FC_DONE : FC_CONTINUE;
}
};
}

View file

@ -229,6 +229,6 @@ namespace smt {
#endif
};
}

View file

@ -2410,7 +2410,7 @@ final_check_status theory_arith<Ext>::process_non_linear() {
}
};
}

View file

@ -528,6 +528,6 @@ namespace smt {
id++;
}
};
}

View file

@ -505,4 +505,4 @@ namespace smt {
st.update("array splits", m_stats.m_num_eq_splits);
}
};
}

View file

@ -114,5 +114,5 @@ namespace smt {
ptr_vector<enode> const& parent_selects(enode* n) { return m_var_data[find(n->get_root()->get_th_var(get_id()))]->m_parent_selects; }
};
};
}

View file

@ -1053,4 +1053,4 @@ namespace smt {
return result;
}
};
}

View file

@ -213,5 +213,5 @@ namespace smt {
~theory_array_base() override { restore_sorts(0); }
};
};
}

View file

@ -118,5 +118,5 @@ namespace smt {
void propagate() override;
};
};
}

View file

@ -2071,4 +2071,4 @@ namespace smt {
#endif
};
}

View file

@ -296,4 +296,4 @@ namespace smt {
bool check_invariant();
bool check_zero_one_bits(theory_var v);
};
};
}

View file

@ -1414,4 +1414,4 @@ namespace smt {
}
};
}

View file

@ -215,6 +215,6 @@ namespace smt {
bool include_func_interp(func_decl* f) override;
};
};
}

View file

@ -23,4 +23,4 @@ namespace smt {
template class theory_dense_diff_logic<i_ext>;
template class theory_dense_diff_logic<smi_ext>;
template class theory_dense_diff_logic<si_ext>;
};
}

View file

@ -292,6 +292,6 @@ namespace smt {
typedef theory_dense_diff_logic<i_ext> theory_dense_i;
typedef theory_dense_diff_logic<smi_ext> theory_dense_smi;
typedef theory_dense_diff_logic<si_ext> theory_dense_si;
};
}

View file

@ -1123,6 +1123,6 @@ namespace smt {
return f;
}
};
}

View file

@ -31,9 +31,9 @@ template class theory_diff_logic<rdl_ext>;
template class theory_diff_logic<srdl_ext>;
};
}
namespace simplex {
template class simplex<mpq_ext>;
template class sparse_matrix<mpq_ext>;
};
}

View file

@ -407,7 +407,7 @@ namespace smt {
typedef theory_diff_logic<sidl_ext> theory_fidl;
typedef theory_diff_logic<rdl_ext> theory_rdl;
typedef theory_diff_logic<srdl_ext> theory_frdl;
};
}

View file

@ -291,4 +291,4 @@ namespace smt {
theory* mk_theory_dl(context& ctx) { return alloc(theory_dl, ctx); }
};
}

View file

@ -23,6 +23,6 @@ namespace smt {
theory* mk_theory_dl(context& ctx);
};
}

View file

@ -70,4 +70,4 @@ namespace smt {
return m_name;
}
};
}

View file

@ -51,6 +51,6 @@ namespace smt {
char const * get_name() const override;
};
};
}

View file

@ -721,4 +721,4 @@ namespace smt {
out << r->get_id() << " --> " << enode_pp(n, ctx) << "\n";
}
}
};
}

View file

@ -126,5 +126,5 @@ namespace smt {
app* get_ite_value(expr* e);
};
};
}

View file

@ -74,4 +74,4 @@ namespace smt {
return a.is_numeral(term);
}
};
}

View file

@ -424,4 +424,4 @@ namespace smt {
void propagate() override;
static literal assert_ge(context& ctx, unsigned k, unsigned n, literal const* xs);
};
};
}

View file

@ -100,6 +100,6 @@ namespace smt {
void init_model(model_generator & mg) override { }
};
};
}

View file

@ -642,6 +642,6 @@ namespace smt {
expr* expr2rep(expr* e) override;
bool get_length(expr* e, rational& r) override;
};
};
}

Some files were not shown because too many files have changed in this diff Show more