3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-08 00:05:46 +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

@ -49,12 +49,12 @@ class help_cmd : public cmd {
public:
help_cmd():cmd("help") {}
virtual char const * get_usage() const { return "<symbol>*"; }
virtual char const * get_descr(cmd_context & ctx) const { return "print this help."; }
virtual unsigned get_arity() const { return VAR_ARITY; }
virtual void prepare(cmd_context & ctx) { m_cmds.reset(); }
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const { return CPK_SYMBOL; }
virtual void set_next_arg(cmd_context & ctx, symbol const & s) {
char const * get_usage() const override { return "<symbol>*"; }
char const * get_descr(cmd_context & ctx) const override { return "print this help."; }
unsigned get_arity() const override { return VAR_ARITY; }
void prepare(cmd_context & ctx) override { m_cmds.reset(); }
cmd_arg_kind next_arg_kind(cmd_context & ctx) const override { return CPK_SYMBOL; }
void set_next_arg(cmd_context & ctx, symbol const & s) override {
cmd * c = ctx.find_cmd(s);
if (c == 0) {
std::string err_msg("unknown command '");
@ -69,7 +69,7 @@ public:
bool operator()(named_cmd const & c1, named_cmd const & c2) const { return c1.first.str() < c2.first.str(); }
};
virtual void execute(cmd_context & ctx) {
void execute(cmd_context & ctx) override {
ctx.regular_stream() << "\"";
if (m_cmds.empty()) {
vector<named_cmd> cmds;
@ -101,14 +101,14 @@ class get_model_cmd : public cmd {
unsigned m_index;
public:
get_model_cmd(): cmd("get-model"), m_index(0) {}
virtual char const * get_usage() const { return "[<index of box objective>]"; }
virtual char const * get_descr(cmd_context & ctx) const {
char const * get_usage() const override { return "[<index of box objective>]"; }
char const * get_descr(cmd_context & ctx) const override {
return "retrieve model for the last check-sat command.\nSupply optional index if retrieving a model corresponding to a box optimization objective";
}
virtual unsigned get_arity() const { return VAR_ARITY; }
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const { return CPK_UINT; }
virtual void set_next_arg(cmd_context & ctx, unsigned index) { m_index = index; }
virtual void execute(cmd_context & ctx) {
unsigned get_arity() const override { return VAR_ARITY; }
cmd_arg_kind next_arg_kind(cmd_context & ctx) const override { return CPK_UINT; }
void set_next_arg(cmd_context & ctx, unsigned index) override { m_index = index; }
void execute(cmd_context & ctx) override {
if (!ctx.is_model_available() || ctx.get_check_sat_result() == 0)
throw cmd_exception("model is not available");
model_ref m;
@ -120,7 +120,7 @@ public:
}
ctx.display_model(m);
}
virtual void reset(cmd_context& ctx) {
void reset(cmd_context& ctx) override {
m_index = 0;
}
};
@ -166,10 +166,10 @@ class cmd_is_declared : public ast_smt_pp::is_declared {
public:
cmd_is_declared(cmd_context& ctx): m_ctx(ctx) {}
virtual bool operator()(func_decl* d) const {
bool operator()(func_decl* d) const override {
return m_ctx.is_func_decl(d->get_name());
}
virtual bool operator()(sort* s) const {
bool operator()(sort* s) const override {
return m_ctx.is_sort_decl(s->get_name());
}
};
@ -360,7 +360,7 @@ public:
m_int_real_coercions(":int-real-coercions"),
m_reproducible_resource_limit(":reproducible-resource-limit") {
}
virtual ~set_get_option_cmd() {}
~set_get_option_cmd() override {}
};
@ -477,19 +477,19 @@ public:
m_unsupported(false) {
}
virtual char const * get_usage() const { return "<keyword> <value>"; }
char const * get_usage() const override { return "<keyword> <value>"; }
virtual char const * get_descr(cmd_context & ctx) const { return "set configuration option."; }
char const * get_descr(cmd_context & ctx) const override { return "set configuration option."; }
virtual unsigned get_arity() const { return 2; }
unsigned get_arity() const override { return 2; }
virtual void prepare(cmd_context & ctx) { m_unsupported = false; m_option = symbol::null; }
void prepare(cmd_context & ctx) override { m_unsupported = false; m_option = symbol::null; }
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const {
cmd_arg_kind next_arg_kind(cmd_context & ctx) const override {
return m_option == symbol::null ? CPK_KEYWORD : CPK_OPTION_VALUE;
}
virtual void set_next_arg(cmd_context & ctx, symbol const & opt) {
void set_next_arg(cmd_context & ctx, symbol const & opt) override {
if (m_option == symbol::null) {
m_option = opt;
}
@ -498,7 +498,7 @@ public:
}
}
virtual void set_next_arg(cmd_context & ctx, rational const & val) {
void set_next_arg(cmd_context & ctx, rational const & val) override {
if (m_option == m_random_seed) {
ctx.set_random_seed(to_unsigned(val));
}
@ -517,7 +517,7 @@ public:
}
}
virtual void set_next_arg(cmd_context & ctx, char const * value) {
void set_next_arg(cmd_context & ctx, char const * value) override {
if (m_option == m_regular_output_channel) {
ctx.set_regular_stream(value);
}
@ -532,7 +532,7 @@ public:
}
}
virtual void execute(cmd_context & ctx) {
void execute(cmd_context & ctx) override {
if (m_unsupported)
ctx.print_unsupported(m_option, m_line, m_pos);
else
@ -557,11 +557,11 @@ public:
get_option_cmd():
set_get_option_cmd("get-option") {
}
virtual char const * get_usage() const { return "<keyword>"; }
virtual char const * get_descr(cmd_context & ctx) const { return "get configuration option."; }
virtual unsigned get_arity() const { return 1; }
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const { return CPK_KEYWORD; }
virtual void set_next_arg(cmd_context & ctx, symbol const & opt) {
char const * get_usage() const override { return "<keyword>"; }
char const * get_descr(cmd_context & ctx) const override { return "get configuration option."; }
unsigned get_arity() const override { return 1; }
cmd_arg_kind next_arg_kind(cmd_context & ctx) const override { return CPK_KEYWORD; }
void set_next_arg(cmd_context & ctx, symbol const & opt) override {
if (opt == m_print_success) {
print_bool(ctx, ctx.print_success_enabled());
}
@ -651,11 +651,11 @@ public:
m_all_statistics(":all-statistics"),
m_assertion_stack_levels(":assertion-stack-levels") {
}
virtual char const * get_usage() const { return "<keyword>"; }
virtual char const * get_descr(cmd_context & ctx) const { return "get information."; }
virtual unsigned get_arity() const { return 1; }
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const { return CPK_KEYWORD; }
virtual void set_next_arg(cmd_context & ctx, symbol const & opt) {
char const * get_usage() const override { return "<keyword>"; }
char const * get_descr(cmd_context & ctx) const override { return "get information."; }
unsigned get_arity() const override { return 1; }
cmd_arg_kind next_arg_kind(cmd_context & ctx) const override { return CPK_KEYWORD; }
void set_next_arg(cmd_context & ctx, symbol const & opt) override {
if (opt == m_error_behavior) {
if (ctx.exit_on_error())
ctx.regular_stream() << "(:error-behavior immediate-exit)" << std::endl;
@ -707,16 +707,16 @@ public:
m_sat("sat"),
m_unknown("unknown") {
}
virtual char const * get_usage() const { return "<keyword> <value>"; }
virtual char const * get_descr(cmd_context & ctx) const { return "set information."; }
virtual unsigned get_arity() const { return 2; }
virtual void prepare(cmd_context & ctx) { m_info = symbol::null; }
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const {
char const * get_usage() const override { return "<keyword> <value>"; }
char const * get_descr(cmd_context & ctx) const override { return "set information."; }
unsigned get_arity() const override { return 2; }
void prepare(cmd_context & ctx) override { m_info = symbol::null; }
cmd_arg_kind next_arg_kind(cmd_context & ctx) const override {
return m_info == symbol::null ? CPK_KEYWORD : CPK_OPTION_VALUE;
}
virtual void set_next_arg(cmd_context & ctx, rational const & val) {}
virtual void set_next_arg(cmd_context & ctx, char const * val) {}
virtual void set_next_arg(cmd_context & ctx, symbol const & s) {
void set_next_arg(cmd_context & ctx, rational const & val) override {}
void set_next_arg(cmd_context & ctx, char const * val) override {}
void set_next_arg(cmd_context & ctx, symbol const & s) override {
if (m_info == symbol::null) {
m_info = s;
}
@ -737,7 +737,7 @@ public:
}
}
}
virtual void execute(cmd_context & ctx) {
void execute(cmd_context & ctx) override {
ctx.print_success();
}
};
@ -760,30 +760,30 @@ public:
}
return m_array_fid;
}
virtual char const * get_usage() const { return "<symbol> (<sort>+) <func-decl-ref>"; }
virtual char const * get_descr(cmd_context & ctx) const { return "declare a new array map operator with name <symbol> using the given function declaration.\n<func-decl-ref> ::= <symbol>\n | (<symbol> (<sort>*) <sort>)\n | ((_ <symbol> <numeral>+) (<sort>*) <sort>)\nThe last two cases are used to disumbiguate between declarations with the same name and/or select (indexed) builtin declarations.\nFor more details about the array map operator, see 'Generalized and Efficient Array Decision Procedures' (FMCAD 2009).\nExample: (declare-map set-union (Int) (or (Bool Bool) Bool))\nDeclares a new function (declare-fun set-union ((Array Int Bool) (Array Int Bool)) (Array Int Bool)).\nThe instance of the map axiom for this new declaration is:\n(forall ((a1 (Array Int Bool)) (a2 (Array Int Bool)) (i Int)) (= (select (set-union a1 a2) i) (or (select a1 i) (select a2 i))))"; }
virtual unsigned get_arity() const { return 3; }
virtual void prepare(cmd_context & ctx) { m_name = symbol::null; m_domain.reset(); }
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const {
char const * get_usage() const override { return "<symbol> (<sort>+) <func-decl-ref>"; }
char const * get_descr(cmd_context & ctx) const override { return "declare a new array map operator with name <symbol> using the given function declaration.\n<func-decl-ref> ::= <symbol>\n | (<symbol> (<sort>*) <sort>)\n | ((_ <symbol> <numeral>+) (<sort>*) <sort>)\nThe last two cases are used to disumbiguate between declarations with the same name and/or select (indexed) builtin declarations.\nFor more details about the array map operator, see 'Generalized and Efficient Array Decision Procedures' (FMCAD 2009).\nExample: (declare-map set-union (Int) (or (Bool Bool) Bool))\nDeclares a new function (declare-fun set-union ((Array Int Bool) (Array Int Bool)) (Array Int Bool)).\nThe instance of the map axiom for this new declaration is:\n(forall ((a1 (Array Int Bool)) (a2 (Array Int Bool)) (i Int)) (= (select (set-union a1 a2) i) (or (select a1 i) (select a2 i))))"; }
unsigned get_arity() const override { return 3; }
void prepare(cmd_context & ctx) override { m_name = symbol::null; m_domain.reset(); }
cmd_arg_kind next_arg_kind(cmd_context & ctx) const override {
if (m_name == symbol::null) return CPK_SYMBOL;
if (m_domain.empty()) return CPK_SORT_LIST;
return CPK_FUNC_DECL;
}
virtual void set_next_arg(cmd_context & ctx, symbol const & s) { m_name = s; }
virtual void set_next_arg(cmd_context & ctx, unsigned num, sort * const * slist) {
void set_next_arg(cmd_context & ctx, symbol const & s) override { m_name = s; }
void set_next_arg(cmd_context & ctx, unsigned num, sort * const * slist) override {
if (num == 0)
throw cmd_exception("invalid map declaration, empty sort list");
m_domain.append(num, slist);
}
virtual void set_next_arg(cmd_context & ctx, func_decl * f) {
void set_next_arg(cmd_context & ctx, func_decl * f) override {
m_f = f;
if (m_f->get_arity() == 0)
throw cmd_exception("invalid map declaration, function declaration must have arity > 0");
}
virtual void reset(cmd_context & ctx) {
void reset(cmd_context & ctx) override {
m_array_fid = null_family_id;
}
virtual void execute(cmd_context & ctx) {
void execute(cmd_context & ctx) override {
psort_decl * array_sort = ctx.find_psort_decl(m_array_sort);
if (array_sort == 0)
throw cmd_exception("Array sort is not available");
@ -813,11 +813,11 @@ class get_consequences_cmd : public cmd {
unsigned m_count;
public:
get_consequences_cmd(): cmd("get-consequences"), m_count(0) {}
virtual char const * get_usage() const { return "(<boolean-variable>*) (<variable>*)"; }
virtual char const * get_descr(cmd_context & ctx) const { return "retrieve consequences that fix values for supplied variables"; }
virtual unsigned get_arity() const { return 2; }
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const { return CPK_EXPR_LIST; }
virtual void set_next_arg(cmd_context & ctx, unsigned num, expr * const * tlist) {
char const * get_usage() const override { return "(<boolean-variable>*) (<variable>*)"; }
char const * get_descr(cmd_context & ctx) const override { return "retrieve consequences that fix values for supplied variables"; }
unsigned get_arity() const override { return 2; }
cmd_arg_kind next_arg_kind(cmd_context & ctx) const override { return CPK_EXPR_LIST; }
void set_next_arg(cmd_context & ctx, unsigned num, expr * const * tlist) override {
if (m_count == 0) {
m_assumptions.append(num, tlist);
++m_count;
@ -826,8 +826,8 @@ public:
m_variables.append(num, tlist);
}
}
virtual void failure_cleanup(cmd_context & ctx) {}
virtual void execute(cmd_context & ctx) {
void failure_cleanup(cmd_context & ctx) override {}
void execute(cmd_context & ctx) override {
ast_manager& m = ctx.m();
expr_ref_vector assumptions(m), variables(m), consequences(m);
assumptions.append(m_assumptions.size(), m_assumptions.c_ptr());
@ -835,12 +835,12 @@ public:
ctx.get_consequences(assumptions, variables, consequences);
ctx.regular_stream() << consequences << "\n";
}
virtual void prepare(cmd_context & ctx) { reset(ctx); }
void prepare(cmd_context & ctx) override { reset(ctx); }
virtual void reset(cmd_context& ctx) {
void reset(cmd_context& ctx) override {
m_assumptions.reset(); m_variables.reset(); m_count = 0;
}
virtual void finalize(cmd_context & ctx) {}
void finalize(cmd_context & ctx) override {}
};
// provides "help" for builtin cmds
@ -850,8 +850,8 @@ class builtin_cmd : public cmd {
public:
builtin_cmd(char const * name, char const * usage, char const * descr):
cmd(name), m_usage(usage), m_descr(descr) {}
virtual char const * get_usage() const { return m_usage; }
virtual char const * get_descr(cmd_context & ctx) const { return m_descr; }
char const * get_usage() const override { return m_usage; }
char const * get_descr(cmd_context & ctx) const override { return m_descr; }
};

View file

@ -414,25 +414,25 @@ protected:
public:
pp_env(cmd_context & o):m_owner(o), m_autil(o.m()), m_bvutil(o.m()), m_arutil(o.m()), m_futil(o.m()), m_sutil(o.m()), m_dtutil(o.m()), m_dlutil(o.m()) {}
virtual ~pp_env() {}
virtual ast_manager & get_manager() const { return m_owner.m(); }
virtual arith_util & get_autil() { return m_autil; }
virtual bv_util & get_bvutil() { return m_bvutil; }
virtual array_util & get_arutil() { return m_arutil; }
virtual fpa_util & get_futil() { return m_futil; }
virtual seq_util & get_sutil() { return m_sutil; }
virtual datatype_util & get_dtutil() { return m_dtutil; }
~pp_env() override {}
ast_manager & get_manager() const override { return m_owner.m(); }
arith_util & get_autil() override { return m_autil; }
bv_util & get_bvutil() override { return m_bvutil; }
array_util & get_arutil() override { return m_arutil; }
fpa_util & get_futil() override { return m_futil; }
seq_util & get_sutil() override { return m_sutil; }
datatype_util & get_dtutil() override { return m_dtutil; }
virtual datalog::dl_decl_util& get_dlutil() { return m_dlutil; }
virtual bool uses(symbol const & s) const {
datalog::dl_decl_util& get_dlutil() override { return m_dlutil; }
bool uses(symbol const & s) const override {
return
m_owner.m_builtin_decls.contains(s) ||
m_owner.m_func_decls.contains(s);
}
virtual format_ns::format * pp_sort(sort * s) {
format_ns::format * pp_sort(sort * s) override {
return m_owner.pp(s);
}
virtual format_ns::format * pp_fdecl(func_decl * f, unsigned & len) {
format_ns::format * pp_fdecl(func_decl * f, unsigned & len) override {
symbol s = f->get_name();
func_decls fs;
if (m_owner.m_func_decls.find(s, fs) && fs.contains(f)) {
@ -443,7 +443,7 @@ public:
}
return smt2_pp_environment::pp_fdecl(f, len);
}
virtual format_ns::format * pp_fdecl_ref(func_decl * f) {
format_ns::format * pp_fdecl_ref(func_decl * f) override {
symbol s = f->get_name();
func_decls fs;
if (m_owner.m_func_decls.find(s, fs) && fs.contains(f)) {

View file

@ -112,10 +112,10 @@ class ast_object_ref : public object_ref {
ast * m_ast;
public:
ast_object_ref(cmd_context & ctx, ast * a);
virtual void finalize(cmd_context & ctx);
void finalize(cmd_context & ctx) override;
ast * get_ast() const { return m_ast; }
static char const * cls_kind() { return "AST"; }
virtual char const * kind() const { return cls_kind(); }
char const * kind() const override { return cls_kind(); }
};
class stream_ref {
@ -250,8 +250,8 @@ protected:
datatype_util m_dt_util;
public:
dt_eh(cmd_context & owner);
virtual ~dt_eh();
virtual void operator()(sort * dt, pdecl* pd);
~dt_eh() override;
void operator()(sort * dt, pdecl* pd) override;
};
friend class dt_eh;
@ -307,7 +307,7 @@ protected:
public:
cmd_context(bool main_ctx = true, ast_manager * m = 0, symbol const & l = symbol::null);
~cmd_context();
~cmd_context() override;
void set_cancel(bool f);
context_params & params() { return m_params; }
solver_factory &get_solver_factory() { return *m_solver_factory; }
@ -354,7 +354,7 @@ public:
bool has_manager() const { return m_manager != 0; }
ast_manager & m() const { const_cast<cmd_context*>(this)->init_manager(); return *m_manager; }
virtual ast_manager & get_ast_manager() { return m(); }
ast_manager & get_ast_manager() override { return m(); }
pdecl_manager & pm() const { if (!m_pmanager) const_cast<cmd_context*>(this)->init_manager(); return *m_pmanager; }
sexpr_manager & sm() const { if (!m_sexpr_manager) const_cast<cmd_context*>(this)->m_sexpr_manager = alloc(sexpr_manager); return *m_sexpr_manager; }
@ -407,8 +407,8 @@ public:
void set_regular_stream(char const * name) { m_regular.set(name); }
void set_regular_stream(std::ostream& out) { m_regular.set(out); }
void set_diagnostic_stream(char const * name);
virtual std::ostream & regular_stream() { return *m_regular; }
virtual std::ostream & diagnostic_stream() { return *m_diagnostic; }
std::ostream & regular_stream() override { return *m_regular; }
std::ostream & diagnostic_stream() override { return *m_diagnostic; }
char const * get_regular_stream_name() const { return m_regular.name(); }
char const * get_diagnostic_stream_name() const { return m_diagnostic.name(); }
typedef dictionary<cmd*>::iterator cmd_iterator;
@ -462,14 +462,14 @@ public:
}
format_ns::format * pp(sort * s) const;
virtual void pp(sort * s, format_ns::format_ref & r) const { r = pp(s); }
virtual void pp(func_decl * f, format_ns::format_ref & r) const;
virtual void pp(expr * n, unsigned num_vars, char const * var_prefix, format_ns::format_ref & r, sbuffer<symbol> & var_names) const;
virtual void pp(expr * n, format_ns::format_ref & r) const;
virtual void display(std::ostream & out, sort * s, unsigned indent = 0) const;
virtual void display(std::ostream & out, expr * n, unsigned indent, unsigned num_vars, char const * var_prefix, sbuffer<symbol> & var_names) const;
virtual void display(std::ostream & out, expr * n, unsigned indent = 0) const;
virtual void display(std::ostream & out, func_decl * f, unsigned indent = 0) const;
void pp(sort * s, format_ns::format_ref & r) const override { r = pp(s); }
void pp(func_decl * f, format_ns::format_ref & r) const override;
void pp(expr * n, unsigned num_vars, char const * var_prefix, format_ns::format_ref & r, sbuffer<symbol> & var_names) const override;
void pp(expr * n, format_ns::format_ref & r) const override;
void display(std::ostream & out, sort * s, unsigned indent = 0) const override;
void display(std::ostream & out, expr * n, unsigned indent, unsigned num_vars, char const * var_prefix, sbuffer<symbol> & var_names) const override;
void display(std::ostream & out, expr * n, unsigned indent = 0) const override;
void display(std::ostream & out, func_decl * f, unsigned indent = 0) const override;
// dump assertions in out using the pretty printer.
void dump_assertions(std::ostream & out) const;
@ -478,8 +478,8 @@ public:
void display_smt2_benchmark(std::ostream & out, unsigned num, expr * const * assertions, symbol const & logic = symbol::null) const;
virtual void slow_progress_sample();
virtual void fast_progress_sample();
void slow_progress_sample() override;
void fast_progress_sample() override;
};
std::ostream & operator<<(std::ostream & out, cmd_context::status st);

View file

@ -27,11 +27,11 @@ class echo_tactic : public skip_tactic {
public:
echo_tactic(cmd_context & ctx, char const * msg, bool newline):m_ctx(ctx), m_msg(msg), m_newline(newline) {}
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 {
#pragma omp critical (echo_tactic)
{
m_ctx.regular_stream() << m_msg;
@ -57,15 +57,15 @@ public:
m_p->inc_ref();
}
~probe_value_tactic() {
~probe_value_tactic() override {
m_p->dec_ref();
}
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 {
double val = (*m_p)(*(in.get())).get_value();
#pragma omp critical (probe_value_tactic)
{

View file

@ -29,33 +29,33 @@ class eval_cmd : public parametric_cmd {
public:
eval_cmd():parametric_cmd("eval") {}
virtual char const * get_usage() const { return "<term> (<keyword> <value>)*"; }
char const * get_usage() const override { return "<term> (<keyword> <value>)*"; }
virtual char const * get_main_descr() const {
char const * get_main_descr() const override {
return "evaluate the given term in the current model.";
}
virtual void init_pdescrs(cmd_context & ctx, param_descrs & p) {
void init_pdescrs(cmd_context & ctx, param_descrs & p) override {
model_evaluator::get_param_descrs(p);
insert_timeout(p);
p.insert("model_index", CPK_UINT, "(default: 0) index of model from box optimization objective");
}
virtual void prepare(cmd_context & ctx) {
void prepare(cmd_context & ctx) override {
parametric_cmd::prepare(ctx);
m_target = 0;
}
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_EXPR;
return parametric_cmd::next_arg_kind(ctx);
}
virtual void set_next_arg(cmd_context & ctx, expr * arg) {
void set_next_arg(cmd_context & ctx, expr * arg) override {
m_target = arg;
}
virtual void execute(cmd_context & ctx) {
void execute(cmd_context & ctx) override {
if (!ctx.is_model_available())
throw cmd_exception("model is not available");
if (!m_target)

View file

@ -104,15 +104,15 @@ class subst_cmd : public cmd {
ptr_vector<expr> m_subst;
public:
subst_cmd():cmd("dbg-subst") {}
virtual char const * get_usage() const { return "<symbol> (<symbol>*) <symbol>"; }
virtual char const * get_descr(cmd_context & ctx) const { return "substitute the free variables in the AST referenced by <symbol> using the ASTs referenced by <symbol>*"; }
virtual unsigned get_arity() const { return 3; }
virtual void prepare(cmd_context & ctx) { m_idx = 0; m_source = 0; }
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const {
char const * get_usage() const override { return "<symbol> (<symbol>*) <symbol>"; }
char const * get_descr(cmd_context & ctx) const override { return "substitute the free variables in the AST referenced by <symbol> using the ASTs referenced by <symbol>*"; }
unsigned get_arity() const override { return 3; }
void prepare(cmd_context & ctx) override { m_idx = 0; m_source = 0; }
cmd_arg_kind next_arg_kind(cmd_context & ctx) const override {
if (m_idx == 1) return CPK_SYMBOL_LIST;
return CPK_SYMBOL;
}
virtual void set_next_arg(cmd_context & ctx, symbol const & s) {
void set_next_arg(cmd_context & ctx, symbol const & s) override {
if (m_idx == 0) {
m_source = get_expr_ref(ctx, s);
}
@ -121,7 +121,7 @@ public:
}
m_idx++;
}
virtual void set_next_arg(cmd_context & ctx, unsigned num, symbol const * s) {
void set_next_arg(cmd_context & ctx, unsigned num, symbol const * s) override {
m_subst.reset();
unsigned i = num;
while (i > 0) {
@ -130,7 +130,7 @@ public:
}
m_idx++;
}
virtual void execute(cmd_context & ctx) {
void execute(cmd_context & ctx) override {
expr_ref r(ctx.m());
beta_reducer p(ctx.m());
p(m_source, m_subst.size(), m_subst.c_ptr(), r);
@ -179,18 +179,18 @@ class lt_cmd : public cmd {
expr * m_t2;
public:
lt_cmd():cmd("dbg-lt") {}
virtual char const * get_usage() const { return "<term> <term>"; }
virtual char const * get_descr(cmd_context & ctx) const { return "return true if the first term is smaller than the second one in the internal Z3 total order on terms."; }
virtual unsigned get_arity() const { return 2; }
virtual void prepare(cmd_context & ctx) { m_t1 = 0; }
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const { return CPK_EXPR; }
virtual void set_next_arg(cmd_context & ctx, expr * arg) {
char const * get_usage() const override { return "<term> <term>"; }
char const * get_descr(cmd_context & ctx) const override { return "return true if the first term is smaller than the second one in the internal Z3 total order on terms."; }
unsigned get_arity() const override { return 2; }
void prepare(cmd_context & ctx) override { m_t1 = 0; }
cmd_arg_kind next_arg_kind(cmd_context & ctx) const override { return CPK_EXPR; }
void set_next_arg(cmd_context & ctx, expr * arg) override {
if (m_t1 == 0)
m_t1 = arg;
else
m_t2 = arg;
}
virtual void execute(cmd_context & ctx) {
void execute(cmd_context & ctx) override {
bool r = lt(m_t1, m_t2);
ctx.regular_stream() << (r ? "true" : "false") << std::endl;
}
@ -283,23 +283,23 @@ protected:
ptr_vector<expr> m_args;
public:
instantiate_cmd_core(char const * name):cmd(name) {}
virtual char const * get_usage() const { return "<quantifier> (<symbol>*)"; }
virtual char const * get_descr(cmd_context & ctx) const { return "instantiate the quantifier using the given expressions."; }
virtual unsigned get_arity() const { return 2; }
virtual void prepare(cmd_context & ctx) { m_q = 0; m_args.reset(); }
char const * get_usage() const override { return "<quantifier> (<symbol>*)"; }
char const * get_descr(cmd_context & ctx) const override { return "instantiate the quantifier using the given expressions."; }
unsigned get_arity() const override { return 2; }
void prepare(cmd_context & ctx) override { m_q = 0; m_args.reset(); }
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const {
cmd_arg_kind next_arg_kind(cmd_context & ctx) const override {
if (m_q == 0) return CPK_EXPR;
else return CPK_EXPR_LIST;
}
virtual void set_next_arg(cmd_context & ctx, expr * s) {
void set_next_arg(cmd_context & ctx, expr * s) override {
if (!is_quantifier(s))
throw cmd_exception("invalid command, quantifier expected.");
m_q = to_quantifier(s);
}
virtual void set_next_arg(cmd_context & ctx, unsigned num, expr * const * ts) {
void set_next_arg(cmd_context & ctx, unsigned num, expr * const * ts) override {
if (num != m_q->get_num_decls())
throw cmd_exception("invalid command, mismatch between the number of quantified variables and the number of arguments.");
unsigned i = num;
@ -315,7 +315,7 @@ public:
m_args.append(num, ts);
}
virtual void execute(cmd_context & ctx) {
void execute(cmd_context & ctx) override {
expr_ref r(ctx.m());
instantiate(ctx.m(), m_q, m_args.c_ptr(), r);
ctx.display(ctx.regular_stream(), r);
@ -332,9 +332,9 @@ class instantiate_nested_cmd : public instantiate_cmd_core {
public:
instantiate_nested_cmd():instantiate_cmd_core("dbg-instantiate-nested") {}
virtual char const * get_descr(cmd_context & ctx) const { return "instantiate the quantifier nested in the outermost quantifier, this command is used to test the instantiation procedure with quantifiers that contain free variables."; }
char const * get_descr(cmd_context & ctx) const override { return "instantiate the quantifier nested in the outermost quantifier, this command is used to test the instantiation procedure with quantifiers that contain free variables."; }
virtual void set_next_arg(cmd_context & ctx, expr * s) {
void set_next_arg(cmd_context & ctx, expr * s) override {
instantiate_cmd_core::set_next_arg(ctx, s);
if (!is_quantifier(m_q->get_expr()))
throw cmd_exception("invalid command, nested quantifier expected");
@ -345,11 +345,11 @@ public:
class print_dimacs_cmd : public cmd {
public:
print_dimacs_cmd():cmd("display-dimacs") {}
virtual char const * get_usage() const { return ""; }
virtual char const * get_descr(cmd_context & ctx) const { return "print benchmark in DIMACS format"; }
virtual unsigned get_arity() const { return 0; }
virtual void prepare(cmd_context & ctx) {}
virtual void execute(cmd_context & ctx) { ctx.display_dimacs(); }
char const * get_usage() const override { return ""; }
char const * get_descr(cmd_context & ctx) const override { return "print benchmark in DIMACS format"; }
unsigned get_arity() const override { return 0; }
void prepare(cmd_context & ctx) override {}
void execute(cmd_context & ctx) override { ctx.display_dimacs(); }
};

View file

@ -164,33 +164,33 @@ class poly_isolate_roots_cmd : public cmd {
public:
poly_isolate_roots_cmd(char const * name = "poly/isolate-roots"):cmd(name), m_ctx(0) {}
virtual char const * get_usage() const { return "<term> (<term> <value>)*"; }
char const * get_usage() const override { return "<term> (<term> <value>)*"; }
virtual char const * get_descr(cmd_context & ctx) const { return "isolate the roots a multivariate polynomial modulo an assignment"; }
char const * get_descr(cmd_context & ctx) const override { return "isolate the roots a multivariate polynomial modulo an assignment"; }
virtual unsigned get_arity() const { return VAR_ARITY; }
unsigned get_arity() const override { return VAR_ARITY; }
virtual void prepare(cmd_context & ctx) {
void prepare(cmd_context & ctx) override {
m_ctx = alloc(context, ctx.m());
}
virtual void finalize(cmd_context & ctx) {
void finalize(cmd_context & ctx) override {
m_ctx = 0;
}
virtual void failure_cleanup(cmd_context & ctx) {
void failure_cleanup(cmd_context & ctx) override {
m_ctx = 0;
}
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const {
cmd_arg_kind next_arg_kind(cmd_context & ctx) const override {
return CPK_EXPR;
}
virtual void set_next_arg(cmd_context & ctx, expr * arg) {
void set_next_arg(cmd_context & ctx, expr * arg) override {
m_ctx->set_next_arg(ctx, arg);
}
virtual void execute(cmd_context & ctx) {
void execute(cmd_context & ctx) override {
m_ctx->execute(ctx);
m_ctx = 0;
}
@ -204,31 +204,31 @@ class poly_factor_cmd : public parametric_cmd {
public:
poly_factor_cmd(char const * name = "poly/factor"):parametric_cmd(name) {}
virtual char const * get_usage() const { return "<term> (<keyword> <value>)*"; }
char const * get_usage() const override { return "<term> (<keyword> <value>)*"; }
virtual char const * get_main_descr() const {
char const * get_main_descr() const override {
return "factor a polynomial";
}
virtual void init_pdescrs(cmd_context & ctx, param_descrs & p) {
void init_pdescrs(cmd_context & ctx, param_descrs & p) override {
polynomial::factor_params::get_param_descrs(p);
}
virtual void prepare(cmd_context & ctx) {
void prepare(cmd_context & ctx) override {
parametric_cmd::prepare(ctx);
m_target = 0;
}
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_EXPR;
return parametric_cmd::next_arg_kind(ctx);
}
virtual void set_next_arg(cmd_context & ctx, expr * arg) {
void set_next_arg(cmd_context & ctx, expr * arg) override {
m_target = arg;
}
virtual void execute(cmd_context & ctx) {
void execute(cmd_context & ctx) override {
polynomial::factor_params ps;
ps.updt_params(m_params);
factor(ctx, m_target, ps);

View file

@ -219,29 +219,29 @@ protected:
public:
get_interpolant_cmd(char const * name = "get-interpolant"):parametric_cmd(name) {}
virtual char const * get_usage() const { return "<fmla>+"; }
char const * get_usage() const override { return "<fmla>+"; }
virtual char const * get_main_descr() const {
char const * get_main_descr() const override {
return "get interpolant for formulas";
}
virtual void init_pdescrs(cmd_context & ctx, param_descrs & p) {
void init_pdescrs(cmd_context & ctx, param_descrs & p) override {
}
virtual void prepare(cmd_context & ctx) {
void prepare(cmd_context & ctx) override {
parametric_cmd::prepare(ctx);
m_targets.resize(0);
}
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const {
cmd_arg_kind next_arg_kind(cmd_context & ctx) const override {
return CPK_EXPR;
}
virtual void set_next_arg(cmd_context & ctx, expr * arg) {
void set_next_arg(cmd_context & ctx, expr * arg) override {
m_targets.push_back(arg);
}
virtual void execute(cmd_context & ctx) {
void execute(cmd_context & ctx) override {
get_interpolant(ctx,m_targets,m_params);
}
};
@ -250,7 +250,7 @@ class compute_interpolant_cmd : public get_interpolant_cmd {
public:
compute_interpolant_cmd(char const * name = "compute-interpolant"):get_interpolant_cmd(name) {}
virtual void execute(cmd_context & ctx) {
void execute(cmd_context & ctx) override {
compute_interpolant(ctx,m_targets,m_params);
}

View file

@ -31,48 +31,48 @@ public:
scoped_ptr<param_descrs> m_pdescrs;
public:
parametric_cmd(char const * name):cmd(name), m_descr(0) {}
virtual ~parametric_cmd() { if (m_descr) dealloc(m_descr); }
~parametric_cmd() override { if (m_descr) dealloc(m_descr); }
virtual void init_pdescrs(cmd_context & ctx, param_descrs & d) = 0;
param_descrs const & pdescrs(cmd_context & ctx) const;
params_ref const & ps() const { return m_params; }
virtual char const * get_main_descr() const = 0;
virtual char const * get_descr(cmd_context & ctx) const;
virtual unsigned get_arity() const { return VAR_ARITY; }
virtual void prepare(cmd_context & ctx) { m_last = symbol::null; m_params.reset(); }
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const;
virtual void set_next_arg(cmd_context & ctx, symbol const & s);
virtual void set_next_arg(cmd_context & ctx, unsigned val) {
char const * get_descr(cmd_context & ctx) const override;
unsigned get_arity() const override { return VAR_ARITY; }
void prepare(cmd_context & ctx) override { m_last = symbol::null; m_params.reset(); }
cmd_arg_kind next_arg_kind(cmd_context & ctx) const override;
void set_next_arg(cmd_context & ctx, symbol const & s) override;
void set_next_arg(cmd_context & ctx, unsigned val) override {
m_params.set_uint(m_last, val);
m_last = symbol::null;
}
virtual void set_next_arg(cmd_context & ctx, bool val) {
void set_next_arg(cmd_context & ctx, bool val) override {
m_params.set_bool(m_last, val);
m_last = symbol::null;
}
virtual void set_next_arg(cmd_context & ctx, rational const & val) {
void set_next_arg(cmd_context & ctx, rational const & val) override {
m_params.set_rat(m_last, val);
m_last = symbol::null;
}
virtual void set_next_arg(cmd_context & ctx, char const * val) {
void set_next_arg(cmd_context & ctx, char const * val) override {
m_params.set_str(m_last, val);
m_last = symbol::null;
}
virtual void set_next_arg(cmd_context & ctx, sort * s) {
void set_next_arg(cmd_context & ctx, sort * s) override {
NOT_IMPLEMENTED_YET();
// m_params.set_sort(m_last, s);
// m_last = symbol::null;
}
virtual void set_next_arg(cmd_context & ctx, expr * t) {
void set_next_arg(cmd_context & ctx, expr * t) override {
NOT_IMPLEMENTED_YET();
// m_params.set_expr(m_last, t);
// m_last = symbol::null;
}
virtual void set_next_arg(cmd_context & ctx, func_decl * f) {
void set_next_arg(cmd_context & ctx, func_decl * f) override {
NOT_IMPLEMENTED_YET();
// m_params.set_func_decl(m_last, f);
// m_last = symbol::null;
}
virtual void set_next_arg(cmd_context & ctx, sexpr * n) { UNREACHABLE(); }
void set_next_arg(cmd_context & ctx, sexpr * n) override { UNREACHABLE(); }
};
#endif

View file

@ -136,25 +136,25 @@ class psort_sort : public psort {
friend class pdecl_manager;
sort * m_sort;
psort_sort(unsigned id, pdecl_manager & m, sort * s):psort(id, 0), m_sort(s) { m.m().inc_ref(m_sort); }
virtual void finalize(pdecl_manager & m) {
void finalize(pdecl_manager & m) override {
m.m().dec_ref(m_sort);
psort::finalize(m);
}
virtual bool check_num_params(pdecl * other) const { return true; }
virtual size_t obj_size() const { return sizeof(psort_sort); }
bool check_num_params(pdecl * other) const override { return true; }
size_t obj_size() const override { return sizeof(psort_sort); }
sort * get_sort() const { return m_sort; }
virtual sort * instantiate(pdecl_manager & m, sort * const * s) { return m_sort; }
sort * instantiate(pdecl_manager & m, sort * const * s) override { return m_sort; }
public:
virtual ~psort_sort() {}
virtual bool is_sort_wrapper() const { return true; }
virtual char const * hcons_kind() const { return "psort_sort"; }
virtual unsigned hcons_hash() const { return m_sort->get_id(); }
virtual bool hcons_eq(psort const * other) const {
~psort_sort() override {}
bool is_sort_wrapper() const override { return true; }
char const * hcons_kind() const override { return "psort_sort"; }
unsigned hcons_hash() const override { return m_sort->get_id(); }
bool hcons_eq(psort const * other) const override {
if (other->hcons_kind() != hcons_kind())
return false;
return m_sort == static_cast<psort_sort const *>(other)->m_sort;
}
virtual void display(std::ostream & out) const {
void display(std::ostream & out) const override {
out << m_sort->get_name();
}
};
@ -163,19 +163,19 @@ class psort_var : public psort {
friend class pdecl_manager;
unsigned m_idx;
psort_var(unsigned id, unsigned num_params, unsigned idx):psort(id, num_params), m_idx(idx) { SASSERT(idx < num_params); }
virtual sort * instantiate(pdecl_manager & m, sort * const * s) { return s[m_idx]; }
virtual size_t obj_size() const { return sizeof(psort_var); }
sort * instantiate(pdecl_manager & m, sort * const * s) override { return s[m_idx]; }
size_t obj_size() const override { return sizeof(psort_var); }
public:
virtual ~psort_var() {}
virtual char const * hcons_kind() const { return "psort_var"; }
virtual unsigned hcons_hash() const { return hash_u_u(m_num_params, m_idx); }
virtual bool hcons_eq(psort const * other) const {
~psort_var() override {}
char const * hcons_kind() const override { return "psort_var"; }
unsigned hcons_hash() const override { return hash_u_u(m_num_params, m_idx); }
bool hcons_eq(psort const * other) const override {
return
other->hcons_kind() == hcons_kind() &&
get_num_params() == other->get_num_params() &&
m_idx == static_cast<psort_var const *>(other)->m_idx;
}
virtual void display(std::ostream & out) const {
void display(std::ostream & out) const override {
out << "s_" << m_idx;
}
unsigned idx() const { return m_idx; }
@ -196,13 +196,13 @@ class psort_app : public psort {
DEBUG_CODE(if (num_args == num_params) { for (unsigned i = 0; i < num_params; i++) args[i]->check_num_params(this); });
}
virtual void finalize(pdecl_manager & m) {
void finalize(pdecl_manager & m) override {
m.lazy_dec_ref(m_decl);
m.lazy_dec_ref(m_args.size(), m_args.c_ptr());
psort::finalize(m);
}
virtual size_t obj_size() const { return sizeof(psort_app); }
size_t obj_size() const override { return sizeof(psort_app); }
struct khasher {
unsigned operator()(psort_app const * d) const { return d->m_decl->hash(); }
@ -212,7 +212,7 @@ class psort_app : public psort {
unsigned operator()(psort_app const * d, unsigned idx) const { return d->m_args[idx]->hash(); }
};
virtual sort * instantiate(pdecl_manager & m, sort * const * s) {
sort * instantiate(pdecl_manager & m, sort * const * s) override {
sort * r = find(s);
if (r)
return r;
@ -228,12 +228,12 @@ class psort_app : public psort {
}
public:
virtual ~psort_app() {}
virtual char const * hcons_kind() const { return "psort_app"; }
virtual unsigned hcons_hash() const {
~psort_app() override {}
char const * hcons_kind() const override { return "psort_app"; }
unsigned hcons_hash() const override {
return get_composite_hash<psort_app*, khasher, chasher>(const_cast<psort_app*>(this), m_args.size());
}
virtual bool hcons_eq(psort const * other) const {
bool hcons_eq(psort const * other) const override {
if (other->hcons_kind() != hcons_kind())
return false;
if (get_num_params() != other->get_num_params())
@ -249,7 +249,7 @@ public:
}
return true;
}
virtual void display(std::ostream & out) const {
void display(std::ostream & out) const override {
if (m_args.empty()) {
out << m_decl->get_name();
}
@ -752,16 +752,16 @@ struct pdecl_manager::app_sort_info : public pdecl_manager::sort_info {
m.m().inc_array_ref(n, s);
}
virtual ~app_sort_info() {}
~app_sort_info() override {}
virtual unsigned obj_size() const { return sizeof(app_sort_info); }
unsigned obj_size() const override { return sizeof(app_sort_info); }
virtual void finalize(pdecl_manager & m) {
void finalize(pdecl_manager & m) override {
sort_info::finalize(m);
m.m().dec_array_ref(m_args.size(), m_args.c_ptr());
}
virtual void display(std::ostream & out, pdecl_manager const & m) const {
void display(std::ostream & out, pdecl_manager const & m) const override {
if (m_args.empty()) {
out << m_decl->get_name();
}
@ -775,7 +775,7 @@ struct pdecl_manager::app_sort_info : public pdecl_manager::sort_info {
}
}
virtual format * pp(pdecl_manager const & m) const {
format * pp(pdecl_manager const & m) const override {
if (m_args.empty()) {
return mk_string(m.m(), m_decl->get_name().str().c_str());
}
@ -796,11 +796,11 @@ struct pdecl_manager::indexed_sort_info : public pdecl_manager::sort_info {
m_indices(n, s) {
}
virtual ~indexed_sort_info() {}
~indexed_sort_info() override {}
virtual unsigned obj_size() const { return sizeof(indexed_sort_info); }
unsigned obj_size() const override { return sizeof(indexed_sort_info); }
virtual void display(std::ostream & out, pdecl_manager const & m) const {
void display(std::ostream & out, pdecl_manager const & m) const override {
if (m_indices.empty()) {
out << m_decl->get_name();
}
@ -813,7 +813,7 @@ struct pdecl_manager::indexed_sort_info : public pdecl_manager::sort_info {
}
}
virtual format * pp(pdecl_manager const & m) const {
format * pp(pdecl_manager const & m) const override {
if (m_indices.empty()) {
return mk_string(m.m(), m_decl->get_name().str().c_str());
}

View file

@ -65,9 +65,9 @@ protected:
psort_inst_cache * m_inst_cache;
friend class pdecl_manager;
psort(unsigned id, unsigned num_params):pdecl(id, num_params), m_inst_cache(0) {}
virtual bool is_psort() const { return true; }
virtual void finalize(pdecl_manager & m);
virtual ~psort() {}
bool is_psort() const override { return true; }
void finalize(pdecl_manager & m) override;
~psort() override {}
virtual void cache(pdecl_manager & m, sort * const * s, sort * r);
virtual sort * find(sort * const * s) const;
public:
@ -77,7 +77,7 @@ public:
virtual char const * hcons_kind() const = 0;
virtual unsigned hcons_hash() const = 0;
virtual bool hcons_eq(psort const * other) const = 0;
virtual void reset_cache(pdecl_manager& m);
void reset_cache(pdecl_manager& m) override;
};
// for hash consing
@ -98,8 +98,8 @@ protected:
void cache(pdecl_manager & m, sort * const * s, sort * r);
sort * find(sort * const * s);
psort_decl(unsigned id, unsigned num_params, pdecl_manager & m, symbol const & n);
virtual void finalize(pdecl_manager & m);
virtual ~psort_decl() {}
void finalize(pdecl_manager & m) override;
~psort_decl() override {}
public:
virtual sort * instantiate(pdecl_manager & m, unsigned n, sort * const * s) = 0;
virtual sort * instantiate(pdecl_manager & m, unsigned n, unsigned const * s) { return 0; }
@ -108,7 +108,7 @@ public:
// Only builtin declarations can have a variable number of parameters.
bool has_var_params() const { return m_num_params == PSORT_DECL_VAR_PARAMS; }
symbol const & get_name() const { return m_name; }
virtual void reset_cache(pdecl_manager& m);
void reset_cache(pdecl_manager& m) override;
bool is_user_decl() const { return m_psort_kind == PSORT_USER; }
bool is_builtin_decl() const { return m_psort_kind == PSORT_BUILTIN; }
bool is_dt_decl() const { return m_psort_kind == PSORT_DT; }
@ -119,12 +119,12 @@ protected:
friend class pdecl_manager;
psort * m_def;
psort_user_decl(unsigned id, unsigned num_params, pdecl_manager & m, symbol const & n, psort * p);
virtual size_t obj_size() const { return sizeof(psort_user_decl); }
virtual void finalize(pdecl_manager & m);
virtual ~psort_user_decl() {}
size_t obj_size() const override { return sizeof(psort_user_decl); }
void finalize(pdecl_manager & m) override;
~psort_user_decl() override {}
public:
virtual sort * instantiate(pdecl_manager & m, unsigned n, sort * const * s);
virtual void display(std::ostream & out) const;
sort * instantiate(pdecl_manager & m, unsigned n, sort * const * s) override;
void display(std::ostream & out) const override;
};
class psort_builtin_decl : public psort_decl {
@ -133,23 +133,23 @@ protected:
family_id m_fid;
decl_kind m_kind;
psort_builtin_decl(unsigned id, pdecl_manager & m, symbol const & n, family_id fid, decl_kind k);
virtual size_t obj_size() const { return sizeof(psort_builtin_decl); }
virtual ~psort_builtin_decl() {}
size_t obj_size() const override { return sizeof(psort_builtin_decl); }
~psort_builtin_decl() override {}
public:
virtual sort * instantiate(pdecl_manager & m, unsigned n, sort * const * s);
virtual sort * instantiate(pdecl_manager & m, unsigned n, unsigned const * s);
virtual void display(std::ostream & out) const;
sort * instantiate(pdecl_manager & m, unsigned n, sort * const * s) override;
sort * instantiate(pdecl_manager & m, unsigned n, unsigned const * s) override;
void display(std::ostream & out) const override;
};
class psort_dt_decl : public psort_decl {
protected:
friend class pdecl_manager;
psort_dt_decl(unsigned id, unsigned num_params, pdecl_manager & m, symbol const & n);
virtual size_t obj_size() const { return sizeof(psort_dt_decl); }
virtual ~psort_dt_decl() {}
size_t obj_size() const override { return sizeof(psort_dt_decl); }
~psort_dt_decl() override {}
public:
virtual sort * instantiate(pdecl_manager & m, unsigned n, sort * const * s);
virtual void display(std::ostream & out) const;
sort * instantiate(pdecl_manager & m, unsigned n, sort * const * s) override;
void display(std::ostream & out) const override;
};
@ -190,16 +190,16 @@ class paccessor_decl : public pdecl {
symbol m_name;
ptype m_type;
paccessor_decl(unsigned id, unsigned num_params, pdecl_manager & m, symbol const & n, ptype const & r);
virtual void finalize(pdecl_manager & m);
virtual size_t obj_size() const { return sizeof(paccessor_decl); }
void finalize(pdecl_manager & m) override;
size_t obj_size() const override { return sizeof(paccessor_decl); }
bool has_missing_refs(symbol & missing) const;
bool fix_missing_refs(dictionary<int> const & symbol2idx, symbol & missing);
accessor_decl * instantiate_decl(pdecl_manager & m, sort * const * s);
symbol const & get_name() const { return m_name; }
ptype const & get_type() const { return m_type; }
virtual ~paccessor_decl() {}
~paccessor_decl() override {}
public:
virtual void display(std::ostream & out) const { pdecl::display(out); }
void display(std::ostream & out) const override { pdecl::display(out); }
void display(std::ostream & out, pdatatype_decl const * const * dts) const;
};
@ -211,16 +211,16 @@ class pconstructor_decl : public pdecl {
ptr_vector<paccessor_decl> m_accessors;
pconstructor_decl(unsigned id, unsigned num_params, pdecl_manager & m,
symbol const & n, symbol const & r, unsigned num_accessors, paccessor_decl * const * accessors);
virtual void finalize(pdecl_manager & m);
virtual size_t obj_size() const { return sizeof(pconstructor_decl); }
void finalize(pdecl_manager & m) override;
size_t obj_size() const override { return sizeof(pconstructor_decl); }
bool has_missing_refs(symbol & missing) const;
bool fix_missing_refs(dictionary<int> const & symbol2idx, symbol & missing);
symbol const & get_name() const { return m_name; }
symbol const & get_recognizer_name() const { return m_recogniser_name; }
constructor_decl * instantiate_decl(pdecl_manager & m, sort * const * s);
virtual ~pconstructor_decl() {}
~pconstructor_decl() override {}
public:
virtual void display(std::ostream & out) const { pdecl::display(out); }
void display(std::ostream & out) const override { pdecl::display(out); }
void display(std::ostream & out, pdatatype_decl const * const * dts) const;
};
@ -231,14 +231,14 @@ class pdatatype_decl : public psort_decl {
pdatatypes_decl * m_parent;
pdatatype_decl(unsigned id, unsigned num_params, pdecl_manager & m, symbol const & n,
unsigned num_constructors, pconstructor_decl * const * constructors);
virtual void finalize(pdecl_manager & m);
virtual size_t obj_size() const { return sizeof(pdatatype_decl); }
void finalize(pdecl_manager & m) override;
size_t obj_size() const override { return sizeof(pdatatype_decl); }
bool fix_missing_refs(dictionary<int> const & symbol2idx, symbol & missing);
datatype_decl * instantiate_decl(pdecl_manager & m, sort * const * s);
virtual ~pdatatype_decl() {}
~pdatatype_decl() override {}
public:
sort * instantiate(pdecl_manager & m, unsigned n, sort * const * s);
virtual void display(std::ostream & out) const;
sort * instantiate(pdecl_manager & m, unsigned n, sort * const * s) override;
void display(std::ostream & out) const override;
bool has_missing_refs(symbol & missing) const;
bool has_duplicate_accessors(symbol & repeated) const;
bool commit(pdecl_manager& m);
@ -252,11 +252,11 @@ class pdatatypes_decl : public pdecl {
friend class pdatatype_decl;
ptr_vector<pdatatype_decl> m_datatypes;
pdatatypes_decl(unsigned id, unsigned num_params, pdecl_manager & m, unsigned num_datatypes, pdatatype_decl * const * dts);
virtual void finalize(pdecl_manager & m);
virtual size_t obj_size() const { return sizeof(pdatatypes_decl); }
void finalize(pdecl_manager & m) override;
size_t obj_size() const override { return sizeof(pdatatypes_decl); }
bool fix_missing_refs(symbol & missing);
bool instantiate(pdecl_manager & m, sort * const * s);
virtual ~pdatatypes_decl() {}
~pdatatypes_decl() override {}
public:
pdatatype_decl const * const * children() const { return m_datatypes.c_ptr(); }
pdatatype_decl * const * begin() const { return m_datatypes.begin(); }

View file

@ -36,7 +36,7 @@ class simplify_cmd : public parametric_cmd {
public:
th_solver(cmd_context& ctx): m_ctx(ctx) {}
virtual lbool check_sat(expr* e) {
lbool check_sat(expr* e) override {
if (!m_solver) {
m_solver = m_ctx.get_solver_factory()(m_ctx.m(), m_params, false, true, false, symbol::null);
}
@ -52,13 +52,13 @@ class simplify_cmd : public parametric_cmd {
public:
simplify_cmd(char const * name = "simplify"):parametric_cmd(name) {}
virtual char const * get_usage() const { return "<term> (<keyword> <value>)*"; }
char const * get_usage() const override { return "<term> (<keyword> <value>)*"; }
virtual char const * get_main_descr() const {
char const * get_main_descr() const override {
return "simplify the given term using builtin theory simplification rules.";
}
virtual void init_pdescrs(cmd_context & ctx, param_descrs & p) {
void init_pdescrs(cmd_context & ctx, param_descrs & p) override {
th_rewriter::get_param_descrs(p);
insert_timeout(p);
p.insert("print", CPK_BOOL, "(default: true) print the simplified term.");
@ -66,24 +66,24 @@ public:
p.insert("print_statistics", CPK_BOOL, "(default: false) print statistics.");
}
virtual ~simplify_cmd() {
~simplify_cmd() override {
}
virtual void prepare(cmd_context & ctx) {
void prepare(cmd_context & ctx) override {
parametric_cmd::prepare(ctx);
m_target = 0;
}
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_EXPR;
return parametric_cmd::next_arg_kind(ctx);
}
virtual void set_next_arg(cmd_context & ctx, expr * arg) {
void set_next_arg(cmd_context & ctx, expr * arg) override {
m_target = arg;
}
virtual void execute(cmd_context & ctx) {
void execute(cmd_context & ctx) override {
if (m_target == 0)
throw cmd_exception("invalid simplify command, argument expected");
expr_ref r(ctx.m());

View file

@ -58,17 +58,17 @@ public:
m_decl(0) {
}
virtual char const * get_usage() const { return "<symbol> <tactic>"; }
virtual char const * get_descr(cmd_context & ctx) const { return "declare a new tactic, use (help-tactic) for the tactic language syntax."; }
virtual unsigned get_arity() const { return 2; }
virtual void prepare(cmd_context & ctx) { m_name = symbol::null; m_decl = 0; }
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const {
char const * get_usage() const override { return "<symbol> <tactic>"; }
char const * get_descr(cmd_context & ctx) const override { return "declare a new tactic, use (help-tactic) for the tactic language syntax."; }
unsigned get_arity() const override { return 2; }
void prepare(cmd_context & ctx) override { m_name = symbol::null; m_decl = 0; }
cmd_arg_kind next_arg_kind(cmd_context & ctx) const override {
if (m_name == symbol::null) return CPK_SYMBOL;
return CPK_SEXPR;
}
virtual void set_next_arg(cmd_context & ctx, symbol const & s) { m_name = s; }
virtual void set_next_arg(cmd_context & ctx, sexpr * n) { m_decl = n; }
virtual void execute(cmd_context & ctx) {
void set_next_arg(cmd_context & ctx, symbol const & s) override { m_name = s; }
void set_next_arg(cmd_context & ctx, sexpr * n) override { m_decl = n; }
void execute(cmd_context & ctx) override {
tactic_ref t = sexpr2tactic(ctx, m_decl); // make sure the tactic is well formed.
ctx.insert_user_tactic(m_name, m_decl);
}
@ -133,23 +133,23 @@ public:
parametric_cmd(name) {
}
virtual char const * get_usage() const { return "<tactic> (<keyword> <value>)*"; }
char const * get_usage() const override { return "<tactic> (<keyword> <value>)*"; }
virtual void prepare(cmd_context & ctx) {
void prepare(cmd_context & ctx) override {
parametric_cmd::prepare(ctx);
m_tactic = 0;
}
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const {
cmd_arg_kind next_arg_kind(cmd_context & ctx) const override {
if (m_tactic == 0) return CPK_SEXPR;
return parametric_cmd::next_arg_kind(ctx);
}
virtual void set_next_arg(cmd_context & ctx, sexpr * arg) {
void set_next_arg(cmd_context & ctx, sexpr * arg) override {
m_tactic = arg;
}
virtual void init_pdescrs(cmd_context & ctx, param_descrs & p) {
void init_pdescrs(cmd_context & ctx, param_descrs & p) override {
insert_timeout(p);
insert_max_memory(p);
p.insert("print_statistics", CPK_BOOL, "(default: false) print statistics.");
@ -172,7 +172,7 @@ public:
check_sat_tactic_result(ast_manager & m) : simple_check_sat_result(m) {
}
virtual void get_labels(svector<symbol> & r) {
void get_labels(svector<symbol> & r) override {
r.append(labels);
}
@ -187,16 +187,16 @@ public:
exec_given_tactic_cmd("check-sat-using") {
}
virtual char const * get_main_descr() const { return "check if the current context is satisfiable using the given tactic, use (help-tactic) for the tactic language syntax."; }
char const * get_main_descr() const override { return "check if the current context is satisfiable using the given tactic, use (help-tactic) for the tactic language syntax."; }
virtual void init_pdescrs(cmd_context & ctx, param_descrs & p) {
void init_pdescrs(cmd_context & ctx, param_descrs & p) override {
exec_given_tactic_cmd::init_pdescrs(ctx, p);
p.insert("print_unsat_core", CPK_BOOL, "(default: false) print unsatisfiable core.");
p.insert("print_proof", CPK_BOOL, "(default: false) print proof.");
p.insert("print_model", CPK_BOOL, "(default: false) print model.");
}
virtual void execute(cmd_context & ctx) {
void execute(cmd_context & ctx) override {
if (!m_tactic) {
throw cmd_exception("check-sat-using needs a tactic argument");
}
@ -295,9 +295,9 @@ public:
exec_given_tactic_cmd("apply") {
}
virtual char const * get_main_descr() const { return "apply the given tactic to the current context, and print the resultant set of goals."; }
char const * get_main_descr() const override { return "apply the given tactic to the current context, and print the resultant set of goals."; }
virtual void init_pdescrs(cmd_context & ctx, param_descrs & p) {
void init_pdescrs(cmd_context & ctx, param_descrs & p) override {
p.insert("print", CPK_BOOL, "(default: true) print resultant goals.");
#ifndef _EXTERNAL_RELEASE
p.insert("print_proof", CPK_BOOL, "(default: false) print proof associated with each assertion.");
@ -308,7 +308,7 @@ public:
exec_given_tactic_cmd::init_pdescrs(ctx, p);
}
virtual void execute(cmd_context & ctx) {
void execute(cmd_context & ctx) override {
if (!m_tactic) {
throw cmd_exception("apply needs a tactic argument");
}