3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-02 13:27:01 +00:00

Use override rather than virtual.

This commit is contained in:
Bruce Mitchener 2018-02-10 09:15:12 +07:00
parent ce123d9dbc
commit 7167fda1dc
220 changed files with 2546 additions and 2548 deletions

View file

@ -494,7 +494,7 @@ public:
{
}
virtual bool parse_file(char const * filename) {
bool parse_file(char const * filename) override {
reset();
if (filename != 0) {
set_path(filename);
@ -510,7 +510,7 @@ public:
}
}
virtual bool parse_string(char const * string) {
bool parse_string(char const * string) override {
reset();
std::string s(string);
std::istringstream is(s);
@ -1200,13 +1200,13 @@ public:
m_short_sort(ctx.get_manager()),
m_use_map_names(ctx.use_map_names()) {
}
~wpa_parser_impl() {
~wpa_parser_impl() override {
reset_dealloc_values(m_sort_contents);
}
void reset() {
}
virtual bool parse_directory(char const * path) {
bool parse_directory(char const * path) override {
bool result = false;
try {
result = parse_directory_core(path);

View file

@ -166,10 +166,10 @@ public:
m_arg_idx(0),
m_t(0),
m_bound(UINT_MAX) {}
virtual char const * get_usage() const { return "(forall (q) (=> (and body) head)) :optional-name :optional-recursion-bound"; }
virtual char const * get_descr(cmd_context & ctx) const { return "add a Horn rule."; }
virtual unsigned get_arity() const { return VAR_ARITY; }
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const {
char const * get_usage() const override { return "(forall (q) (=> (and body) head)) :optional-name :optional-recursion-bound"; }
char const * get_descr(cmd_context & ctx) const override { return "add a Horn rule."; }
unsigned get_arity() const override { return VAR_ARITY; }
cmd_arg_kind next_arg_kind(cmd_context & ctx) const override {
switch(m_arg_idx) {
case 0: return CPK_EXPR;
case 1: return CPK_SYMBOL;
@ -177,23 +177,23 @@ public:
default: return CPK_SYMBOL;
}
}
virtual void set_next_arg(cmd_context & ctx, expr * t) {
void set_next_arg(cmd_context & ctx, expr * t) override {
m_t = t;
m_arg_idx++;
}
virtual void set_next_arg(cmd_context & ctx, symbol const & s) {
void set_next_arg(cmd_context & ctx, symbol const & s) override {
m_name = s;
m_arg_idx++;
}
virtual void set_next_arg(cmd_context & ctx, unsigned bound) {
void set_next_arg(cmd_context & ctx, unsigned bound) override {
m_bound = bound;
m_arg_idx++;
}
virtual void reset(cmd_context & ctx) { m_dl_ctx->reset(); prepare(ctx); m_t = nullptr; }
virtual void prepare(cmd_context& ctx) { m_arg_idx = 0; m_name = symbol::null; m_bound = UINT_MAX; }
virtual void finalize(cmd_context & ctx) {
void reset(cmd_context & ctx) override { m_dl_ctx->reset(); prepare(ctx); m_t = nullptr; }
void prepare(cmd_context& ctx) override { m_arg_idx = 0; m_name = symbol::null; m_bound = UINT_MAX; }
void finalize(cmd_context & ctx) override {
}
virtual void execute(cmd_context & ctx) {
void execute(cmd_context & ctx) override {
if (!m_t) throw cmd_exception("invalid rule, expected formula");
m_dl_ctx->add_rule(m_t, m_name, m_bound);
}
@ -208,17 +208,17 @@ public:
m_dl_ctx(dl_ctx),
m_target(0) {
}
virtual char const * get_usage() const { return "predicate"; }
virtual char const * get_main_descr() const {
char const * get_usage() const override { return "predicate"; }
char const * get_main_descr() const override {
return "pose a query to a predicate based on the Horn rules.";
}
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const {
cmd_arg_kind next_arg_kind(cmd_context & ctx) const override {
if (m_target == 0) return CPK_FUNC_DECL;
return parametric_cmd::next_arg_kind(ctx);
}
virtual void set_next_arg(cmd_context & ctx, func_decl* t) {
void set_next_arg(cmd_context & ctx, func_decl* t) override {
m_target = t;
if (t->get_family_id() != null_family_id) {
throw cmd_exception("Invalid query argument, expected uinterpreted function name, but argument is interpreted");
@ -229,13 +229,13 @@ public:
}
}
virtual void prepare(cmd_context & ctx) {
void prepare(cmd_context & ctx) override {
ctx.m(); // ensure manager is initialized.
parametric_cmd::prepare(ctx);
m_target = 0;
}
virtual void execute(cmd_context& ctx) {
void execute(cmd_context& ctx) override {
if (m_target == 0) {
throw cmd_exception("invalid query command, argument expected");
}
@ -321,7 +321,7 @@ public:
m_target = 0;
}
virtual void init_pdescrs(cmd_context & ctx, param_descrs & p) {
void init_pdescrs(cmd_context & ctx, param_descrs & p) override {
m_dl_ctx->dlctx().collect_params(p);
}
@ -385,30 +385,30 @@ public:
m_dl_ctx(dl_ctx),
m_domain(0) {}
virtual char const * get_usage() const { return "<symbol> (<arg1 sort> ...) <representation>*"; }
virtual char const * get_descr(cmd_context & ctx) const { return "declare new relation"; }
virtual unsigned get_arity() const { return VAR_ARITY; }
char const * get_usage() const override { return "<symbol> (<arg1 sort> ...) <representation>*"; }
char const * get_descr(cmd_context & ctx) const override { return "declare new relation"; }
unsigned get_arity() const override { return VAR_ARITY; }
virtual void prepare(cmd_context & ctx) {
void prepare(cmd_context & ctx) override {
ctx.m(); // ensure manager is initialized.
m_arg_idx = 0;
m_query_arg_idx = 0;
m_domain.reset();
m_kinds.reset();
}
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const {
cmd_arg_kind next_arg_kind(cmd_context & ctx) const override {
switch(m_query_arg_idx++) {
case 0: return CPK_SYMBOL; // relation name
case 1: return CPK_SORT_LIST; // arguments
default: return CPK_SYMBOL; // optional representation specification
}
}
virtual void set_next_arg(cmd_context & ctx, unsigned num, sort * const * slist) {
void set_next_arg(cmd_context & ctx, unsigned num, sort * const * slist) override {
m_domain.reset();
m_domain.append(num, slist);
m_arg_idx++;
}
virtual void set_next_arg(cmd_context & ctx, symbol const & s) {
void set_next_arg(cmd_context & ctx, symbol const & s) override {
if(m_arg_idx==0) {
m_rel_name = s;
}
@ -418,7 +418,7 @@ public:
}
m_arg_idx++;
}
virtual void execute(cmd_context & ctx) {
void execute(cmd_context & ctx) override {
if(m_arg_idx<2) {
throw cmd_exception("at least 2 arguments expected");
}
@ -444,15 +444,15 @@ public:
m_dl_ctx(dl_ctx)
{}
virtual char const * get_usage() const { return "<symbol> <sort>"; }
virtual char const * get_descr(cmd_context & ctx) const { return "declare constant as variable"; }
virtual unsigned get_arity() const { return 2; }
char const * get_usage() const override { return "<symbol> <sort>"; }
char const * get_descr(cmd_context & ctx) const override { return "declare constant as variable"; }
unsigned get_arity() const override { return 2; }
virtual void prepare(cmd_context & ctx) {
void prepare(cmd_context & ctx) override {
ctx.m(); // ensure manager is initialized.
m_arg_idx = 0;
}
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const {
cmd_arg_kind next_arg_kind(cmd_context & ctx) const override {
SASSERT(m_arg_idx <= 1);
if (m_arg_idx == 0) {
return CPK_SYMBOL;
@ -460,17 +460,17 @@ public:
return CPK_SORT;
}
virtual void set_next_arg(cmd_context & ctx, sort* s) {
void set_next_arg(cmd_context & ctx, sort* s) override {
m_var_sort = s;
++m_arg_idx;
}
virtual void set_next_arg(cmd_context & ctx, symbol const & s) {
void set_next_arg(cmd_context & ctx, symbol const & s) override {
m_var_name = s;
++m_arg_idx;
}
virtual void execute(cmd_context & ctx) {
void execute(cmd_context & ctx) override {
ast_manager& m = ctx.m();
func_decl_ref var(m.mk_func_decl(m_var_name, 0, static_cast<sort*const*>(0), m_var_sort), m);
ctx.insert(var);
@ -489,10 +489,10 @@ public:
m_dl_ctx(dl_ctx)
{}
virtual char const * get_usage() const { return ""; }
virtual char const * get_descr(cmd_context & ctx) const { return "push the fixedpoint context"; }
virtual unsigned get_arity() const { return 0; }
virtual void execute(cmd_context & ctx) {
char const * get_usage() const override { return ""; }
char const * get_descr(cmd_context & ctx) const override { return "push the fixedpoint context"; }
unsigned get_arity() const override { return 0; }
void execute(cmd_context & ctx) override {
m_dl_ctx->push();
}
};
@ -508,10 +508,10 @@ public:
m_dl_ctx(dl_ctx)
{}
virtual char const * get_usage() const { return ""; }
virtual char const * get_descr(cmd_context & ctx) const { return "pop the fixedpoint context"; }
virtual unsigned get_arity() const { return 0; }
virtual void execute(cmd_context & ctx) {
char const * get_usage() const override { return ""; }
char const * get_descr(cmd_context & ctx) const override { return "pop the fixedpoint context"; }
unsigned get_arity() const override { return 0; }
void execute(cmd_context & ctx) override {
m_dl_ctx->pop();
}
};

View file

@ -27,8 +27,8 @@ namespace datalog {
context* m_ctx;
public:
register_engine();
engine_base* mk_engine(DL_ENGINE engine_type);
void set_context(context* ctx) { m_ctx = ctx; }
engine_base* mk_engine(DL_ENGINE engine_type) override;
void set_context(context* ctx) override { m_ctx = ctx; }
};
}

View file

@ -365,43 +365,43 @@ public:
m_imp = alloc(imp, t, m, p);
}
virtual tactic * translate(ast_manager & m) {
tactic * translate(ast_manager & m) override {
return alloc(horn_tactic, m_is_simplify, m, m_params);
}
virtual ~horn_tactic() {
~horn_tactic() override {
dealloc(m_imp);
}
virtual void updt_params(params_ref const & p) {
void updt_params(params_ref const & p) override {
m_params = p;
m_imp->updt_params(p);
}
virtual void collect_param_descrs(param_descrs & r) {
void collect_param_descrs(param_descrs & r) override {
m_imp->collect_param_descrs(r);
}
virtual void operator()(goal_ref const & in,
goal_ref_buffer & result,
model_converter_ref & mc,
proof_converter_ref & pc,
expr_dependency_ref & core) {
void operator()(goal_ref const & in,
goal_ref_buffer & result,
model_converter_ref & mc,
proof_converter_ref & pc,
expr_dependency_ref & core) override {
(*m_imp)(in, result, mc, pc, core);
}
virtual void collect_statistics(statistics & st) const {
void collect_statistics(statistics & st) const override {
m_imp->collect_statistics(st);
st.copy(m_stats);
}
virtual void reset_statistics() {
void reset_statistics() override {
m_stats.reset();
m_imp->reset_statistics();
}
virtual void cleanup() {
void cleanup() override {
ast_manager & m = m_imp->m;
m_imp->collect_statistics(m_stats);
dealloc(m_imp);