3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-22 02:57:50 +00:00

Use override rather than virtual.

This commit is contained in:
Bruce Mitchener 2018-02-09 21:15:02 +07:00
parent 2b847478a2
commit b7d1753843
138 changed files with 1621 additions and 1624 deletions

View file

@ -70,7 +70,7 @@ public:
m_cfg(m)
{}
virtual ~elim_bounds_rw() {}
~elim_bounds_rw() override {}
};
#endif /* ELIM_BOUNDS2_H_ */

View file

@ -90,14 +90,14 @@ public:
m_replacer(m, m.proofs_enabled(), m_cfg) {
}
virtual ast_manager & m() const { return m_replacer.m(); }
ast_manager & m() const override { return m_replacer.m(); }
virtual void set_substitution(expr_substitution * s) {
void set_substitution(expr_substitution * s) override {
m_replacer.cleanup();
m_replacer.cfg().m_subst = s;
}
virtual void operator()(expr * t, expr_ref & result, proof_ref & result_pr, expr_dependency_ref & result_dep) {
void operator()(expr * t, expr_ref & result, proof_ref & result_pr, expr_dependency_ref & result_dep) override {
result_dep = 0;
m_replacer.operator()(t, result, result_pr);
if (m_cfg.m_used_dependencies != 0) {
@ -108,11 +108,11 @@ public:
}
virtual unsigned get_num_steps() const {
unsigned get_num_steps() const override {
return m_replacer.get_num_steps();
}
virtual void reset() {
void reset() override {
m_replacer.reset();
}
};
@ -131,23 +131,23 @@ public:
m_r(m, p) {
}
virtual ~th_rewriter2expr_replacer() {}
~th_rewriter2expr_replacer() override {}
virtual ast_manager & m() const { return m_r.m(); }
ast_manager & m() const override { return m_r.m(); }
virtual void set_substitution(expr_substitution * s) { m_r.set_substitution(s); }
void set_substitution(expr_substitution * s) override { m_r.set_substitution(s); }
virtual void operator()(expr * t, expr_ref & result, proof_ref & result_pr, expr_dependency_ref & result_dep) {
void operator()(expr * t, expr_ref & result, proof_ref & result_pr, expr_dependency_ref & result_dep) override {
m_r(t, result, result_pr);
result_dep = m_r.get_used_dependencies();
m_r.reset_used_dependencies();
}
virtual unsigned get_num_steps() const {
unsigned get_num_steps() const override {
return m_r.get_num_steps();
}
virtual void reset() {
void reset() override {
m_r.reset();
}

View file

@ -103,8 +103,8 @@ public:
class maximize_bv_sharing : public maximize_ac_sharing {
bv_util m_util;
protected:
virtual void init_core();
virtual bool is_numeral(expr * n) const;
void init_core() override;
bool is_numeral(expr * n) const override;
public:
maximize_bv_sharing(ast_manager & m);
};

View file

@ -96,8 +96,8 @@ public:
class pull_cheap_ite_tree_cfg : public pull_ite_tree_cfg {
public:
pull_cheap_ite_tree_cfg(ast_manager & m):pull_ite_tree_cfg(m) {}
virtual ~pull_cheap_ite_tree_cfg() {}
virtual bool is_target(app * n) const;
~pull_cheap_ite_tree_cfg() override {}
bool is_target(app * n) const override;
};
class pull_cheap_ite_tree_rw : public rewriter_tpl<pull_cheap_ite_tree_cfg> {

View file

@ -45,7 +45,7 @@ struct push_app_ite_cfg : public default_rewriter_cfg {
*/
class ng_push_app_ite_cfg : public push_app_ite_cfg {
protected:
virtual bool is_target(func_decl * decl, unsigned num_args, expr * const * args);
bool is_target(func_decl * decl, unsigned num_args, expr * const * args) override;
public:
ng_push_app_ite_cfg(ast_manager& m, bool conservative = true): push_app_ite_cfg(m, conservative) {}
virtual ~ng_push_app_ite_cfg() {}

View file

@ -150,7 +150,7 @@ class var_shifter : public var_shifter_core {
unsigned m_bound;
unsigned m_shift1;
unsigned m_shift2;
virtual void process_var(var * v);
void process_var(var * v) override;
public:
var_shifter(ast_manager & m):var_shifter_core(m) {}
void operator()(expr * t, unsigned bound, unsigned shift1, unsigned shift2, expr_ref & r);
@ -183,7 +183,7 @@ public:
class inv_var_shifter : public var_shifter_core {
protected:
unsigned m_shift;
virtual void process_var(var * v);
void process_var(var * v) override;
public:
inv_var_shifter(ast_manager & m):var_shifter_core(m) {}
void operator()(expr * t, unsigned shift, expr_ref & r);
@ -339,7 +339,7 @@ public:
Config & cfg() { return m_cfg; }
Config const & cfg() const { return m_cfg; }
~rewriter_tpl();
~rewriter_tpl() override;
void reset();
void cleanup();

View file

@ -85,15 +85,15 @@ public:
sym_expr_boolean_algebra(ast_manager& m, expr_solver& s):
m(m), m_solver(s) {}
virtual T mk_false() {
T mk_false() override {
expr_ref fml(m.mk_false(), m);
return sym_expr::mk_pred(fml, m.mk_bool_sort()); // use of Bool sort for bound variable is arbitrary
}
virtual T mk_true() {
T mk_true() override {
expr_ref fml(m.mk_true(), m);
return sym_expr::mk_pred(fml, m.mk_bool_sort());
}
virtual T mk_and(T x, T y) {
T mk_and(T x, T y) override {
if (x->is_char() && y->is_char()) {
if (x->get_char() == y->get_char()) {
return x;
@ -118,7 +118,7 @@ public:
br.mk_and(fml1, fml2, fml);
return sym_expr::mk_pred(fml, x->get_sort());
}
virtual T mk_or(T x, T y) {
T mk_or(T x, T y) override {
if (x->is_char() && y->is_char() &&
x->get_char() == y->get_char()) {
return x;
@ -135,7 +135,7 @@ public:
return sym_expr::mk_pred(fml, x->get_sort());
}
virtual T mk_and(unsigned sz, T const* ts) {
T mk_and(unsigned sz, T const* ts) override {
switch (sz) {
case 0: return mk_true();
case 1: return ts[0];
@ -148,7 +148,7 @@ public:
}
}
}
virtual T mk_or(unsigned sz, T const* ts) {
T mk_or(unsigned sz, T const* ts) override {
switch (sz) {
case 0: return mk_false();
case 1: return ts[0];
@ -161,7 +161,7 @@ public:
}
}
}
virtual lbool is_sat(T x) {
lbool is_sat(T x) override {
if (x->is_char()) {
return l_true;
}
@ -178,7 +178,7 @@ public:
}
return m_solver.check_sat(fml);
}
virtual T mk_not(T x) {
T mk_not(T x) override {
var_ref v(m.mk_var(0, x->get_sort()), m);
expr_ref fml(m.mk_not(x->accept(v)), m);
return sym_expr::mk_pred(fml, x->get_sort());