From 7167fda1dc839b6caa558fe08269988b258b7e93 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Sat, 10 Feb 2018 09:15:12 +0700 Subject: [PATCH] Use override rather than virtual. --- .../ackermannize_bv_tactic.cpp | 18 +- src/ackermannization/ackr_bound_probe.cpp | 2 +- src/ackermannization/ackr_model_converter.cpp | 8 +- .../lackr_model_converter_lazy.cpp | 8 +- src/api/api_algebraic.cpp | 6 +- src/api/api_ast_map.h | 2 +- src/api/api_ast_vector.h | 2 +- src/api/api_datalog.cpp | 8 +- src/api/api_datalog.h | 2 +- src/api/api_goal.h | 2 +- src/api/api_model.h | 6 +- src/api/api_opt.cpp | 2 +- src/api/api_solver.h | 2 +- src/api/api_stats.h | 2 +- src/api/api_tactic.h | 6 +- src/api/api_util.h | 4 +- src/ast/ast_trail.h | 2 +- src/interp/iz3proof_itp.cpp | 38 ++--- src/interp/iz3translate.cpp | 4 +- src/interp/iz3translate_direct.cpp | 4 +- src/math/hilbert/heap_trie.h | 16 +- src/math/hilbert/hilbert_basis.cpp | 2 +- src/math/polynomial/algebraic_numbers.cpp | 30 ++-- src/math/polynomial/polynomial.cpp | 12 +- .../upolynomial_factorization_int.h | 2 +- src/math/realclosure/realclosure.cpp | 4 +- src/math/subpaving/subpaving.cpp | 64 +++---- src/math/subpaving/subpaving_t_def.h | 6 +- .../subpaving/tactic/subpaving_tactic.cpp | 26 +-- src/muz/base/dl_context.cpp | 16 +- src/muz/base/dl_context.h | 6 +- src/muz/base/dl_util.cpp | 6 +- src/muz/bmc/dl_bmc_engine.h | 14 +- src/muz/clp/clp_context.h | 12 +- src/muz/ddnf/ddnf.h | 12 +- src/muz/duality/duality_dl_interface.h | 28 +-- src/muz/fp/datalog_parser.cpp | 8 +- src/muz/fp/dl_cmds.cpp | 84 ++++----- src/muz/fp/dl_register_engine.h | 4 +- src/muz/fp/horn_tactic.cpp | 24 +-- src/muz/pdr/pdr_dl_interface.h | 24 +-- src/muz/pdr/pdr_generalizers.h | 30 ++-- src/muz/pdr/pdr_smt_context_manager.h | 18 +- src/muz/rel/check_relation.cpp | 36 ++-- src/muz/rel/check_relation.h | 76 ++++----- src/muz/rel/dl_base.cpp | 6 +- src/muz/rel/dl_base.h | 34 ++-- src/muz/rel/dl_bound_relation.cpp | 20 +-- src/muz/rel/dl_bound_relation.h | 76 ++++----- src/muz/rel/dl_check_table.cpp | 22 +-- src/muz/rel/dl_check_table.h | 74 ++++---- src/muz/rel/dl_compiler.h | 2 +- src/muz/rel/dl_external_relation.cpp | 14 +- src/muz/rel/dl_external_relation.h | 58 +++---- src/muz/rel/dl_finite_product_relation.cpp | 36 ++-- src/muz/rel/dl_finite_product_relation.h | 72 ++++---- src/muz/rel/dl_instruction.cpp | 114 ++++++------- src/muz/rel/dl_interval_relation.cpp | 14 +- src/muz/rel/dl_interval_relation.h | 64 +++---- src/muz/rel/dl_lazy_table.cpp | 16 +- src/muz/rel/dl_lazy_table.h | 122 ++++++------- src/muz/rel/dl_mk_explanations.cpp | 70 ++++---- src/muz/rel/dl_mk_explanations.h | 2 +- src/muz/rel/dl_mk_similarity_compressor.h | 2 +- src/muz/rel/dl_mk_simple_joins.h | 2 +- src/muz/rel/dl_product_relation.cpp | 24 +-- src/muz/rel/dl_product_relation.h | 62 +++---- src/muz/rel/dl_relation_manager.cpp | 68 ++++---- src/muz/rel/dl_sieve_relation.cpp | 10 +- src/muz/rel/dl_sieve_relation.h | 64 +++---- src/muz/rel/dl_sparse_table.cpp | 30 ++-- src/muz/rel/dl_sparse_table.h | 78 ++++----- src/muz/rel/dl_table.cpp | 20 +-- src/muz/rel/dl_table.h | 36 ++-- src/muz/rel/dl_table_relation.cpp | 12 +- src/muz/rel/dl_table_relation.h | 80 ++++----- src/muz/rel/dl_vector_relation.h | 8 +- src/muz/rel/karr_relation.cpp | 30 ++-- src/muz/rel/karr_relation.h | 34 ++-- src/muz/rel/rel_context.h | 58 +++---- src/muz/rel/udoc_relation.cpp | 28 +-- src/muz/rel/udoc_relation.h | 82 ++++----- src/muz/spacer/spacer_dl_interface.h | 34 ++-- src/muz/spacer/spacer_generalizers.h | 28 +-- src/muz/spacer/spacer_itp_solver.h | 52 +++--- src/muz/spacer/spacer_qe_project.cpp | 4 +- src/muz/spacer/spacer_unsat_core_plugin.h | 14 +- src/muz/spacer/spacer_virtual_solver.h | 40 ++--- src/muz/tab/tab_context.h | 14 +- src/muz/transforms/dl_mk_array_blast.h | 4 +- src/muz/transforms/dl_mk_array_eq_rewrite.h | 4 +- .../transforms/dl_mk_array_instantiation.h | 4 +- src/muz/transforms/dl_mk_backwards.h | 4 +- src/muz/transforms/dl_mk_bit_blast.cpp | 4 +- src/muz/transforms/dl_mk_bit_blast.h | 4 +- src/muz/transforms/dl_mk_coalesce.h | 2 +- src/muz/transforms/dl_mk_coi_filter.h | 2 +- src/muz/transforms/dl_mk_filter_rules.h | 4 +- .../transforms/dl_mk_interp_tail_simplifier.h | 4 +- src/muz/transforms/dl_mk_karr_invariants.cpp | 6 +- src/muz/transforms/dl_mk_karr_invariants.h | 4 +- src/muz/transforms/dl_mk_loop_counter.h | 4 +- src/muz/transforms/dl_mk_magic_sets.h | 2 +- src/muz/transforms/dl_mk_magic_symbolic.h | 4 +- .../dl_mk_quantifier_abstraction.cpp | 6 +- .../transforms/dl_mk_quantifier_abstraction.h | 4 +- .../dl_mk_quantifier_instantiation.h | 4 +- src/muz/transforms/dl_mk_rule_inliner.h | 6 +- src/muz/transforms/dl_mk_scale.cpp | 6 +- src/muz/transforms/dl_mk_scale.h | 4 +- .../transforms/dl_mk_separate_negated_tails.h | 2 +- src/muz/transforms/dl_mk_slice.cpp | 8 +- src/muz/transforms/dl_mk_slice.h | 4 +- .../transforms/dl_mk_subsumption_checker.h | 4 +- src/muz/transforms/dl_mk_unbound_compressor.h | 2 +- src/muz/transforms/dl_mk_unfold.h | 2 +- src/opt/maxsmt.h | 14 +- src/opt/opt_context.h | 70 ++++---- src/opt/opt_pareto.h | 8 +- src/opt/opt_solver.h | 42 ++--- src/parsers/util/cost_parser.h | 6 +- src/qe/nlarith_util.cpp | 34 ++-- src/qe/nlqsat.cpp | 22 +-- src/qe/qe.cpp | 42 ++--- src/qe/qe.h | 4 +- src/qe/qe_arith.h | 10 +- src/qe/qe_arith_plugin.cpp | 38 ++--- src/qe/qe_array_plugin.cpp | 12 +- src/qe/qe_arrays.h | 8 +- src/qe/qe_bool_plugin.cpp | 14 +- src/qe/qe_bv_plugin.cpp | 14 +- src/qe/qe_cmd.cpp | 16 +- src/qe/qe_datatype_plugin.cpp | 18 +- src/qe/qe_datatypes.h | 8 +- src/qe/qe_dl_plugin.cpp | 10 +- src/qe/qe_lite.cpp | 18 +- src/qe/qe_sat_tactic.cpp | 57 +++---- src/qe/qe_tactic.cpp | 24 +-- src/qe/qe_vartest.h | 2 +- src/qe/qsat.cpp | 22 +-- src/sat/sat_solver/inc_sat_solver.cpp | 52 +++--- src/sat/tactic/goal2sat.cpp | 6 +- src/sat/tactic/sat_tactic.cpp | 28 +-- src/shell/lp_frontend.cpp | 2 +- src/smt/arith_eq_adapter.cpp | 6 +- src/smt/asserted_formulas.h | 52 +++--- src/smt/dyn_ack.cpp | 12 +- src/smt/mam.cpp | 30 ++-- src/smt/proto_model/array_factory.h | 8 +- src/smt/proto_model/datatype_factory.h | 6 +- src/smt/proto_model/numeral_factory.h | 10 +- src/smt/proto_model/proto_model.h | 10 +- src/smt/proto_model/struct_factory.h | 6 +- src/smt/proto_model/value_factory.h | 30 ++-- src/smt/smt2_extra_cmds.cpp | 20 +-- src/smt/smt_case_split_queue.cpp | 160 +++++++++--------- src/smt/smt_context.cpp | 8 +- src/smt/smt_context.h | 4 +- src/smt/smt_for_each_relevant_expr.h | 8 +- src/smt/smt_internalizer.cpp | 8 +- src/smt/smt_justification.h | 110 ++++++------ src/smt/smt_model_finder.cpp | 100 +++++------ src/smt/smt_model_generator.h | 8 +- src/smt/smt_quantifier.cpp | 42 ++--- src/smt/smt_relevancy.cpp | 40 ++--- src/smt/smt_relevancy.h | 8 +- src/smt/smt_solver.cpp | 46 ++--- src/smt/tactic/ctx_solver_simplify_tactic.cpp | 25 ++- src/smt/tactic/smt_tactic.cpp | 28 +-- src/smt/tactic/unit_subsumption_tactic.cpp | 16 +- src/smt/theory_arith.h | 104 ++++++------ src/smt/theory_arith_int.h | 2 +- src/smt/theory_array.h | 36 ++-- src/smt/theory_array_base.cpp | 6 +- src/smt/theory_array_base.h | 20 +-- src/smt/theory_array_full.h | 36 ++-- src/smt/theory_bv.cpp | 20 +-- src/smt/theory_bv.h | 50 +++--- src/smt/theory_datatype.cpp | 8 +- src/smt/theory_datatype.h | 46 ++--- src/smt/theory_dense_diff_logic.h | 62 +++---- src/smt/theory_diff_logic.h | 64 +++---- src/smt/theory_dl.cpp | 28 +-- src/smt/theory_dummy.h | 24 +-- src/smt/theory_fpa.cpp | 4 +- src/smt/theory_fpa.h | 64 +++---- src/smt/theory_lra.cpp | 6 +- src/smt/theory_lra.h | 62 +++---- src/smt/theory_pb.cpp | 22 +-- src/smt/theory_pb.h | 40 ++--- src/smt/theory_seq.cpp | 8 +- src/smt/theory_seq.h | 64 +++---- src/smt/theory_seq_empty.h | 26 +-- src/smt/theory_str.h | 60 +++---- src/smt/theory_utvpi.h | 58 +++---- src/smt/theory_wmaxsat.h | 38 ++--- src/test/ex.cpp | 4 +- src/util/checked_int64.h | 2 +- src/util/lp/eta_matrix.h | 10 +- src/util/lp/iterator_on_column.h | 10 +- src/util/lp/iterator_on_indexed_vector.h | 10 +- src/util/lp/iterator_on_pivot_row.h | 10 +- src/util/lp/iterator_on_row.h | 10 +- src/util/lp/iterator_on_term_with_basis_var.h | 10 +- src/util/lp/lar_constraints.h | 14 +- src/util/lp/lar_solver.h | 2 +- src/util/lp/lp_dual_core_solver.h | 2 +- src/util/lp/lp_dual_simplex.h | 8 +- src/util/lp/lp_primal_core_solver.h | 2 +- src/util/lp/lp_primal_simplex.h | 8 +- src/util/lp/lp_settings.h | 2 +- src/util/lp/lu.h | 10 +- src/util/lp/permutation_matrix.h | 10 +- src/util/lp/row_eta_matrix.h | 10 +- src/util/lp/square_dense_submatrix.h | 10 +- src/util/mpff.h | 6 +- src/util/mpfx.h | 6 +- src/util/timeout.cpp | 2 +- src/util/trail.h | 42 ++--- src/util/union_find.h | 8 +- 220 files changed, 2546 insertions(+), 2548 deletions(-) diff --git a/src/ackermannization/ackermannize_bv_tactic.cpp b/src/ackermannization/ackermannize_bv_tactic.cpp index 82ef19274..5d749b7d5 100644 --- a/src/ackermannization/ackermannize_bv_tactic.cpp +++ b/src/ackermannization/ackermannize_bv_tactic.cpp @@ -27,13 +27,13 @@ public: : m(m), m_p(p) {} - virtual ~ackermannize_bv_tactic() { } + ~ackermannize_bv_tactic() override { } - virtual void operator()(goal_ref const & g, + void operator()(goal_ref const & g, goal_ref_buffer & result, model_converter_ref & mc, proof_converter_ref & pc, - expr_dependency_ref & core) { + expr_dependency_ref & core) override { mc = 0; tactic_report report("ackermannize", *g); fail_if_unsat_core_generation("ackermannize", g); @@ -69,24 +69,24 @@ public: } - void updt_params(params_ref const & _p) { + void updt_params(params_ref const & _p) override { ackermannize_bv_tactic_params p(_p); m_lemma_limit = p.div0_ackermann_limit(); } - virtual void collect_param_descrs(param_descrs & r) { + void collect_param_descrs(param_descrs & r) override { ackermannize_bv_tactic_params::collect_param_descrs(r); } - virtual void collect_statistics(statistics & st) const { + void collect_statistics(statistics & st) const override { st.update("ackr-constraints", m_st.m_ackrs_sz); } - virtual void reset_statistics() { m_st.reset(); } + void reset_statistics() override { m_st.reset(); } - virtual void cleanup() { } + void cleanup() override { } - virtual tactic* translate(ast_manager& m) { + tactic* translate(ast_manager& m) override { return alloc(ackermannize_bv_tactic, m, m_p); } private: diff --git a/src/ackermannization/ackr_bound_probe.cpp b/src/ackermannization/ackr_bound_probe.cpp index 50b9cc092..f5e072368 100644 --- a/src/ackermannization/ackr_bound_probe.cpp +++ b/src/ackermannization/ackr_bound_probe.cpp @@ -57,7 +57,7 @@ class ackr_bound_probe : public probe { public: ackr_bound_probe() {} - virtual result operator()(goal const & g) { + result operator()(goal const & g) override { proc p(g.m()); unsigned sz = g.size(); expr_fast_mark1 visited; diff --git a/src/ackermannization/ackr_model_converter.cpp b/src/ackermannization/ackr_model_converter.cpp index a7c021913..c8df89bad 100644 --- a/src/ackermannization/ackr_model_converter.cpp +++ b/src/ackermannization/ackr_model_converter.cpp @@ -37,9 +37,9 @@ public: , fixed_model(false) { } - virtual ~ackr_model_converter() { } + ~ackr_model_converter() override { } - virtual void operator()(model_ref & md, unsigned goal_idx) { + void operator()(model_ref & md, unsigned goal_idx) override { SASSERT(goal_idx == 0); SASSERT(!fixed_model || md.get() == 0 || (!md->get_num_constants() && !md->get_num_functions())); model_ref& old_model = fixed_model ? abstr_model : md; @@ -49,9 +49,9 @@ public: md = new_model; } - virtual void operator()(model_ref & md) { operator()(md, 0); } + void operator()(model_ref & md) override { operator()(md, 0); } - virtual model_converter * translate(ast_translation & translator) { + model_converter * translate(ast_translation & translator) override { ackr_info_ref retv_info = info->translate(translator); if (fixed_model) { model_ref retv_mod_ref = abstr_model->translate(translator); diff --git a/src/ackermannization/lackr_model_converter_lazy.cpp b/src/ackermannization/lackr_model_converter_lazy.cpp index 2a7adb839..15673ffb6 100644 --- a/src/ackermannization/lackr_model_converter_lazy.cpp +++ b/src/ackermannization/lackr_model_converter_lazy.cpp @@ -28,9 +28,9 @@ public: , model_constructor(lmc) { } - virtual ~lackr_model_converter_lazy() { } + ~lackr_model_converter_lazy() override { } - virtual void operator()(model_ref & md, unsigned goal_idx) { + void operator()(model_ref & md, unsigned goal_idx) override { SASSERT(goal_idx == 0); SASSERT(md.get() == 0 || (!md->get_num_constants() && !md->get_num_functions())); SASSERT(model_constructor.get()); @@ -39,13 +39,13 @@ public: model_constructor->make_model(md); } - virtual void operator()(model_ref & md) { + void operator()(model_ref & md) override { operator()(md, 0); } //void display(std::ostream & out); - virtual model_converter * translate(ast_translation & translator) { + model_converter * translate(ast_translation & translator) override { NOT_IMPLEMENTED_YET(); } protected: diff --git a/src/api/api_algebraic.cpp b/src/api/api_algebraic.cpp index 96d8392ba..b4eda2c03 100644 --- a/src/api/api_algebraic.cpp +++ b/src/api/api_algebraic.cpp @@ -345,9 +345,9 @@ extern "C" { public: vector_var2anum(scoped_anum_vector & as):m_as(as) {} virtual ~vector_var2anum() {} - virtual algebraic_numbers::manager & m() const { return m_as.m(); } - virtual bool contains(polynomial::var x) const { return static_cast(x) < m_as.size(); } - virtual algebraic_numbers::anum const & operator()(polynomial::var x) const { return m_as.get(x); } + algebraic_numbers::manager & m() const override { return m_as.m(); } + bool contains(polynomial::var x) const override { return static_cast(x) < m_as.size(); } + algebraic_numbers::anum const & operator()(polynomial::var x) const override { return m_as.get(x); } }; Z3_ast_vector Z3_API Z3_algebraic_roots(Z3_context c, Z3_ast p, unsigned n, Z3_ast a[]) { diff --git a/src/api/api_ast_map.h b/src/api/api_ast_map.h index 3dacc54f1..27ad1eb9d 100644 --- a/src/api/api_ast_map.h +++ b/src/api/api_ast_map.h @@ -25,7 +25,7 @@ struct Z3_ast_map_ref : public api::object { ast_manager & m; obj_map m_map; Z3_ast_map_ref(api::context& c, ast_manager & _m): api::object(c), m(_m) {} - virtual ~Z3_ast_map_ref(); + ~Z3_ast_map_ref() override; }; inline Z3_ast_map_ref * to_ast_map(Z3_ast_map v) { return reinterpret_cast(v); } diff --git a/src/api/api_ast_vector.h b/src/api/api_ast_vector.h index ced20481e..d9d3913e7 100644 --- a/src/api/api_ast_vector.h +++ b/src/api/api_ast_vector.h @@ -27,7 +27,7 @@ namespace api { struct Z3_ast_vector_ref : public api::object { ast_ref_vector m_ast_vector; Z3_ast_vector_ref(api::context& c, ast_manager & m): api::object(c), m_ast_vector(m) {} - virtual ~Z3_ast_vector_ref() {} + ~Z3_ast_vector_ref() override {} }; inline Z3_ast_vector_ref * to_ast_vector(Z3_ast_vector v) { return reinterpret_cast(v); } diff --git a/src/api/api_datalog.cpp b/src/api/api_datalog.cpp index 397e2a8af..431638864 100644 --- a/src/api/api_datalog.cpp +++ b/src/api/api_datalog.cpp @@ -51,8 +51,8 @@ namespace api { m_context(m, m_register_engine, p), m_trail(m) {} - virtual ~fixedpoint_context() {} - family_id get_family_id() const { return const_cast(m_context).get_decl_util().get_family_id(); } + ~fixedpoint_context() override {} + family_id get_family_id() const override { return const_cast(m_context).get_decl_util().get_family_id(); } void set_state(void* state) { SASSERT(!m_state); m_state = state; @@ -73,7 +73,7 @@ namespace api { void set_reduce_assign(reduce_assign_callback_fptr f) { m_reduce_assign = f; } - virtual void reduce(func_decl* f, unsigned num_args, expr * const* args, expr_ref& result) { + void reduce(func_decl* f, unsigned num_args, expr * const* args, expr_ref& result) override { expr* r = 0; if (m_reduce_app) { m_reduce_app(m_state, f, num_args, args, &r); @@ -90,7 +90,7 @@ namespace api { result = m.mk_app(f, num_args, args); } } - virtual void reduce_assign(func_decl* f, unsigned num_args, expr * const* args, unsigned num_out, expr* const* outs) { + void reduce_assign(func_decl* f, unsigned num_args, expr * const* args, unsigned num_out, expr* const* outs) override { if (m_reduce_assign) { m_trail.push_back(f); for (unsigned i = 0; i < num_args; ++i) { diff --git a/src/api/api_datalog.h b/src/api/api_datalog.h index c8dbc4180..588ee02d3 100644 --- a/src/api/api_datalog.h +++ b/src/api/api_datalog.h @@ -38,7 +38,7 @@ struct Z3_fixedpoint_ref : public api::object { api::fixedpoint_context * m_datalog; params_ref m_params; Z3_fixedpoint_ref(api::context& c): api::object(c), m_datalog(0) {} - virtual ~Z3_fixedpoint_ref() { dealloc(m_datalog); } + ~Z3_fixedpoint_ref() override { dealloc(m_datalog); } }; inline Z3_fixedpoint_ref * to_fixedpoint(Z3_fixedpoint s) { return reinterpret_cast(s); } diff --git a/src/api/api_goal.h b/src/api/api_goal.h index 4e9729df5..3b109f8da 100644 --- a/src/api/api_goal.h +++ b/src/api/api_goal.h @@ -24,7 +24,7 @@ Revision History: struct Z3_goal_ref : public api::object { goal_ref m_goal; Z3_goal_ref(api::context& c) : api::object(c) {} - virtual ~Z3_goal_ref() {} + ~Z3_goal_ref() override {} }; inline Z3_goal_ref * to_goal(Z3_goal g) { return reinterpret_cast(g); } diff --git a/src/api/api_model.h b/src/api/api_model.h index 64427cfb8..1ab10da79 100644 --- a/src/api/api_model.h +++ b/src/api/api_model.h @@ -24,7 +24,7 @@ Revision History: struct Z3_model_ref : public api::object { model_ref m_model; Z3_model_ref(api::context& c): api::object(c) {} - virtual ~Z3_model_ref() {} + ~Z3_model_ref() override {} }; inline Z3_model_ref * to_model(Z3_model s) { return reinterpret_cast(s); } @@ -35,7 +35,7 @@ struct Z3_func_interp_ref : public api::object { model_ref m_model; // must have it to prevent reference to m_func_interp to be killed. func_interp * m_func_interp; Z3_func_interp_ref(api::context& c, model * m): api::object(c), m_model(m), m_func_interp(0) {} - virtual ~Z3_func_interp_ref() {} + ~Z3_func_interp_ref() override {} }; inline Z3_func_interp_ref * to_func_interp(Z3_func_interp s) { return reinterpret_cast(s); } @@ -47,7 +47,7 @@ struct Z3_func_entry_ref : public api::object { func_interp * m_func_interp; func_entry const * m_func_entry; Z3_func_entry_ref(api::context& c, model * m):api::object(c), m_model(m), m_func_interp(0), m_func_entry(0) {} - virtual ~Z3_func_entry_ref() {} + ~Z3_func_entry_ref() override {} }; inline Z3_func_entry_ref * to_func_entry(Z3_func_entry s) { return reinterpret_cast(s); } diff --git a/src/api/api_opt.cpp b/src/api/api_opt.cpp index 0d96a6719..72180388e 100644 --- a/src/api/api_opt.cpp +++ b/src/api/api_opt.cpp @@ -36,7 +36,7 @@ extern "C" { struct Z3_optimize_ref : public api::object { opt::context* m_opt; Z3_optimize_ref(api::context& c): api::object(c), m_opt(0) {} - virtual ~Z3_optimize_ref() { dealloc(m_opt); } + ~Z3_optimize_ref() override { dealloc(m_opt); } }; inline Z3_optimize_ref * to_optimize(Z3_optimize o) { return reinterpret_cast(o); } inline Z3_optimize of_optimize(Z3_optimize_ref * o) { return reinterpret_cast(o); } diff --git a/src/api/api_solver.h b/src/api/api_solver.h index 4f344a00d..3da702f1e 100644 --- a/src/api/api_solver.h +++ b/src/api/api_solver.h @@ -27,7 +27,7 @@ struct Z3_solver_ref : public api::object { params_ref m_params; symbol m_logic; Z3_solver_ref(api::context& c, solver_factory * f): api::object(c), m_solver_factory(f), m_solver(0), m_logic(symbol::null) {} - virtual ~Z3_solver_ref() {} + ~Z3_solver_ref() override {} }; inline Z3_solver_ref * to_solver(Z3_solver s) { return reinterpret_cast(s); } diff --git a/src/api/api_stats.h b/src/api/api_stats.h index 5ce616084..e5ad5d315 100644 --- a/src/api/api_stats.h +++ b/src/api/api_stats.h @@ -24,7 +24,7 @@ Revision History: struct Z3_stats_ref : public api::object { statistics m_stats; Z3_stats_ref(api::context& c): api::object(c) {} - virtual ~Z3_stats_ref() {} + ~Z3_stats_ref() override {} }; inline Z3_stats_ref * to_stats(Z3_stats s) { return reinterpret_cast(s); } diff --git a/src/api/api_tactic.h b/src/api/api_tactic.h index fd2f05185..cc5e55a4e 100644 --- a/src/api/api_tactic.h +++ b/src/api/api_tactic.h @@ -29,13 +29,13 @@ namespace api { struct Z3_tactic_ref : public api::object { tactic_ref m_tactic; Z3_tactic_ref(api::context& c): api::object(c) {} - virtual ~Z3_tactic_ref() {} + ~Z3_tactic_ref() override {} }; struct Z3_probe_ref : public api::object { probe_ref m_probe; Z3_probe_ref(api::context& c):api::object(c) {} - virtual ~Z3_probe_ref() {} + ~Z3_probe_ref() override {} }; inline Z3_tactic_ref * to_tactic(Z3_tactic g) { return reinterpret_cast(g); } @@ -52,7 +52,7 @@ struct Z3_apply_result_ref : public api::object { proof_converter_ref m_pc; expr_dependency_ref m_core; Z3_apply_result_ref(api::context& c, ast_manager & m); - virtual ~Z3_apply_result_ref() {} + ~Z3_apply_result_ref() override {} }; inline Z3_apply_result_ref * to_apply_result(Z3_apply_result g) { return reinterpret_cast(g); } diff --git a/src/api/api_util.h b/src/api/api_util.h index bc6781c2c..e2e4621d4 100644 --- a/src/api/api_util.h +++ b/src/api/api_util.h @@ -88,7 +88,7 @@ inline lbool to_lbool(Z3_lbool b) { return static_cast(b); } struct Z3_params_ref : public api::object { params_ref m_params; Z3_params_ref(api::context& c): api::object(c) {} - virtual ~Z3_params_ref() {} + ~Z3_params_ref() override {} }; inline Z3_params_ref * to_params(Z3_params p) { return reinterpret_cast(p); } @@ -98,7 +98,7 @@ inline params_ref to_param_ref(Z3_params p) { return p == 0 ? params_ref() : to_ struct Z3_param_descrs_ref : public api::object { param_descrs m_descrs; Z3_param_descrs_ref(api::context& c): api::object(c) {} - virtual ~Z3_param_descrs_ref() {} + ~Z3_param_descrs_ref() override {} }; inline Z3_param_descrs_ref * to_param_descrs(Z3_param_descrs p) { return reinterpret_cast(p); } diff --git a/src/ast/ast_trail.h b/src/ast/ast_trail.h index d5245bd77..78ef74a47 100644 --- a/src/ast/ast_trail.h +++ b/src/ast/ast_trail.h @@ -66,7 +66,7 @@ public: m.insert(s,t); } - virtual void undo(Ctx& ctx) { + void undo(Ctx& ctx) override { m_map.pop(); } }; diff --git a/src/interp/iz3proof_itp.cpp b/src/interp/iz3proof_itp.cpp index 32cb9cccb..bbeb8d072 100755 --- a/src/interp/iz3proof_itp.cpp +++ b/src/interp/iz3proof_itp.cpp @@ -211,7 +211,7 @@ class iz3proof_itp_impl : public iz3proof_itp { pivot literal, while the conclusion of premise2 should contain the pivot literal. */ - node make_resolution(ast pivot, const std::vector &conc, node premise1, node premise2) { + node make_resolution(ast pivot, const std::vector &conc, node premise1, node premise2) override { LitType lt = get_term_type(pivot); if(lt == LitA) return my_or(premise1,premise2); @@ -2146,7 +2146,7 @@ class iz3proof_itp_impl : public iz3proof_itp { } /** Make an assumption node. The given clause is assumed in the given frame. */ - virtual node make_assumption(int frame, const std::vector &assumption){ + node make_assumption(int frame, const std::vector &assumption) override { if(!weak){ if(pv->in_range(frame,rng)){ std::vector itp_clause; @@ -2219,7 +2219,7 @@ class iz3proof_itp_impl : public iz3proof_itp { /** Make a modus-ponens node. This takes derivations of |- x and |- x = y and produces |- y */ - virtual node make_mp(const ast &p_eq_q, const ast &prem1, const ast &prem2){ + node make_mp(const ast &p_eq_q, const ast &prem1, const ast &prem2) override { /* Interpolate the axiom p, p=q -> q */ ast p = arg(p_eq_q,0); @@ -2281,7 +2281,7 @@ class iz3proof_itp_impl : public iz3proof_itp { } /** Make an axiom node. The conclusion must be an instance of an axiom. */ - virtual node make_axiom(const std::vector &conclusion, prover::range frng){ + node make_axiom(const std::vector &conclusion, prover::range frng) override { int nargs = conclusion.size(); std::vector largs(nargs); std::vector eqs; @@ -2306,20 +2306,20 @@ class iz3proof_itp_impl : public iz3proof_itp { return capture_localization(itp); } - virtual node make_axiom(const std::vector &conclusion){ + node make_axiom(const std::vector &conclusion) override { return make_axiom(conclusion,pv->range_full()); } /** Make a Contra node. This rule takes a derivation of the form Gamma |- False and produces |- \/~Gamma. */ - virtual node make_contra(node prem, const std::vector &conclusion){ + node make_contra(node prem, const std::vector &conclusion) override { return prem; } /** Make hypothesis. Creates a node of the form P |- P. */ - virtual node make_hypothesis(const ast &P){ + node make_hypothesis(const ast &P) override { if(is_not(P)) return make_hypothesis(arg(P,0)); switch(get_term_type(P)){ @@ -2354,7 +2354,7 @@ class iz3proof_itp_impl : public iz3proof_itp { /** Make a Reflexivity node. This rule produces |- x = x */ - virtual node make_reflexivity(ast con){ + node make_reflexivity(ast con) override { if(get_term_type(con) == LitA) return mk_false(); if(get_term_type(con) == LitB) @@ -2367,7 +2367,7 @@ class iz3proof_itp_impl : public iz3proof_itp { /** Make a Symmetry node. This takes a derivation of |- x = y and produces | y = x. Ditto for ~(x=y) */ - virtual node make_symmetry(ast con, const ast &premcon, node prem){ + node make_symmetry(ast con, const ast &premcon, node prem) override { #if 0 ast x = arg(con,0); ast y = arg(con,1); @@ -2394,7 +2394,7 @@ class iz3proof_itp_impl : public iz3proof_itp { /** Make a transitivity node. This takes derivations of |- x = y and |- y = z produces | x = z */ - virtual node make_transitivity(const ast &x, const ast &y, const ast &z, node prem1, node prem2){ + node make_transitivity(const ast &x, const ast &y, const ast &z, node prem1, node prem2) override { /* Interpolate the axiom x=y,y=z,-> x=z */ ast p = make_equiv_rel(x,y); @@ -2413,7 +2413,7 @@ class iz3proof_itp_impl : public iz3proof_itp { /** Make a congruence node. This takes derivations of |- x_i = y_i and produces |- f(x_1,...,x_n) = f(y_1,...,y_n) */ - virtual node make_congruence(const ast &p, const ast &con, const ast &prem1){ + node make_congruence(const ast &p, const ast &con, const ast &prem1) override { ast x = arg(p,0), y = arg(p,1); ast itp; LitType con_t = get_term_type(con); @@ -2454,7 +2454,7 @@ class iz3proof_itp_impl : public iz3proof_itp { /** Make a congruence node. This takes derivations of |- x_i1 = y_i1, |- x_i2 = y_i2,... and produces |- f(...x_i1...x_i2...) = f(...y_i1...y_i2...) */ - node make_congruence(const std::vector &p, const ast &con, const std::vector &prems){ + node make_congruence(const std::vector &p, const ast &con, const std::vector &prems) override { if(p.size() == 0) throw proof_error(); if(p.size() == 1) @@ -2516,8 +2516,8 @@ class iz3proof_itp_impl : public iz3proof_itp { /** Make a farkas proof node. */ - virtual node make_farkas(ast con, const std::vector &prems, const std::vector &prem_cons, - const std::vector &coeffs){ + node make_farkas(ast con, const std::vector &prems, const std::vector &prem_cons, + const std::vector &coeffs) override { /* Compute the interpolant for the clause */ @@ -2619,7 +2619,7 @@ class iz3proof_itp_impl : public iz3proof_itp { } /* Make an axiom instance of the form |- x<=y, y<= x -> x =y */ - virtual node make_leq2eq(ast x, ast y, const ast &xleqy, const ast &yleqx){ + node make_leq2eq(ast x, ast y, const ast &xleqy, const ast &yleqx) override { ast con = make(Equal,x,y); ast itp; switch(get_term_type(con)){ @@ -2658,7 +2658,7 @@ class iz3proof_itp_impl : public iz3proof_itp { } /* Make an axiom instance of the form |- x = y -> x <= y */ - virtual node make_eq2leq(ast x, ast y, const ast &xleqy){ + node make_eq2leq(ast x, ast y, const ast &xleqy) override { ast itp; switch(get_term_type(xleqy)){ case LitA: @@ -2681,7 +2681,7 @@ class iz3proof_itp_impl : public iz3proof_itp { /* Make an inference of the form t <= c |- t/d <= floor(c/d) where t is an affine term divisble by d and c is an integer constant */ - virtual node make_cut_rule(const ast &tleqc, const ast &d, const ast &con, const ast &prem){ + node make_cut_rule(const ast &tleqc, const ast &d, const ast &con, const ast &prem) override { ast itp = mk_false(); switch(get_term_type(con)){ case LitA: @@ -2965,7 +2965,7 @@ class iz3proof_itp_impl : public iz3proof_itp { } /* Return an interpolant from a proof of false */ - ast interpolate(const node &pf){ + ast interpolate(const node &pf) override { // proof of false must be a formula, with quantified symbols #ifndef BOGUS_QUANTS return close_universally(add_quants(z3_simplify(pf))); @@ -3089,7 +3089,7 @@ public: m().inc_ref(sexists); } - ~iz3proof_itp_impl(){ + ~iz3proof_itp_impl() override { m().dec_ref(contra); m().dec_ref(sum); m().dec_ref(rotate_sum); diff --git a/src/interp/iz3translate.cpp b/src/interp/iz3translate.cpp index 32b76b224..4196d2016 100755 --- a/src/interp/iz3translate.cpp +++ b/src/interp/iz3translate.cpp @@ -2068,7 +2068,7 @@ public: // We actually compute the interpolant here and then produce a proof consisting of just a lemma - iz3proof::node translate(ast proof, iz3proof &dst){ + iz3proof::node translate(ast proof, iz3proof &dst) override { std::vector itps; scan_skolems(proof); for(int i = 0; i < frames -1; i++){ @@ -2114,7 +2114,7 @@ public: m().inc_ref(commute); } - ~iz3translation_full(){ + ~iz3translation_full() override { m().dec_ref(commute); } }; diff --git a/src/interp/iz3translate_direct.cpp b/src/interp/iz3translate_direct.cpp index e71475e45..0d5b9ccc3 100755 --- a/src/interp/iz3translate_direct.cpp +++ b/src/interp/iz3translate_direct.cpp @@ -1611,7 +1611,7 @@ public: // 1) Translate ast proof term to Zproof // 2) Translate Zproof to Iproof - Iproof::node translate(ast proof, Iproof &dst){ + Iproof::node translate(ast proof, Iproof &dst) override { iproof = &dst; Iproof::node Ipf = translate_main(proof,0); // builds result in dst return Ipf; @@ -1629,7 +1629,7 @@ public: traced_lit = ast(); } - ~iz3translation_direct(){ + ~iz3translation_direct() override { for(hash_map::iterator it = non_local_lits_unique.begin(), en = non_local_lits_unique.end(); diff --git a/src/math/hilbert/heap_trie.h b/src/math/hilbert/heap_trie.h index ace5381b8..e53f9e7dc 100644 --- a/src/math/hilbert/heap_trie.h +++ b/src/math/hilbert/heap_trie.h @@ -81,14 +81,14 @@ class heap_trie { Value m_value; public: leaf(): node(leaf_t) {} - virtual ~leaf() {} + ~leaf() override {} Value const& get_value() const { return m_value; } void set_value(Value const& v) { m_value = v; } - virtual void display(std::ostream& out, unsigned indent) const { + void display(std::ostream& out, unsigned indent) const override { out << " value: " << m_value; } - virtual unsigned num_nodes() const { return 1; } - virtual unsigned num_leaves() const { return this->ref_count()>0?1:0; } + unsigned num_nodes() const override { return 1; } + unsigned num_leaves() const override { return this->ref_count()>0?1:0; } }; typedef buffer, true, 2> children_t; @@ -99,7 +99,7 @@ class heap_trie { public: trie(): node(trie_t) {} - virtual ~trie() { + ~trie() override { } node* find_or_insert(Key k, node* n) { @@ -137,7 +137,7 @@ class heap_trie { children_t const& nodes() const { return m_nodes; } children_t & nodes() { return m_nodes; } - virtual void display(std::ostream& out, unsigned indent) const { + void display(std::ostream& out, unsigned indent) const override { for (unsigned j = 0; j < m_nodes.size(); ++j) { if (j != 0 || indent > 0) { out << "\n"; @@ -151,7 +151,7 @@ class heap_trie { } } - virtual unsigned num_nodes() const { + unsigned num_nodes() const override { unsigned sz = 1; for (unsigned j = 0; j < m_nodes.size(); ++j) { sz += m_nodes[j].second->num_nodes(); @@ -159,7 +159,7 @@ class heap_trie { return sz; } - virtual unsigned num_leaves() const { + unsigned num_leaves() const override { unsigned sz = 0; for (unsigned j = 0; j < m_nodes.size(); ++j) { sz += m_nodes[j].second->num_leaves(); diff --git a/src/math/hilbert/hilbert_basis.cpp b/src/math/hilbert/hilbert_basis.cpp index 9baa0beac..bbc56bdd5 100644 --- a/src/math/hilbert/hilbert_basis.cpp +++ b/src/math/hilbert/hilbert_basis.cpp @@ -175,7 +175,7 @@ class hilbert_basis::value_index2 { hilbert_basis* hb; offset_t m_value; checker(): hb(0) {} - virtual bool operator()(unsigned const& v) { + bool operator()(unsigned const& v) override { if (m_value.m_offset != v) { // && hb->is_subsumed(m_value, offset_t(v))) { return true; } diff --git a/src/math/polynomial/algebraic_numbers.cpp b/src/math/polynomial/algebraic_numbers.cpp index 9484c3c83..8c42bb418 100644 --- a/src/math/polynomial/algebraic_numbers.cpp +++ b/src/math/polynomial/algebraic_numbers.cpp @@ -1932,9 +1932,9 @@ namespace algebraic_numbers { imp & m_imp; polynomial::var2anum const & m_x2v; opt_var2basic(imp & i, polynomial::var2anum const & x2v):m_imp(i), m_x2v(x2v) {} - virtual unsynch_mpq_manager & m() const { return m_imp.qm(); } - virtual bool contains(polynomial::var x) const { return m_x2v.contains(x); } - virtual mpq const & operator()(polynomial::var x) const { + unsynch_mpq_manager & m() const override { return m_imp.qm(); } + bool contains(polynomial::var x) const override { return m_x2v.contains(x); } + mpq const & operator()(polynomial::var x) const override { anum const & v = m_x2v(x); if (!v.is_basic()) throw failed(); @@ -1949,9 +1949,9 @@ namespace algebraic_numbers { imp & m_imp; polynomial::var2anum const & m_x2v; var2basic(imp & i, polynomial::var2anum const & x2v):m_imp(i), m_x2v(x2v) {} - virtual unsynch_mpq_manager & m() const { return m_imp.qm(); } - virtual bool contains(polynomial::var x) const { return m_x2v.contains(x) && m_x2v(x).is_basic(); } - virtual mpq const & operator()(polynomial::var x) const { + unsynch_mpq_manager & m() const override { return m_imp.qm(); } + bool contains(polynomial::var x) const override { return m_x2v.contains(x) && m_x2v(x).is_basic(); } + mpq const & operator()(polynomial::var x) const override { anum const & v = m_x2v(x); SASSERT(v.is_basic()); TRACE("var2basic", tout << "getting value of x" << x << " -> " << m().to_string(m_imp.basic_value(v)) << "\n";); @@ -1966,9 +1966,9 @@ namespace algebraic_numbers { imp & m_imp; polynomial::var2anum const & m_x2v; var2interval(imp & i, polynomial::var2anum const & x2v):m_imp(i), m_x2v(x2v) {} - virtual mpbqi_manager & m() const { return m_imp.bqim(); } - virtual bool contains(polynomial::var x) const { return m_x2v.contains(x) && !m_x2v(x).is_basic(); } - virtual mpbqi const & operator()(polynomial::var x) const { + mpbqi_manager & m() const override { return m_imp.bqim(); } + bool contains(polynomial::var x) const override { return m_x2v.contains(x) && !m_x2v(x).is_basic(); } + mpbqi const & operator()(polynomial::var x) const override { anum const & v = m_x2v(x); SASSERT(!v.is_basic()); return v.to_algebraic()->m_interval; @@ -2220,9 +2220,9 @@ namespace algebraic_numbers { m_x(x), m_v(v) { } - virtual manager & m() const { return m_am; } - virtual bool contains(polynomial::var x) const { return x == m_x || m_x2v.contains(x); } - virtual anum const & operator()(polynomial::var x) const { + manager & m() const override { return m_am; } + bool contains(polynomial::var x) const override { return x == m_x || m_x2v.contains(x); } + anum const & operator()(polynomial::var x) const override { if (x == m_x) return m_v; else @@ -2553,9 +2553,9 @@ namespace algebraic_numbers { m_x2v(x2v), m_v(v) { } - virtual manager & m() const { return m_am; } - virtual bool contains(polynomial::var x) const { return true; } - virtual anum const & operator()(polynomial::var x) const { + manager & m() const override { return m_am; } + bool contains(polynomial::var x) const override { return true; } + anum const & operator()(polynomial::var x) const override { if (m_x2v.contains(x)) return m_x2v(x); else diff --git a/src/math/polynomial/polynomial.cpp b/src/math/polynomial/polynomial.cpp index dcd5af1cc..d6eafac05 100644 --- a/src/math/polynomial/polynomial.cpp +++ b/src/math/polynomial/polynomial.cpp @@ -6350,9 +6350,9 @@ namespace polynomial { m_var_pos(buffer, xs_sz, xs), m_vs(vs) { } - virtual unsynch_mpq_manager & m() const { UNREACHABLE(); static unsynch_mpq_manager m; return m; } - virtual bool contains(var x) const { return m_var_pos(x) != UINT_MAX; } - virtual mpq const & operator()(var x) const { return m_vs[m_var_pos(x)]; } + unsynch_mpq_manager & m() const override { UNREACHABLE(); static unsynch_mpq_manager m; return m; } + bool contains(var x) const override { return m_var_pos(x) != UINT_MAX; } + mpq const & operator()(var x) const override { return m_vs[m_var_pos(x)]; } }; polynomial * substitute(polynomial const * p, unsigned xs_sz, var const * xs, mpq const * vs) { @@ -6527,9 +6527,9 @@ namespace polynomial { numeral const & m_val; public: single_var2value(numeral_manager & m, var x, numeral const & val):m_manager(m), m_x(x), m_val(val) {} - virtual numeral_manager & m() const { return m_manager; } - virtual bool contains(var x) const { return m_x == x; } - virtual numeral const & operator()(var x) const { SASSERT(m_x == x); return m_val; } + numeral_manager & m() const override { return m_manager; } + bool contains(var x) const override { return m_x == x; } + numeral const & operator()(var x) const override { SASSERT(m_x == x); return m_val; } }; void univ_eval(polynomial const * p, var x, numeral const & val, numeral & r) { diff --git a/src/math/polynomial/upolynomial_factorization_int.h b/src/math/polynomial/upolynomial_factorization_int.h index ea2b51d8f..e422c15a6 100644 --- a/src/math/polynomial/upolynomial_factorization_int.h +++ b/src/math/polynomial/upolynomial_factorization_int.h @@ -322,7 +322,7 @@ namespace upolynomial { /** \brief Filter the ones not in the degree set. */ - bool filter_current() const { + bool filter_current() const override { // select only the ones that have degrees in the degree set if (!m_degree_set.in_set(current_degree())) { diff --git a/src/math/realclosure/realclosure.cpp b/src/math/realclosure/realclosure.cpp index 8f2d933e2..3f399990d 100644 --- a/src/math/realclosure/realclosure.cpp +++ b/src/math/realclosure/realclosure.cpp @@ -344,13 +344,13 @@ namespace realclosure { // --------------------------------- struct mk_pi_interval : public mk_interval { - virtual void operator()(unsigned k, mpqi_manager & im, mpqi_manager::interval & r) { + void operator()(unsigned k, mpqi_manager & im, mpqi_manager::interval & r) override { im.pi(k, r); } }; struct mk_e_interval : public mk_interval { - virtual void operator()(unsigned k, mpqi_manager & im, mpqi_manager::interval & r) { + void operator()(unsigned k, mpqi_manager & im, mpqi_manager::interval & r) override { im.e(k, r); } }; diff --git a/src/math/subpaving/subpaving.cpp b/src/math/subpaving/subpaving.cpp index 96fc5b6d7..1f32a6189 100644 --- a/src/math/subpaving/subpaving.cpp +++ b/src/math/subpaving/subpaving.cpp @@ -38,22 +38,22 @@ namespace subpaving { CTX m_ctx; public: context_wrapper(reslimit& lim, typename CTX::numeral_manager & m, params_ref const & p, small_object_allocator * a):m_ctx(lim, m, p, a) {} - virtual ~context_wrapper() {} - virtual unsigned num_vars() const { return m_ctx.num_vars(); } - virtual var mk_var(bool is_int) { return m_ctx.mk_var(is_int); } - virtual bool is_int(var x) const { return m_ctx.is_int(x); } - virtual var mk_monomial(unsigned sz, power const * pws) { return m_ctx.mk_monomial(sz, pws); } - virtual void inc_ref(ineq * a) { m_ctx.inc_ref(reinterpret_cast(a)); } - virtual void dec_ref(ineq * a) { m_ctx.dec_ref(reinterpret_cast(a)); } - virtual void add_clause(unsigned sz, ineq * const * atoms) { m_ctx.add_clause(sz, reinterpret_cast(atoms)); } - virtual void display_constraints(std::ostream & out, bool use_star) const { m_ctx.display_constraints(out, use_star); } - virtual void set_display_proc(display_var_proc * p) { m_ctx.set_display_proc(p); } - virtual void reset_statistics() { m_ctx.reset_statistics(); } - virtual void collect_statistics(statistics & st) const { m_ctx.collect_statistics(st); } - virtual void collect_param_descrs(param_descrs & r) { m_ctx.collect_param_descrs(r); } - virtual void updt_params(params_ref const & p) { m_ctx.updt_params(p); } - virtual void operator()() { m_ctx(); } - virtual void display_bounds(std::ostream & out) const { m_ctx.display_bounds(out); } + ~context_wrapper() override {} + unsigned num_vars() const override { return m_ctx.num_vars(); } + var mk_var(bool is_int) override { return m_ctx.mk_var(is_int); } + bool is_int(var x) const override { return m_ctx.is_int(x); } + var mk_monomial(unsigned sz, power const * pws) override { return m_ctx.mk_monomial(sz, pws); } + void inc_ref(ineq * a) override { m_ctx.inc_ref(reinterpret_cast(a)); } + void dec_ref(ineq * a) override { m_ctx.dec_ref(reinterpret_cast(a)); } + void add_clause(unsigned sz, ineq * const * atoms) override { m_ctx.add_clause(sz, reinterpret_cast(atoms)); } + void display_constraints(std::ostream & out, bool use_star) const override { m_ctx.display_constraints(out, use_star); } + void set_display_proc(display_var_proc * p) override { m_ctx.set_display_proc(p); } + void reset_statistics() override { m_ctx.reset_statistics(); } + void collect_statistics(statistics & st) const override { m_ctx.collect_statistics(st); } + void collect_param_descrs(param_descrs & r) override { m_ctx.collect_param_descrs(r); } + void updt_params(params_ref const & p) override { m_ctx.updt_params(p); } + void operator()() override { m_ctx(); } + void display_bounds(std::ostream & out) const override { m_ctx.display_bounds(out); } }; class context_mpq_wrapper : public context_wrapper { @@ -66,11 +66,11 @@ namespace subpaving { m_as(m) {} - virtual ~context_mpq_wrapper() {} + ~context_mpq_wrapper() override {} - virtual unsynch_mpq_manager & qm() const { return m_ctx.nm(); } + unsynch_mpq_manager & qm() const override { return m_ctx.nm(); } - virtual var mk_sum(mpz const & c, unsigned sz, mpz const * as, var const * xs) { + var mk_sum(mpz const & c, unsigned sz, mpz const * as, var const * xs) override { m_as.reserve(sz); for (unsigned i = 0; i < sz; i++) { m_ctx.nm().set(m_as[i], as[i]); @@ -78,7 +78,7 @@ namespace subpaving { m_ctx.nm().set(m_c, c); return m_ctx.mk_sum(m_c, sz, m_as.c_ptr(), xs); } - virtual ineq * mk_ineq(var x, mpq const & k, bool lower, bool open) { + ineq * mk_ineq(var x, mpq const & k, bool lower, bool open) override { return reinterpret_cast(m_ctx.mk_ineq(x, k, lower, open)); } }; @@ -108,11 +108,11 @@ namespace subpaving { m_q2(m_qm) { } - virtual ~context_mpf_wrapper() {} + ~context_mpf_wrapper() override {} - virtual unsynch_mpq_manager & qm() const { return m_qm; } + unsynch_mpq_manager & qm() const override { return m_qm; } - virtual var mk_sum(mpz const & c, unsigned sz, mpz const * as, var const * xs) { + var mk_sum(mpz const & c, unsigned sz, mpz const * as, var const * xs) override { try { m_as.reserve(sz); for (unsigned i = 0; i < sz; i++) { @@ -125,7 +125,7 @@ namespace subpaving { throw subpaving::exception(); } } - virtual ineq * mk_ineq(var x, mpq const & k, bool lower, bool open) { + ineq * mk_ineq(var x, mpq const & k, bool lower, bool open) override { try { f2n & m = m_ctx.nm(); if (lower) @@ -165,11 +165,11 @@ namespace subpaving { m_qm(qm) { } - virtual ~context_hwf_wrapper() {} + ~context_hwf_wrapper() override {} - virtual unsynch_mpq_manager & qm() const { return m_qm; } + unsynch_mpq_manager & qm() const override { return m_qm; } - virtual var mk_sum(mpz const & c, unsigned sz, mpz const * as, var const * xs) { + var mk_sum(mpz const & c, unsigned sz, mpz const * as, var const * xs) override { try { m_as.reserve(sz); for (unsigned i = 0; i < sz; i++) { @@ -182,7 +182,7 @@ namespace subpaving { throw subpaving::exception(); } } - virtual ineq * mk_ineq(var x, mpq const & k, bool lower, bool open) { + ineq * mk_ineq(var x, mpq const & k, bool lower, bool open) override { try { f2n & m = m_ctx.nm(); if (lower) @@ -223,11 +223,11 @@ namespace subpaving { m_z2(m_qm) { } - virtual ~context_fpoint_wrapper() {} + ~context_fpoint_wrapper() override {} - virtual unsynch_mpq_manager & qm() const { return m_qm; } + unsynch_mpq_manager & qm() const override { return m_qm; } - virtual var mk_sum(mpz const & c, unsigned sz, mpz const * as, var const * xs) { + var mk_sum(mpz const & c, unsigned sz, mpz const * as, var const * xs) override { try { m_as.reserve(sz); for (unsigned i = 0; i < sz; i++) { @@ -241,7 +241,7 @@ namespace subpaving { } } - virtual ineq * mk_ineq(var x, mpq const & k, bool lower, bool open) { + ineq * mk_ineq(var x, mpq const & k, bool lower, bool open) override { try { typename context_fpoint::numeral_manager & m = this->m_ctx.nm(); if (lower) diff --git a/src/math/subpaving/subpaving_t_def.h b/src/math/subpaving/subpaving_t_def.h index 3574787d8..5729cbfa0 100644 --- a/src/math/subpaving/subpaving_t_def.h +++ b/src/math/subpaving/subpaving_t_def.h @@ -36,7 +36,7 @@ public: context_t::node_selector(ctx) { } - virtual node * operator()(node * front, node * back) { + node * operator()(node * front, node * back) override { return back; } }; @@ -80,7 +80,7 @@ public: } // Return the next variable to branch. - virtual var operator()(typename context_t::node * n) { + var operator()(typename context_t::node * n) override { typename context_t::numeral_manager & nm = this->ctx()->nm(); SASSERT(this->ctx()->num_vars() > 0); var x = this->ctx()->splitting_var(n); @@ -197,7 +197,7 @@ public: SASSERT(m_delta < INT_MAX); } - virtual void operator()(node * n, var x) { + void operator()(node * n, var x) override { SASSERT(!n->inconsistent()); numeral_manager & nm = this->ctx()->nm(); node * left = this->mk_node(n); diff --git a/src/math/subpaving/tactic/subpaving_tactic.cpp b/src/math/subpaving/tactic/subpaving_tactic.cpp index 6a7bc11e8..ebc9356d9 100644 --- a/src/math/subpaving/tactic/subpaving_tactic.cpp +++ b/src/math/subpaving/tactic/subpaving_tactic.cpp @@ -40,7 +40,7 @@ class subpaving_tactic : public tactic { ast_manager & m() const { return m_inv.get_manager(); } - virtual void operator()(std::ostream & out, subpaving::var x) const { + void operator()(std::ostream & out, subpaving::var x) const override { expr * t = m_inv.get(x, 0); if (t != 0) out << mk_ismt2_pp(t, m()); @@ -216,36 +216,36 @@ public: m_params(p) { } - virtual ~subpaving_tactic() { + ~subpaving_tactic() override { dealloc(m_imp); } - virtual tactic * translate(ast_manager & m) { + tactic * translate(ast_manager & m) override { return alloc(subpaving_tactic, m, m_params); } - 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 collect_statistics(statistics & st) const { + void collect_statistics(statistics & st) const override { st.copy(m_stats); } - virtual void reset_statistics() { + void reset_statistics() override { m_stats.reset(); } - 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 { try { m_imp->process(*in); m_imp->collect_statistics(m_stats); @@ -261,7 +261,7 @@ public: } } - virtual void cleanup() { + void cleanup() override { ast_manager & m = m_imp->m(); dealloc(m_imp); m_imp = alloc(imp, m, m_params); diff --git a/src/muz/base/dl_context.cpp b/src/muz/base/dl_context.cpp index 78860bdde..106c15d5f 100644 --- a/src/muz/base/dl_context.cpp +++ b/src/muz/base/dl_context.cpp @@ -90,10 +90,10 @@ namespace datalog { return idx; } - virtual unsigned get_constant_count() const { + unsigned get_constant_count() const override { return m_el_names.size(); } - virtual void print_element(finite_element el_num, std::ostream & out) { + void print_element(finite_element el_num, std::ostream & out) override { if (el_num>=m_el_names.size()) { out << el_num; return; @@ -132,10 +132,10 @@ namespace datalog { } return idx; } - virtual unsigned get_constant_count() const { + unsigned get_constant_count() const override { return m_el_names.size(); } - virtual void print_element(finite_element el_num, std::ostream & out) { + void print_element(finite_element el_num, std::ostream & out) override { if (el_num >= m_el_names.size()) { out << "get_name() << ":" << el_num << '>'; return; @@ -159,9 +159,9 @@ namespace datalog { public: restore_rules(rule_set& r): m_old_rules(alloc(rule_set, r)) {} - virtual ~restore_rules() {} + ~restore_rules() override {} - virtual void undo(context& ctx) { + void undo(context& ctx) override { ctx.replace_rules(*m_old_rules); reset(); } @@ -173,8 +173,8 @@ namespace datalog { unsigned m_old_size; public: restore_vec_size_trail(Vec& v): m_vector(v), m_old_size(v.size()) {} - virtual ~restore_vec_size_trail() {} - virtual void undo(Ctx& ctx) { m_vector.shrink(m_old_size); } + ~restore_vec_size_trail() override {} + void undo(Ctx& ctx) override { m_vector.shrink(m_old_size); } }; void context::push() { diff --git a/src/muz/base/dl_context.h b/src/muz/base/dl_context.h index 0fb68d396..3051dbf86 100644 --- a/src/muz/base/dl_context.h +++ b/src/muz/base/dl_context.h @@ -110,7 +110,7 @@ namespace datalog { class rel_context_base : public engine_base { public: rel_context_base(ast_manager& m, char const* name): engine_base(m, name) {} - virtual ~rel_context_base() {} + ~rel_context_base() override {} virtual relation_manager & get_rmanager() = 0; virtual const relation_manager & get_rmanager() const = 0; virtual relation_base & get_relation(func_decl * pred) = 0; @@ -146,9 +146,9 @@ namespace datalog { context const& ctx; public: contains_pred(context& ctx): ctx(ctx) {} - virtual ~contains_pred() {} + ~contains_pred() override {} - virtual bool operator()(expr* e) { + bool operator()(expr* e) override { return ctx.is_predicate(e); } }; diff --git a/src/muz/base/dl_util.cpp b/src/muz/base/dl_util.cpp index 715964e3a..aceeba364 100644 --- a/src/muz/base/dl_util.cpp +++ b/src/muz/base/dl_util.cpp @@ -385,7 +385,7 @@ namespace datalog { public: skip_model_converter() {} - virtual model_converter * translate(ast_translation & translator) { + model_converter * translate(ast_translation & translator) override { return alloc(skip_model_converter); } @@ -394,12 +394,12 @@ namespace datalog { model_converter* mk_skip_model_converter() { return alloc(skip_model_converter); } class skip_proof_converter : public proof_converter { - virtual void operator()(ast_manager & m, unsigned num_source, proof * const * source, proof_ref & result) { + void operator()(ast_manager & m, unsigned num_source, proof * const * source, proof_ref & result) override { SASSERT(num_source == 1); result = source[0]; } - virtual proof_converter * translate(ast_translation & translator) { + proof_converter * translate(ast_translation & translator) override { return alloc(skip_proof_converter); } diff --git a/src/muz/bmc/dl_bmc_engine.h b/src/muz/bmc/dl_bmc_engine.h index fd5ce92e6..a5824fa82 100644 --- a/src/muz/bmc/dl_bmc_engine.h +++ b/src/muz/bmc/dl_bmc_engine.h @@ -55,18 +55,18 @@ namespace datalog { public: bmc(context& ctx); - ~bmc(); + ~bmc() override; - lbool query(expr* query); + lbool query(expr* query) override; - void display_certificate(std::ostream& out) const; + void display_certificate(std::ostream& out) const override; - void collect_statistics(statistics& st) const; + void collect_statistics(statistics& st) const override; - void reset_statistics(); - void get_rules_along_trace(datalog::rule_ref_vector& rules); + void reset_statistics() override; + void get_rules_along_trace(datalog::rule_ref_vector& rules) override; - expr_ref get_answer(); + expr_ref get_answer() override; // direct access to (new) non-linear compiler. void compile(rule_set const& rules, expr_ref_vector& fmls, unsigned level); diff --git a/src/muz/clp/clp_context.h b/src/muz/clp/clp_context.h index 44f99d564..378fdd473 100644 --- a/src/muz/clp/clp_context.h +++ b/src/muz/clp/clp_context.h @@ -32,12 +32,12 @@ namespace datalog { imp* m_imp; public: clp(context& ctx); - ~clp(); - virtual lbool query(expr* query); - virtual void reset_statistics(); - virtual void collect_statistics(statistics& st) const; - virtual void display_certificate(std::ostream& out) const; - virtual expr_ref get_answer(); + ~clp() override; + lbool query(expr* query) override; + void reset_statistics() override; + void collect_statistics(statistics& st) const override; + void display_certificate(std::ostream& out) const override; + expr_ref get_answer() override; }; }; diff --git a/src/muz/ddnf/ddnf.h b/src/muz/ddnf/ddnf.h index 29e9b1555..14c9f3cc7 100644 --- a/src/muz/ddnf/ddnf.h +++ b/src/muz/ddnf/ddnf.h @@ -35,12 +35,12 @@ namespace datalog { imp* m_imp; public: ddnf(context& ctx); - ~ddnf(); - virtual lbool query(expr* query); - virtual void reset_statistics(); - virtual void collect_statistics(statistics& st) const; - virtual void display_certificate(std::ostream& out) const; - virtual expr_ref get_answer(); + ~ddnf() override; + lbool query(expr* query) override; + void reset_statistics() override; + void collect_statistics(statistics& st) const override; + void display_certificate(std::ostream& out) const override; + expr_ref get_answer() override; }; class ddnf_node; diff --git a/src/muz/duality/duality_dl_interface.h b/src/muz/duality/duality_dl_interface.h index 506642217..8178618ae 100644 --- a/src/muz/duality/duality_dl_interface.h +++ b/src/muz/duality/duality_dl_interface.h @@ -41,33 +41,33 @@ namespace Duality { public: dl_interface(datalog::context& ctx); - ~dl_interface(); + ~dl_interface() override; - lbool query(expr* query); + lbool query(expr* query) override; - void cancel(); + void cancel() override; - void cleanup(); + void cleanup() override; - void display_certificate(std::ostream& out) const; + void display_certificate(std::ostream& out) const override; - void collect_statistics(statistics& st) const; + void collect_statistics(statistics& st) const override; - void reset_statistics(); + void reset_statistics() override; - expr_ref get_answer(); + expr_ref get_answer() override; - unsigned get_num_levels(func_decl* pred); + unsigned get_num_levels(func_decl* pred) override; - expr_ref get_cover_delta(int level, func_decl* pred); + expr_ref get_cover_delta(int level, func_decl* pred) override; - void add_cover(int level, func_decl* pred, expr* property); + void add_cover(int level, func_decl* pred, expr* property) override; - void updt_params(); + void updt_params() override; - model_ref get_model(); + model_ref get_model() override; - proof_ref get_proof(); + proof_ref get_proof() override; duality_data *dd(){return _d;} diff --git a/src/muz/fp/datalog_parser.cpp b/src/muz/fp/datalog_parser.cpp index f839c5c5a..fd3eae944 100644 --- a/src/muz/fp/datalog_parser.cpp +++ b/src/muz/fp/datalog_parser.cpp @@ -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); diff --git a/src/muz/fp/dl_cmds.cpp b/src/muz/fp/dl_cmds.cpp index 2610f821c..deb8887ec 100644 --- a/src/muz/fp/dl_cmds.cpp +++ b/src/muz/fp/dl_cmds.cpp @@ -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 " ( ...) *"; } - 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 " ( ...) *"; } + 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 " "; } - 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 " "; } + 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(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(); } }; diff --git a/src/muz/fp/dl_register_engine.h b/src/muz/fp/dl_register_engine.h index 11f778346..e401c141a 100644 --- a/src/muz/fp/dl_register_engine.h +++ b/src/muz/fp/dl_register_engine.h @@ -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; } }; } diff --git a/src/muz/fp/horn_tactic.cpp b/src/muz/fp/horn_tactic.cpp index 5db57a12c..273489164 100644 --- a/src/muz/fp/horn_tactic.cpp +++ b/src/muz/fp/horn_tactic.cpp @@ -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); diff --git a/src/muz/pdr/pdr_dl_interface.h b/src/muz/pdr/pdr_dl_interface.h index 884f89e4b..1a0b04635 100644 --- a/src/muz/pdr/pdr_dl_interface.h +++ b/src/muz/pdr/pdr_dl_interface.h @@ -47,29 +47,29 @@ namespace pdr { public: dl_interface(datalog::context& ctx); - ~dl_interface(); + ~dl_interface() override; - virtual lbool query(expr* query); + lbool query(expr* query) override; - virtual void display_certificate(std::ostream& out) const; + void display_certificate(std::ostream& out) const override; - virtual void collect_statistics(statistics& st) const; + void collect_statistics(statistics& st) const override; - virtual void reset_statistics(); + void reset_statistics() override; - virtual expr_ref get_answer(); + expr_ref get_answer() override; - virtual unsigned get_num_levels(func_decl* pred); + unsigned get_num_levels(func_decl* pred) override; - virtual expr_ref get_cover_delta(int level, func_decl* pred); + expr_ref get_cover_delta(int level, func_decl* pred) override; - virtual void add_cover(int level, func_decl* pred, expr* property); + void add_cover(int level, func_decl* pred, expr* property) override; - virtual void updt_params(); + void updt_params() override; - virtual model_ref get_model(); + model_ref get_model() override; - virtual proof_ref get_proof(); + proof_ref get_proof() override; }; } diff --git a/src/muz/pdr/pdr_generalizers.h b/src/muz/pdr/pdr_generalizers.h index e0feda310..a75b347a4 100644 --- a/src/muz/pdr/pdr_generalizers.h +++ b/src/muz/pdr/pdr_generalizers.h @@ -30,8 +30,8 @@ namespace pdr { unsigned m_failure_limit; public: core_bool_inductive_generalizer(context& ctx, unsigned failure_limit) : core_generalizer(ctx), m_failure_limit(failure_limit) {} - virtual ~core_bool_inductive_generalizer() {} - virtual void operator()(model_node& n, expr_ref_vector& core, bool& uses_level); + ~core_bool_inductive_generalizer() override {} + void operator()(model_node& n, expr_ref_vector& core, bool& uses_level) override; }; template @@ -61,17 +61,17 @@ namespace pdr { bool substitute_alias(rational const&r, expr* x, expr* e, expr_ref& result); public: core_arith_inductive_generalizer(context& ctx); - virtual ~core_arith_inductive_generalizer() {} - virtual void operator()(model_node& n, expr_ref_vector& core, bool& uses_level); + ~core_arith_inductive_generalizer() override {} + void operator()(model_node& n, expr_ref_vector& core, bool& uses_level) override; }; class core_farkas_generalizer : public core_generalizer { farkas_learner m_farkas_learner; public: core_farkas_generalizer(context& ctx, ast_manager& m, smt_params& p); - virtual ~core_farkas_generalizer() {} - virtual void operator()(model_node& n, expr_ref_vector& core, bool& uses_level); - virtual void collect_statistics(statistics& st) const; + ~core_farkas_generalizer() override {} + void operator()(model_node& n, expr_ref_vector& core, bool& uses_level) override; + void collect_statistics(statistics& st) const override; }; @@ -85,26 +85,26 @@ namespace pdr { bool is_unsat(expr_ref_vector const& As, expr* B); public: core_convex_hull_generalizer(context& ctx, bool is_closure); - virtual ~core_convex_hull_generalizer() {} - virtual void operator()(model_node& n, expr_ref_vector const& core, bool uses_level, cores& new_cores); - virtual void operator()(model_node& n, expr_ref_vector& core, bool& uses_level); + ~core_convex_hull_generalizer() override {} + void operator()(model_node& n, expr_ref_vector const& core, bool uses_level, cores& new_cores) override; + void operator()(model_node& n, expr_ref_vector& core, bool& uses_level) override; }; class core_multi_generalizer : public core_generalizer { core_bool_inductive_generalizer m_gen; public: core_multi_generalizer(context& ctx, unsigned max_failures): core_generalizer(ctx), m_gen(ctx, max_failures) {} - virtual ~core_multi_generalizer() {} - virtual void operator()(model_node& n, expr_ref_vector& core, bool& uses_level); - virtual void operator()(model_node& n, expr_ref_vector const& core, bool uses_level, cores& new_cores); + ~core_multi_generalizer() override {} + void operator()(model_node& n, expr_ref_vector& core, bool& uses_level) override; + void operator()(model_node& n, expr_ref_vector const& core, bool uses_level, cores& new_cores) override; }; class core_induction_generalizer : public core_generalizer { class imp; public: core_induction_generalizer(context& ctx): core_generalizer(ctx) {} - virtual ~core_induction_generalizer() {} - virtual void operator()(model_node& n, expr_ref_vector& core, bool& uses_level); + ~core_induction_generalizer() override {} + void operator()(model_node& n, expr_ref_vector& core, bool& uses_level) override; }; }; #endif diff --git a/src/muz/pdr/pdr_smt_context_manager.h b/src/muz/pdr/pdr_smt_context_manager.h index 735b2cd62..747cd6457 100644 --- a/src/muz/pdr/pdr_smt_context_manager.h +++ b/src/muz/pdr/pdr_smt_context_manager.h @@ -59,15 +59,15 @@ namespace pdr { smt::kernel & m_context; public: _smt_context(smt::kernel & ctx, smt_context_manager& p, app* pred); - virtual ~_smt_context() {} - virtual void assert_expr(expr* e); - virtual lbool check(expr_ref_vector& assumptions); - virtual void get_model(model_ref& model); - virtual proof* get_proof(); - virtual void push() { m_context.push(); } - virtual void pop() { m_context.pop(1); } - virtual unsigned get_unsat_core_size() { return m_context.get_unsat_core_size(); } - virtual expr* get_unsat_core_expr(unsigned i) { return m_context.get_unsat_core_expr(i); } + ~_smt_context() override {} + void assert_expr(expr* e) override; + lbool check(expr_ref_vector& assumptions) override; + void get_model(model_ref& model) override; + proof* get_proof() override; + void push() override { m_context.push(); } + void pop() override { m_context.pop(1); } + unsigned get_unsat_core_size() override { return m_context.get_unsat_core_size(); } + expr* get_unsat_core_expr(unsigned i) override { return m_context.get_unsat_core_expr(i); } }; class smt_context_manager { diff --git a/src/muz/rel/check_relation.cpp b/src/muz/rel/check_relation.cpp index ddda295cd..a6298cf22 100644 --- a/src/muz/rel/check_relation.cpp +++ b/src/muz/rel/check_relation.cpp @@ -192,8 +192,8 @@ namespace datalog { const unsigned * cols1, const unsigned * cols2) : convenient_join_fn(o1_sig, o2_sig, col_cnt, cols1, cols2), m_join(j) {} - virtual ~join_fn() {} - virtual relation_base * operator()(const relation_base & r1, const relation_base & r2) { + ~join_fn() override {} + relation_base * operator()(const relation_base & r1, const relation_base & r2) override { check_relation const& t1 = get(r1); check_relation const& t2 = get(r2); check_relation_plugin& p = t1.get_plugin(); @@ -221,8 +221,8 @@ namespace datalog { : convenient_join_project_fn(o1_sig, o2_sig, col_cnt, cols1, cols2, removed_col_cnt, removed_cols), m_join(j) {} - virtual ~join_project_fn() {} - virtual relation_base * operator()(const relation_base & r1, const relation_base & r2) { + ~join_project_fn() override {} + relation_base * operator()(const relation_base & r1, const relation_base & r2) override { check_relation const& t1 = get(r1); check_relation const& t2 = get(r2); check_relation_plugin& p = t1.get_plugin(); @@ -491,7 +491,7 @@ namespace datalog { public: union_fn(relation_union_fn* m): m_union(m) {} - virtual void operator()(relation_base & _r, const relation_base & _src, relation_base * _delta) { + void operator()(relation_base & _r, const relation_base & _src, relation_base * _delta) override { TRACE("doc", _r.display(tout << "dst:\n"); _src.display(tout << "src:\n");); check_relation& r = get(_r); check_relation const& src = get(_src); @@ -529,9 +529,9 @@ namespace datalog { m_filter(f) { } - virtual ~filter_identical_fn() {} + ~filter_identical_fn() override {} - virtual void operator()(relation_base & _r) { + void operator()(relation_base & _r) override { check_relation& r = get(_r); check_relation_plugin& p = r.get_plugin(); ast_manager& m = p.m; @@ -565,9 +565,9 @@ namespace datalog { m_condition(condition) { } - virtual ~filter_interpreted_fn() {} + ~filter_interpreted_fn() override {} - virtual void operator()(relation_base & tb) { + void operator()(relation_base & tb) override { check_relation& r = get(tb); check_relation_plugin& p = r.get_plugin(); expr_ref fml = r.m_fml; @@ -592,9 +592,9 @@ namespace datalog { m_project(p) { } - virtual ~project_fn() {} + ~project_fn() override {} - virtual relation_base * operator()(const relation_base & tb) { + relation_base * operator()(const relation_base & tb) override { check_relation const& t = get(tb); check_relation_plugin& p = t.get_plugin(); relation_base* r = (*m_project)(t.rb()); @@ -620,9 +620,9 @@ namespace datalog { m_permute(permute) { } - virtual ~rename_fn() {} + ~rename_fn() override {} - virtual relation_base * operator()(const relation_base & _t) { + relation_base * operator()(const relation_base & _t) override { check_relation const& t = get(_t); check_relation_plugin& p = t.get_plugin(); relation_signature const& sig = get_result_signature(); @@ -649,8 +649,8 @@ namespace datalog { m_val(val), m_col(col) {} - virtual ~filter_equal_fn() { } - virtual void operator()(relation_base & tb) { + ~filter_equal_fn() override { } + void operator()(relation_base & tb) override { check_relation & t = get(tb); check_relation_plugin& p = t.get_plugin(); (*m_filter)(t.rb()); @@ -682,7 +682,7 @@ namespace datalog { SASSERT(joined_col_cnt > 0); } - virtual void operator()(relation_base& tb, const relation_base& negb) { + void operator()(relation_base& tb, const relation_base& negb) override { check_relation& t = get(tb); check_relation const& n = get(negb); check_relation_plugin& p = t.get_plugin(); @@ -763,9 +763,9 @@ namespace datalog { m_xform(xform) {} - virtual ~filter_proj_fn() {} + ~filter_proj_fn() override {} - virtual relation_base* operator()(const relation_base & tb) { + relation_base* operator()(const relation_base & tb) override { check_relation const & t = get(tb); check_relation_plugin& p = t.get_plugin(); relation_base* r = (*m_xform)(t.rb()); diff --git a/src/muz/rel/check_relation.h b/src/muz/rel/check_relation.h index 0fbb2a269..8fbce4184 100644 --- a/src/muz/rel/check_relation.h +++ b/src/muz/rel/check_relation.h @@ -38,20 +38,20 @@ namespace datalog { expr_ref mk_eq(relation_fact const& f) const; public: check_relation(check_relation_plugin& p, relation_signature const& s, relation_base* r); - virtual ~check_relation(); - virtual void reset(); - virtual void add_fact(const relation_fact & f); - virtual void add_new_fact(const relation_fact & f); - virtual bool contains_fact(const relation_fact & f) const; - virtual check_relation * clone() const; - virtual check_relation * complement(func_decl*) const; - virtual void to_formula(expr_ref& fml) const; + ~check_relation() override; + void reset() override; + void add_fact(const relation_fact & f) override; + void add_new_fact(const relation_fact & f) override; + bool contains_fact(const relation_fact & f) const override; + check_relation * clone() const override; + check_relation * complement(func_decl*) const override; + void to_formula(expr_ref& fml) const override; check_relation_plugin& get_plugin() const; - virtual bool fast_empty() const; - virtual bool empty() const; - virtual void display(std::ostream& out) const; - virtual bool is_precise() const { return m_relation->is_precise(); } - virtual unsigned get_size_estimate_rows() const { return m_relation->get_size_estimate_rows(); } + bool fast_empty() const override; + bool empty() const override; + void display(std::ostream& out) const override; + bool is_precise() const override { return m_relation->is_precise(); } + unsigned get_size_estimate_rows() const override { return m_relation->get_size_estimate_rows(); } relation_base& rb() { return *m_relation; } relation_base const& rb() const { return *m_relation; } expr_ref ground(expr* fml) const; @@ -90,39 +90,39 @@ namespace datalog { unsigned_vector const& cols1, unsigned_vector const& cols2); public: check_relation_plugin(relation_manager& rm); - ~check_relation_plugin(); + ~check_relation_plugin() override; void set_plugin(relation_plugin* p) { m_base = p; } - virtual bool can_handle_signature(const relation_signature & s); + bool can_handle_signature(const relation_signature & s) override; static symbol get_name() { return symbol("check_relation"); } - virtual relation_base * mk_empty(const relation_signature & s); - virtual relation_base * mk_full(func_decl* p, const relation_signature & s); - virtual relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2, - unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); - virtual relation_join_fn * mk_join_project_fn( + relation_base * mk_empty(const relation_signature & s) override; + relation_base * mk_full(func_decl* p, const relation_signature & s) override; + relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2, + unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override; + relation_join_fn * mk_join_project_fn( const relation_base & t1, const relation_base & t2, unsigned col_cnt, const unsigned * cols1, const unsigned * cols2, - unsigned removed_col_cnt, const unsigned * removed_cols); - virtual relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, - const unsigned * removed_cols); - virtual relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, - const unsigned * permutation_cycle); - virtual relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, - const relation_base * delta); - virtual relation_union_fn * mk_widen_fn(const relation_base & tgt, const relation_base & src, - const relation_base * delta); - virtual relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, - const unsigned * identical_cols); - virtual relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, - unsigned col); - virtual relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition); - virtual relation_intersection_filter_fn * mk_filter_by_negation_fn( + unsigned removed_col_cnt, const unsigned * removed_cols) override; + relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, + const unsigned * removed_cols) override; + relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, + const unsigned * permutation_cycle) override; + relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, + const relation_base * delta) override; + relation_union_fn * mk_widen_fn(const relation_base & tgt, const relation_base & src, + const relation_base * delta) override; + relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, + const unsigned * identical_cols) override; + relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, + unsigned col) override; + relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition) override; + relation_intersection_filter_fn * mk_filter_by_negation_fn( const relation_base& t, const relation_base& neg, unsigned joined_col_cnt, const unsigned *t_cols, - const unsigned *negated_cols); - virtual relation_transformer_fn * mk_filter_interpreted_and_project_fn( + const unsigned *negated_cols) override; + relation_transformer_fn * mk_filter_interpreted_and_project_fn( const relation_base & t, app * condition, - unsigned removed_col_cnt, const unsigned * removed_cols); + unsigned removed_col_cnt, const unsigned * removed_cols) override; void verify_join(relation_base const& t1, relation_base const& t2, relation_base const& t, unsigned_vector const& cols1, unsigned_vector const& cols2); diff --git a/src/muz/rel/dl_base.cpp b/src/muz/rel/dl_base.cpp index 904faf71f..5ca84c895 100644 --- a/src/muz/rel/dl_base.cpp +++ b/src/muz/rel/dl_base.cpp @@ -423,17 +423,17 @@ namespace datalog { const row_interface & m_parent; unsigned m_index; protected: - virtual bool is_finished() const { return m_index==m_parent.size(); } + bool is_finished() const override { return m_index==m_parent.size(); } public: fact_row_iterator(const row_interface & row, bool finished) : m_parent(row), m_index(finished ? row.size() : 0) {} - virtual table_element operator*() { + table_element operator*() override { SASSERT(!is_finished()); return m_parent[m_index]; } - virtual void operator++() { + void operator++() override { m_index++; SASSERT(m_index<=m_parent.size()); } diff --git a/src/muz/rel/dl_base.h b/src/muz/rel/dl_base.h index 4e59e9258..277f37f70 100644 --- a/src/muz/rel/dl_base.h +++ b/src/muz/rel/dl_base.h @@ -220,7 +220,7 @@ namespace datalog { */ class mutator_fn : public base_fn { public: - virtual ~mutator_fn() {} + ~mutator_fn() override {} virtual void operator()(base_object & t) = 0; @@ -629,19 +629,19 @@ namespace datalog { class identity_transformer_fn : public transformer_fn { public: - virtual base_object * operator()(const base_object & t) { + base_object * operator()(const base_object & t) override { return t.clone(); } }; class identity_mutator_fn : public mutator_fn { public: - virtual void operator()(base_object & t) {}; + void operator()(base_object & t) override {}; }; class identity_intersection_filter_fn : public intersection_filter_fn { public: - virtual void operator()(base_object & t, const base_object & neg) {}; + void operator()(base_object & t, const base_object & neg) override {}; }; class default_permutation_rename_fn : public transformer_fn { @@ -655,11 +655,11 @@ namespace datalog { : m_permutation(o.get_signature().size(), permutation), m_renamers_initialized(false) {} - ~default_permutation_rename_fn() { + ~default_permutation_rename_fn() override { dealloc_ptr_vector_content(m_renamers); } - base_object * operator()(const base_object & o) { + base_object * operator()(const base_object & o) override { const base_object * res = &o; scoped_rel res_scoped; if(m_renamers_initialized) { @@ -803,11 +803,11 @@ namespace datalog { protected: relation_base(relation_plugin & plugin, const relation_signature & s) : base_ancestor(plugin, s) {} - virtual ~relation_base() {} + ~relation_base() override {} public: virtual relation_base * complement(func_decl* p) const = 0; - virtual void reset(); + void reset() override; virtual void display_tuples(func_decl & pred, std::ostream & out) const { out << "Tuples in " << pred.get_name() << ": \n"; @@ -1022,7 +1022,7 @@ namespace datalog { table_plugin(symbol const& n, relation_manager & manager) : plugin_object(n, manager) {} public: - virtual bool can_handle_signature(const table_signature & s) { return s.functional_columns()==0; } + bool can_handle_signature(const table_signature & s) override { return s.functional_columns()==0; } protected: /** @@ -1044,17 +1044,17 @@ namespace datalog { protected: table_base(table_plugin & plugin, const table_signature & s) : base_ancestor(plugin, s) {} - virtual ~table_base() {} + ~table_base() override {} public: - virtual table_base * clone() const; + table_base * clone() const override; virtual table_base * complement(func_decl* p, const table_element * func_columns = 0) const; - virtual bool empty() const; + bool empty() const override; /** \brief Return true if table contains fact that corresponds to \c f in all non-functional columns. */ - virtual bool contains_fact(const table_fact & f) const; + bool contains_fact(const table_fact & f) const override; /** \brief If \c f (i.e. its non-functional part) is not present in the table, @@ -1082,11 +1082,11 @@ namespace datalog { virtual void remove_fact(table_element const* fact) = 0; virtual void remove_facts(unsigned fact_cnt, const table_fact * facts); virtual void remove_facts(unsigned fact_cnt, const table_element * facts); - virtual void reset(); + void reset() override; class row_interface; - virtual void display(std::ostream & out) const; + void display(std::ostream & out) const override; /** \brief Convert table to a formula that encodes the table. @@ -1245,9 +1245,9 @@ namespace datalog { public: caching_row_interface(const table_base & parent) : row_interface(parent) {} - virtual void get_fact(table_fact & result) const = 0; + void get_fact(table_fact & result) const override = 0; - virtual table_element operator[](unsigned col) const { + table_element operator[](unsigned col) const override { ensure_populated(); return m_current[col]; } diff --git a/src/muz/rel/dl_bound_relation.cpp b/src/muz/rel/dl_bound_relation.cpp index 9dc0eb8d5..74b87d96e 100644 --- a/src/muz/rel/dl_bound_relation.cpp +++ b/src/muz/rel/dl_bound_relation.cpp @@ -79,7 +79,7 @@ namespace datalog { : convenient_relation_join_fn(o1_sig, o2_sig, col_cnt, cols1, cols2) { } - virtual relation_base * operator()(const relation_base & _r1, const relation_base & _r2) { + relation_base * operator()(const relation_base & _r1, const relation_base & _r2) override { bound_relation const& r1 = get(_r1); bound_relation const& r2 = get(_r2); bound_relation_plugin& p = r1.get_plugin(); @@ -104,7 +104,7 @@ namespace datalog { : convenient_relation_project_fn(orig_sig, removed_col_cnt, removed_cols) { } - virtual relation_base * operator()(const relation_base & _r) { + relation_base * operator()(const relation_base & _r) override { bound_relation const& r = get(_r); bound_relation_plugin& p = r.get_plugin(); bound_relation* result = get(p.mk_full(0, get_result_signature())); @@ -124,7 +124,7 @@ namespace datalog { : convenient_relation_rename_fn(orig_sig, cycle_len, cycle) { } - virtual relation_base * operator()(const relation_base & _r) { + relation_base * operator()(const relation_base & _r) override { bound_relation const& r = get(_r); bound_relation_plugin& p = r.get_plugin(); bound_relation* result = get(p.mk_full(0, get_result_signature())); @@ -148,7 +148,7 @@ namespace datalog { union_fn(bool is_widen) : m_is_widen(is_widen) { } - virtual void operator()(relation_base & _r, const relation_base & _src, relation_base * _delta) { + void operator()(relation_base & _r, const relation_base & _src, relation_base * _delta) override { TRACE("bound_relation", _r.display(tout << "dst:\n"); _src.display(tout << "src:\n");); get(_r).mk_union(get(_src), get(_delta), m_is_widen); } @@ -160,7 +160,7 @@ namespace datalog { union_fn_i(bool is_widen) : m_is_widen(is_widen) { } - virtual void operator()(relation_base & _r, const relation_base & _src, relation_base * _delta) { + void operator()(relation_base & _r, const relation_base & _src, relation_base * _delta) override { TRACE("bound_relation", _r.display(tout << "dst:\n"); _src.display(tout << "src:\n");); get(_r).mk_union_i(get_interval_relation(_src), get(_delta), m_is_widen); TRACE("bound_relation", _r.display(tout << "dst':\n");); @@ -197,7 +197,7 @@ namespace datalog { filter_identical_fn(unsigned col_cnt, const unsigned * identical_cols) : m_cols(col_cnt, identical_cols) {} - virtual void operator()(relation_base & r) { + void operator()(relation_base & r) override { for (unsigned i = 1; i < m_cols.size(); ++i) { get(r).equate(m_cols[0], m_cols[i]); } @@ -216,7 +216,7 @@ namespace datalog { public: filter_equal_fn(relation_element const& value, unsigned col) {} - virtual void operator()(relation_base & r) { } + void operator()(relation_base & r) override { } }; relation_mutator_fn * bound_relation_plugin::mk_filter_equal_fn(const relation_base & r, @@ -342,7 +342,7 @@ namespace datalog { // x < y + z // - void operator()(relation_base& t) { + void operator()(relation_base& t) override { TRACE("dl", tout << mk_pp(m_cond, m_cond.get_manager()) << "\n"; t.display(tout);); bound_relation& r = get(t); switch(m_kind) { @@ -370,11 +370,11 @@ namespace datalog { TRACE("dl", t.display(tout << "result\n");); } - bool supports_attachment(relation_base& t) { + bool supports_attachment(relation_base& t) override { return is_interval_relation(t); } - void attach(relation_base& t) { + void attach(relation_base& t) override { SASSERT(is_interval_relation(t)); interval_relation& r = get_interval_relation(t); m_interval = &r; diff --git a/src/muz/rel/dl_bound_relation.h b/src/muz/rel/dl_bound_relation.h index 3dec9d313..da1aad71a 100644 --- a/src/muz/rel/dl_bound_relation.h +++ b/src/muz/rel/dl_bound_relation.h @@ -47,29 +47,29 @@ namespace datalog { bool_rewriter m_bsimp; public: bound_relation_plugin(relation_manager& m); - virtual bool can_handle_signature(const relation_signature & s); + bool can_handle_signature(const relation_signature & s) override; static symbol get_name() { return symbol("bound_relation"); } - virtual relation_base * mk_empty(const relation_signature & s); - virtual relation_base * mk_full(func_decl* p, const relation_signature & s); - virtual relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2, - unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); - virtual relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, - const unsigned * removed_cols); - virtual relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, - const unsigned * permutation_cycle); - virtual relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, - const relation_base * delta); - virtual relation_union_fn * mk_widen_fn(const relation_base & tgt, const relation_base & src, - const relation_base * delta); - virtual relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, - const unsigned * identical_cols); - virtual relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, - unsigned col); - virtual relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition); - - virtual relation_join_fn * mk_join_project_fn(const relation_base & t1, const relation_base & t2, - unsigned joined_col_cnt, const unsigned * cols1, const unsigned * cols2, - unsigned removed_col_cnt, const unsigned * removed_cols) { return 0; } + relation_base * mk_empty(const relation_signature & s) override; + relation_base * mk_full(func_decl* p, const relation_signature & s) override; + relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2, + unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override; + relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, + const unsigned * removed_cols) override; + relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, + const unsigned * permutation_cycle) override; + relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, + const relation_base * delta) override; + relation_union_fn * mk_widen_fn(const relation_base & tgt, const relation_base & src, + const relation_base * delta) override; + relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, + const unsigned * identical_cols) override; + relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, + unsigned col) override; + relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition) override; + + relation_join_fn * mk_join_project_fn(const relation_base & t1, const relation_base & t2, + unsigned joined_col_cnt, const unsigned * cols1, const unsigned * cols2, + unsigned removed_col_cnt, const unsigned * removed_cols) override { return 0; } #if 0 @@ -123,12 +123,12 @@ namespace datalog { bound_relation(bound_relation_plugin& p, relation_signature const& s, bool is_empty); bound_relation& operator=(bound_relation const& other); - virtual bool empty() const { return m_empty; } - virtual void add_fact(const relation_fact & f); - virtual bool contains_fact(const relation_fact & f) const; - virtual bound_relation * clone() const; - virtual bound_relation * complement(func_decl* p) const; - virtual void to_formula(expr_ref& fml) const; + bool empty() const override { return m_empty; } + void add_fact(const relation_fact & f) override; + bool contains_fact(const relation_fact & f) const override; + bound_relation * clone() const override; + bound_relation * complement(func_decl* p) const override; + void to_formula(expr_ref& fml) const override; bound_relation_plugin& get_plugin() const; void mk_union_i(interval_relation const& src, bound_relation* delta, bool is_widen); @@ -141,28 +141,28 @@ namespace datalog { bool is_lt(unsigned i, unsigned j) const; - virtual bool is_precise() const { return false; } + bool is_precise() const override { return false; } private: typedef uint_set2 T; - virtual T mk_intersect(T const& t1, T const& t2, bool& is_empty) const; + T mk_intersect(T const& t1, T const& t2, bool& is_empty) const override; - virtual T mk_widen(T const& t1, T const& t2) const; + T mk_widen(T const& t1, T const& t2) const override; - virtual T mk_unite(T const& t1, T const& t2) const; + T mk_unite(T const& t1, T const& t2) const override; - virtual T mk_eq(union_find<> const& old_eqs, union_find<> const& new_eqs, T const& t) const; + T mk_eq(union_find<> const& old_eqs, union_find<> const& new_eqs, T const& t) const override; - virtual void mk_rename_elem(T& i, unsigned col_cnt, unsigned const* cycle); + void mk_rename_elem(T& i, unsigned col_cnt, unsigned const* cycle) override; - virtual bool is_subset_of(T const& t1, T const& t2) const; + bool is_subset_of(T const& t1, T const& t2) const override; - virtual bool is_full(T const& t) const; + bool is_full(T const& t) const override; - virtual bool is_empty(unsigned idx, T const& t) const; + bool is_empty(unsigned idx, T const& t) const override; - virtual void display_index(unsigned idx, T const& t, std::ostream& out) const; + void display_index(unsigned idx, T const& t, std::ostream& out) const override; void normalize(T const& src, T& dst) const; diff --git a/src/muz/rel/dl_check_table.cpp b/src/muz/rel/dl_check_table.cpp index 0c4be18f1..b7d22159e 100644 --- a/src/muz/rel/dl_check_table.cpp +++ b/src/muz/rel/dl_check_table.cpp @@ -65,7 +65,7 @@ namespace datalog { m_checker = p.get_manager().mk_join_fn(checker(t1), checker(t2), col_cnt, cols1, cols2); } - virtual table_base* operator()(const table_base & t1, const table_base & t2) { + table_base* operator()(const table_base & t1, const table_base & t2) override { IF_VERBOSE(1, verbose_stream() << __FUNCTION__ << "\n";); table_base* ttocheck = (*m_tocheck)(tocheck(t1), tocheck(t2)); table_base* tchecker = (*m_checker)(checker(t1), checker(t2)); @@ -93,7 +93,7 @@ namespace datalog { m_checker = p.get_manager().mk_join_project_fn(checker(t1), checker(t2), col_cnt, cols1, cols2, removed_col_cnt, removed_cols); } - virtual table_base* operator()(const table_base & t1, const table_base & t2) { + table_base* operator()(const table_base & t1, const table_base & t2) override { table_base* ttocheck = (*m_tocheck)(tocheck(t1), tocheck(t2)); table_base* tchecker = (*m_checker)(checker(t1), checker(t2)); check_table* result = alloc(check_table, get(t1).get_plugin(), ttocheck->get_signature(), ttocheck, tchecker); @@ -119,7 +119,7 @@ namespace datalog { m_checker = p.get_manager().mk_union_fn(checker(tgt), checker(src), checker(delta)); } - virtual void operator()(table_base& tgt, const table_base& src, table_base* delta) { + void operator()(table_base& tgt, const table_base& src, table_base* delta) override { IF_VERBOSE(1, verbose_stream() << __FUNCTION__ << "\n";); (*m_tocheck)(tocheck(tgt), tocheck(src), tocheck(delta)); (*m_checker)(checker(tgt), checker(src), checker(delta)); @@ -147,7 +147,7 @@ namespace datalog { m_tocheck = p.get_manager().mk_project_fn(tocheck(t), col_cnt, removed_cols); } - table_base* operator()(table_base const& src) { + table_base* operator()(table_base const& src) override { table_base* tchecker = (*m_checker)(checker(src)); table_base* ttocheck = (*m_tocheck)(tocheck(src)); check_table* result = alloc(check_table, get(src).get_plugin(), tchecker->get_signature(), ttocheck, tchecker); @@ -171,7 +171,7 @@ namespace datalog { m_tocheck = p.get_manager().mk_select_equal_and_project_fn(tocheck(t), value, col); } - table_base* operator()(table_base const& src) { + table_base* operator()(table_base const& src) override { table_base* tchecker = (*m_checker)(checker(src)); table_base* ttocheck = (*m_tocheck)(tocheck(src)); check_table* result = alloc(check_table, get(src).get_plugin(), tchecker->get_signature(), ttocheck, tchecker); @@ -196,7 +196,7 @@ namespace datalog { m_tocheck = p.get_manager().mk_rename_fn(tocheck(t), cycle_len, cycle); } - table_base* operator()(table_base const& src) { + table_base* operator()(table_base const& src) override { IF_VERBOSE(1, verbose_stream() << __FUNCTION__ << "\n";); table_base* tchecker = (*m_checker)(checker(src)); table_base* ttocheck = (*m_tocheck)(tocheck(src)); @@ -222,7 +222,7 @@ namespace datalog { m_tocheck = p.get_manager().mk_filter_identical_fn(tocheck(t), cnt, cols); } - void operator()(table_base & t) { + void operator()(table_base & t) override { (*m_checker)(checker(t)); (*m_tocheck)(tocheck(t)); get(t).well_formed(); @@ -247,7 +247,7 @@ namespace datalog { m_tocheck = p.get_manager().mk_filter_equal_fn(tocheck(t), v, col); } - virtual void operator()(table_base& src) { + void operator()(table_base& src) override { (*m_checker)(checker(src)); (*m_tocheck)(tocheck(src)); get(src).well_formed(); @@ -271,7 +271,7 @@ namespace datalog { m_tocheck = p.get_manager().mk_filter_interpreted_fn(tocheck(t), condition); } - virtual void operator()(table_base& src) { + void operator()(table_base& src) override { (*m_checker)(checker(src)); (*m_tocheck)(tocheck(src)); get(src).well_formed(); @@ -296,7 +296,7 @@ namespace datalog { m_tocheck = p.get_manager().mk_filter_interpreted_and_project_fn(tocheck(t), condition, removed_col_cnt, removed_cols); } - table_base* operator()(table_base const& src) { + table_base* operator()(table_base const& src) override { table_base* tchecker = (*m_checker)(checker(src)); table_base* ttocheck = (*m_tocheck)(tocheck(src)); check_table* result = alloc(check_table, get(src).get_plugin(), ttocheck->get_signature(), ttocheck, tchecker); @@ -325,7 +325,7 @@ namespace datalog { m_tocheck = p.get_manager().mk_filter_by_negation_fn(tocheck(t), tocheck(negated_obj), joined_col_cnt, t_cols, negated_cols); } - virtual void operator()(table_base& src, table_base const& negated_obj) { + void operator()(table_base& src, table_base const& negated_obj) override { IF_VERBOSE(1, verbose_stream() << __FUNCTION__ << "\n";); (*m_checker)(checker(src), checker(negated_obj)); (*m_tocheck)(tocheck(src), tocheck(negated_obj)); diff --git a/src/muz/rel/dl_check_table.h b/src/muz/rel/dl_check_table.h index 412dd2dbc..77d9d0cdf 100644 --- a/src/muz/rel/dl_check_table.h +++ b/src/muz/rel/dl_check_table.h @@ -53,34 +53,34 @@ namespace datalog { m_checker(*manager.get_table_plugin(checker)), m_tocheck(*manager.get_table_plugin(tocheck)), m_count(0) {} - virtual table_base * mk_empty(const table_signature & s); + table_base * mk_empty(const table_signature & s) override; - virtual table_join_fn * mk_join_fn(const table_base & t1, const table_base & t2, - unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); - virtual table_join_fn * mk_join_project_fn(const table_base & t1, const table_base & t2, - unsigned col_cnt, const unsigned * cols1, const unsigned * cols2, unsigned removed_col_cnt, - const unsigned * removed_cols); - virtual table_union_fn * mk_union_fn(const table_base & tgt, const table_base & src, - const table_base * delta); - virtual table_transformer_fn * mk_project_fn(const table_base & t, unsigned col_cnt, - const unsigned * removed_cols); - virtual table_transformer_fn * mk_select_equal_and_project_fn(const table_base & t, - const table_element & value, unsigned col); - virtual table_transformer_fn * mk_rename_fn(const table_base & t, unsigned permutation_cycle_len, - const unsigned * permutation_cycle); - virtual table_mutator_fn * mk_filter_identical_fn(const table_base & t, unsigned col_cnt, - const unsigned * identical_cols); - virtual table_mutator_fn * mk_filter_equal_fn(const table_base & t, const table_element & value, - unsigned col); - virtual table_mutator_fn * mk_filter_interpreted_fn(const table_base & t, app * condition); - virtual table_transformer_fn * mk_filter_interpreted_and_project_fn(const table_base & t, - app * condition, unsigned removed_col_cnt, const unsigned * removed_cols); - virtual table_intersection_filter_fn * mk_filter_by_negation_fn( - const table_base & t, - const table_base & negated_obj, unsigned joined_col_cnt, - const unsigned * t_cols, const unsigned * negated_cols); + table_join_fn * mk_join_fn(const table_base & t1, const table_base & t2, + unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override; + table_join_fn * mk_join_project_fn(const table_base & t1, const table_base & t2, + unsigned col_cnt, const unsigned * cols1, const unsigned * cols2, unsigned removed_col_cnt, + const unsigned * removed_cols) override; + table_union_fn * mk_union_fn(const table_base & tgt, const table_base & src, + const table_base * delta) override; + table_transformer_fn * mk_project_fn(const table_base & t, unsigned col_cnt, + const unsigned * removed_cols) override; + table_transformer_fn * mk_select_equal_and_project_fn(const table_base & t, + const table_element & value, unsigned col) override; + table_transformer_fn * mk_rename_fn(const table_base & t, unsigned permutation_cycle_len, + const unsigned * permutation_cycle) override; + table_mutator_fn * mk_filter_identical_fn(const table_base & t, unsigned col_cnt, + const unsigned * identical_cols) override; + table_mutator_fn * mk_filter_equal_fn(const table_base & t, const table_element & value, + unsigned col) override; + table_mutator_fn * mk_filter_interpreted_fn(const table_base & t, app * condition) override; + table_transformer_fn * mk_filter_interpreted_and_project_fn(const table_base & t, + app * condition, unsigned removed_col_cnt, const unsigned * removed_cols) override; + table_intersection_filter_fn * mk_filter_by_negation_fn( + const table_base & t, + const table_base & negated_obj, unsigned joined_col_cnt, + const unsigned * t_cols, const unsigned * negated_cols) override; - virtual bool can_handle_signature(table_signature const& s); + bool can_handle_signature(table_signature const& s) override; private: static check_table& get(table_base& r); @@ -106,7 +106,7 @@ namespace datalog { check_table(check_table_plugin & p, const table_signature & sig); check_table(check_table_plugin & p, const table_signature & sig, table_base* tocheck, table_base* checker); - virtual ~check_table(); + ~check_table() override; bool well_formed() const; @@ -116,18 +116,18 @@ namespace datalog { return static_cast(table_base::get_plugin()); } - virtual bool empty() const; - virtual void add_fact(const table_fact & f); - virtual void remove_fact(const table_element* fact); - virtual bool contains_fact(const table_fact & f) const; - virtual table_base * complement(func_decl* p, const table_element * func_columns = 0) const; - virtual table_base * clone() const; + bool empty() const override; + void add_fact(const table_fact & f) override; + void remove_fact(const table_element* fact) override; + bool contains_fact(const table_fact & f) const override; + table_base * complement(func_decl* p, const table_element * func_columns = 0) const override; + table_base * clone() const override; - virtual iterator begin() const { SASSERT(well_formed()); return m_tocheck->begin(); } - virtual iterator end() const { return m_tocheck->end(); } + iterator begin() const override { SASSERT(well_formed()); return m_tocheck->begin(); } + iterator end() const override { return m_tocheck->end(); } - virtual unsigned get_size_estimate_rows() const { return m_tocheck->get_size_estimate_rows(); } - virtual unsigned get_size_estimate_bytes() const { return m_tocheck->get_size_estimate_bytes(); } + unsigned get_size_estimate_rows() const override { return m_tocheck->get_size_estimate_rows(); } + unsigned get_size_estimate_bytes() const override { return m_tocheck->get_size_estimate_bytes(); } }; }; diff --git a/src/muz/rel/dl_compiler.h b/src/muz/rel/dl_compiler.h index 6ac33ae91..51ec7643c 100644 --- a/src/muz/rel/dl_compiler.h +++ b/src/muz/rel/dl_compiler.h @@ -97,7 +97,7 @@ namespace datalog { void start_rule(rule * r) { SASSERT(!m_current); m_current=r; } void finish_rule() { m_current = 0; } - virtual void notify(instruction * i) { + void notify(instruction * i) override { if(m_current) { i->set_accounting_parent_object(m_parent.m_context, m_current); } diff --git a/src/muz/rel/dl_external_relation.cpp b/src/muz/rel/dl_external_relation.cpp index ff9bef40e..403c5cbd3 100644 --- a/src/muz/rel/dl_external_relation.cpp +++ b/src/muz/rel/dl_external_relation.cpp @@ -195,7 +195,7 @@ namespace datalog { m_join_fn = m.mk_func_decl(fid, OP_RA_JOIN, params.size(), params.c_ptr(), 2, domain); } - virtual relation_base * operator()(const relation_base & r1, const relation_base & r2) { + relation_base * operator()(const relation_base & r1, const relation_base & r2) override { expr_ref res(m_plugin.get_ast_manager()); m_args[0] = get(r1).get_relation(); m_args[1] = get(r2).get_relation(); @@ -231,7 +231,7 @@ namespace datalog { m_project_fn = m.mk_func_decl(fid, OP_RA_PROJECT, params.size(), params.c_ptr(), 1, &relation_sort); } - virtual relation_base * operator()(const relation_base & r) { + relation_base * operator()(const relation_base & r) override { expr_ref res(m_plugin.get_ast_manager()); expr* rel = get(r).get_relation(); m_plugin.reduce(m_project_fn, 1, &rel, res); @@ -265,7 +265,7 @@ namespace datalog { m_rename_fn = m.mk_func_decl(fid, OP_RA_RENAME, params.size(), params.c_ptr(), 1, &relation_sort); } - virtual relation_base * operator()(const relation_base & r) { + relation_base * operator()(const relation_base & r) override { expr* rel = get(r).get_relation(); expr_ref res(m_plugin.get_ast_manager()); m_args[0] = rel; @@ -298,7 +298,7 @@ namespace datalog { m_union_fn = m.mk_func_decl(p.get_family_id(), k, 0, 0, 2, domain); } - virtual void operator()(relation_base & r, const relation_base & src, relation_base * delta) { + void operator()(relation_base & r, const relation_base & src, relation_base * delta) override { ast_manager& m = m_plugin.get_ast_manager(); expr_ref_vector res(m); m_args[0] = get(r).get_relation(); @@ -342,7 +342,7 @@ namespace datalog { SASSERT(p.get_ast_manager().is_bool(condition)); } - virtual void operator()(relation_base & r) { + void operator()(relation_base & r) override { SASSERT(m_plugin.check_kind(r)); expr* arg = get(r).get_relation(); m_plugin.reduce_assign(m_filter_fn, 1, &arg, 1, &arg); @@ -396,7 +396,7 @@ namespace datalog { } } - virtual void operator()(relation_base & r) { + void operator()(relation_base & r) override { expr* r0 = get(r).get_relation(); for (unsigned i = 0; i < m_filter_fn.size(); ++i) { m_plugin.reduce_assign(m_filter_fn[i].get(), 1, &r0, 1, &r0); @@ -436,7 +436,7 @@ namespace datalog { m_negated_filter_fn = m.mk_func_decl(fid, OP_RA_NEGATION_FILTER, params.size(), params.c_ptr(), 2, domain); } - void operator()(relation_base & t, const relation_base & negated_obj) { + void operator()(relation_base & t, const relation_base & negated_obj) override { m_args[0] = get(t).get_relation(); m_args[1] = get(negated_obj).get_relation(); m_plugin.reduce_assign(m_negated_filter_fn.get(), 2, m_args, 1, m_args); diff --git a/src/muz/rel/dl_external_relation.h b/src/muz/rel/dl_external_relation.h index 0dfb4a7f2..485e03618 100644 --- a/src/muz/rel/dl_external_relation.h +++ b/src/muz/rel/dl_external_relation.h @@ -54,30 +54,30 @@ namespace datalog { public: external_relation_plugin(external_relation_context& ctx, relation_manager & m); - virtual bool can_handle_signature(const relation_signature & s) { return true; } + bool can_handle_signature(const relation_signature & s) override { return true; } static symbol get_name() { return symbol("external_relation"); } - virtual relation_base * mk_empty(const relation_signature & s); + relation_base * mk_empty(const relation_signature & s) override; - virtual relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2, - unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); - virtual relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, - const unsigned * removed_cols); - virtual relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, - const unsigned * permutation_cycle); - virtual relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, - const relation_base * delta); - virtual relation_union_fn * mk_widen_fn(const relation_base & tgt, const relation_base & src, - const relation_base * delta); - virtual relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, - const unsigned * identical_cols); - virtual relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, - unsigned col); - virtual relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition); - virtual relation_intersection_filter_fn * mk_filter_by_negation_fn(const relation_base & t, - const relation_base & negated_obj, unsigned joined_col_cnt, - const unsigned * t_cols, const unsigned * negated_cols); + relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2, + unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override; + relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, + const unsigned * removed_cols) override; + relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, + const unsigned * permutation_cycle) override; + relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, + const relation_base * delta) override; + relation_union_fn * mk_widen_fn(const relation_base & tgt, const relation_base & src, + const relation_base * delta) override; + relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, + const unsigned * identical_cols) override; + relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, + unsigned col) override; + relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition) override; + relation_intersection_filter_fn * mk_filter_by_negation_fn(const relation_base & t, + const relation_base & negated_obj, unsigned joined_col_cnt, + const unsigned * t_cols, const unsigned * negated_cols) override; private: @@ -123,28 +123,28 @@ namespace datalog { void mk_accessor(decl_kind k, func_decl_ref& fn, const relation_fact& f, bool destructive, expr_ref& res) const; external_relation(external_relation_plugin & p, const relation_signature & s, expr* r); - virtual ~external_relation(); + ~external_relation() override; public: external_relation_plugin & get_plugin() const; - virtual bool empty() const; + bool empty() const override; - virtual void add_fact(const relation_fact & f); + void add_fact(const relation_fact & f) override; - virtual bool contains_fact(const relation_fact & f) const; + bool contains_fact(const relation_fact & f) const override; - virtual external_relation * clone() const; + external_relation * clone() const override; - virtual external_relation * complement(func_decl*) const; + external_relation * complement(func_decl*) const override; - virtual void display(std::ostream & out) const; + void display(std::ostream & out) const override; - virtual void display_tuples(func_decl & pred, std::ostream & out) const; + void display_tuples(func_decl & pred, std::ostream & out) const override; expr* get_relation() const { return m_rel.get(); } - virtual void to_formula(expr_ref& fml) const { fml = get_relation(); } + void to_formula(expr_ref& fml) const override { fml = get_relation(); } }; diff --git a/src/muz/rel/dl_finite_product_relation.cpp b/src/muz/rel/dl_finite_product_relation.cpp index 163ba1b0b..4cb683df1 100644 --- a/src/muz/rel/dl_finite_product_relation.cpp +++ b/src/muz/rel/dl_finite_product_relation.cpp @@ -333,7 +333,7 @@ namespace datalog { : convenient_relation_join_fn(sig1, sig2, col_cnt, cols1, cols2), m_plugin(plugin) {} - virtual relation_base * operator()(const relation_base & r1, const relation_base & r2) { + relation_base * operator()(const relation_base & r1, const relation_base & r2) override { scoped_rel r1_conv; if(&r1.get_plugin()!=&m_plugin) { r1_conv = convert(r1); @@ -390,7 +390,7 @@ namespace datalog { relation_vector & rjoins) : m_parent(parent), m_r1(r1), m_r2(r2), m_rjoins(rjoins) {} - virtual bool operator()(table_element * func_columns) { + bool operator()(table_element * func_columns) override { const relation_base & or1 = m_r1.get_inner_rel(func_columns[0]); const relation_base & or2 = m_r2.get_inner_rel(func_columns[1]); SASSERT(&or1); @@ -450,7 +450,7 @@ namespace datalog { return (*m_rjoin_fn)(r1, r2); } - virtual relation_base * operator()(const relation_base & rb1, const relation_base & rb2) { + relation_base * operator()(const relation_base & rb1, const relation_base & rb2) override { finite_product_relation_plugin & plugin = get(rb1).get_plugin(); relation_manager & rmgr = plugin.get_manager(); @@ -565,7 +565,7 @@ namespace datalog { project_reducer(project_fn & parent, relation_vector & relations) : m_parent(parent), m_relations(relations) {} - virtual void operator()(table_element * func_columns, const table_element * merged_func_columns) { + void operator()(table_element * func_columns, const table_element * merged_func_columns) override { relation_base * tgt = m_relations[static_cast(func_columns[0])]->clone(); relation_base & src = *m_relations[static_cast(merged_func_columns[0])]; if(!m_parent.m_inner_rel_union) { @@ -579,7 +579,7 @@ namespace datalog { } }; - virtual relation_base * operator()(const relation_base & rb) { + relation_base * operator()(const relation_base & rb) override { const finite_product_relation & r = get(rb); finite_product_relation_plugin & plugin = r.get_plugin(); const table_base & rtable = r.get_table(); @@ -696,7 +696,7 @@ namespace datalog { } - virtual relation_base * operator()(const relation_base & rb) { + relation_base * operator()(const relation_base & rb) override { const finite_product_relation & r = get(rb); const table_base & rtable = r.get_table(); @@ -795,9 +795,9 @@ namespace datalog { m_delta_indexes(delta_indexes), m_delta_rels(delta_rels) {} - virtual ~union_mapper() {} + ~union_mapper() override {} - virtual bool operator()(table_element * func_columns) { + bool operator()(table_element * func_columns) override { relation_base & otgt_orig = m_tgt.get_inner_rel(func_columns[0]); const relation_base & osrc = m_src.get_inner_rel(func_columns[1]); @@ -838,7 +838,7 @@ namespace datalog { src_copying_mapper(finite_product_relation & tgt, const finite_product_relation & src) : m_tgt(tgt), m_src(src) {} - virtual bool operator()(table_element * func_columns) { + bool operator()(table_element * func_columns) override { const relation_base & osrc = m_src.get_inner_rel(func_columns[0]); unsigned new_tgt_idx = m_tgt.get_next_rel_idx(); m_tgt.set_inner_rel(new_tgt_idx, osrc.clone()); @@ -847,7 +847,7 @@ namespace datalog { } }; - virtual void operator()(relation_base & tgtb, const relation_base & srcb, relation_base * deltab) { + void operator()(relation_base & tgtb, const relation_base & srcb, relation_base * deltab) override { finite_product_relation & tgt = get(tgtb); const finite_product_relation & src0 = get(srcb); finite_product_relation * delta = get(deltab); @@ -1088,7 +1088,7 @@ namespace datalog { class finite_product_relation_plugin::converting_union_fn : public relation_union_fn { scoped_ptr m_tr_union_fun; public: - virtual void operator()(relation_base & tgtb, const relation_base & srcb, relation_base * deltab) { + void operator()(relation_base & tgtb, const relation_base & srcb, relation_base * deltab) override { SASSERT(srcb.get_plugin().is_finite_product_relation()); const finite_product_relation & src = get(srcb); finite_product_relation_plugin & plugin = src.get_plugin(); @@ -1164,7 +1164,7 @@ namespace datalog { SASSERT(m_rel_filter); } - virtual void operator()(relation_base & rb) { + void operator()(relation_base & rb) override { finite_product_relation & r = get(rb); if(m_table_cols.size()>1) { @@ -1212,7 +1212,7 @@ namespace datalog { } } - virtual void operator()(relation_base & rb) { + void operator()(relation_base & rb) override { finite_product_relation & r = get(rb); if(m_table_filter) { @@ -1339,7 +1339,7 @@ namespace datalog { } } - virtual void operator()(relation_base & rb) { + void operator()(relation_base & rb) override { finite_product_relation & r = get(rb); table_base & rtable = r.get_table(); table_plugin & tplugin = r.get_table_plugin(); @@ -1537,7 +1537,7 @@ namespace datalog { const finite_product_relation & inters) : m_parent(parent), m_r(r), m_inters(inters) {} - virtual bool operator()(table_element * func_columns) { + bool operator()(table_element * func_columns) override { relation_base * r_inner = m_r.get_inner_rel(func_columns[0]).clone(); const relation_base & inters_inner = m_inters.get_inner_rel(func_columns[1]); @@ -1557,7 +1557,7 @@ namespace datalog { }; - virtual void operator()(relation_base & rb, const relation_base & negb) { + void operator()(relation_base & rb, const relation_base & negb) override { finite_product_relation & r = get(rb); const finite_product_relation & neg = get(negb); @@ -1662,7 +1662,7 @@ namespace datalog { } } - virtual void operator()(relation_base & rb) { + void operator()(relation_base & rb) override { finite_product_relation & r = get(rb); finite_product_relation_plugin & plugin = r.get_plugin(); table_plugin & tplugin = r.get_table_plugin(); @@ -2043,7 +2043,7 @@ namespace datalog { public: live_rel_collection_reducer(idx_set & accumulator) : m_accumulator(accumulator) {} - virtual void operator()(table_element * func_columns, const table_element * merged_func_columns) { + void operator()(table_element * func_columns, const table_element * merged_func_columns) override { m_accumulator.insert(static_cast(merged_func_columns[0])); } }; diff --git a/src/muz/rel/dl_finite_product_relation.h b/src/muz/rel/dl_finite_product_relation.h index e13b7fcf9..750ac325f 100644 --- a/src/muz/rel/dl_finite_product_relation.h +++ b/src/muz/rel/dl_finite_product_relation.h @@ -93,23 +93,23 @@ namespace datalog { finite_product_relation_plugin(relation_plugin & inner_plugin, relation_manager & manager); - virtual void initialize(family_id fid); + void initialize(family_id fid) override; relation_plugin & get_inner_plugin() const { return m_inner_plugin; } - virtual bool can_handle_signature(const relation_signature & s); + bool can_handle_signature(const relation_signature & s) override; - virtual relation_base * mk_empty(const relation_signature & s); + relation_base * mk_empty(const relation_signature & s) override; /** \c inner_kind==null_family_id means we don't care about the kind of the inner relation */ finite_product_relation * mk_empty(const relation_signature & s, const bool * table_columns, family_id inner_kind=null_family_id); finite_product_relation * mk_empty(const finite_product_relation & original); - virtual relation_base * mk_empty(const relation_base & original); - virtual relation_base * mk_empty(const relation_signature & s, family_id kind); + relation_base * mk_empty(const relation_base & original) override; + relation_base * mk_empty(const relation_signature & s, family_id kind) override; - virtual relation_base * mk_full(func_decl* p, const relation_signature & s); + relation_base * mk_full(func_decl* p, const relation_signature & s) override; /** \brief Return true if \c r can be converted to \c finite_product_relation_plugin either @@ -127,22 +127,22 @@ namespace datalog { table_relation * to_table_relation(const finite_product_relation & r); protected: - virtual relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2, - unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); - virtual relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, - const unsigned * removed_cols); - virtual relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, - const unsigned * permutation_cycle); - virtual relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, - const relation_base * delta); - virtual relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, - const unsigned * identical_cols); - virtual relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, - unsigned col); - virtual relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition); - virtual relation_intersection_filter_fn * mk_filter_by_negation_fn(const relation_base & t, - const relation_base & negated_obj, unsigned joined_col_cnt, - const unsigned * t_cols, const unsigned * negated_cols); + relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2, + unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override; + relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, + const unsigned * removed_cols) override; + relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, + const unsigned * permutation_cycle) override; + relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, + const relation_base * delta) override; + relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, + const unsigned * identical_cols) override; + relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, + unsigned col) override; + relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition) override; + relation_intersection_filter_fn * mk_filter_by_negation_fn(const relation_base & t, + const relation_base & negated_obj, unsigned joined_col_cnt, + const unsigned * t_cols, const unsigned * negated_cols) override; private: /** @@ -309,7 +309,7 @@ namespace datalog { bool try_modify_specification(const bool * table_cols); - virtual bool can_swap(const relation_base & r) const + bool can_swap(const relation_base & r) const override { return &get_plugin()==&r.get_plugin(); } /** @@ -317,7 +317,7 @@ namespace datalog { Both relations must come from the same plugin and be of the same signature. */ - virtual void swap(relation_base & r); + void swap(relation_base & r) override; /** \brief Create a \c finite_product_relation object. @@ -325,7 +325,7 @@ namespace datalog { finite_product_relation(finite_product_relation_plugin & p, const relation_signature & s, const bool * table_columns, table_plugin & tplugin, relation_plugin & oplugin, family_id other_kind); finite_product_relation(const finite_product_relation & r); - virtual ~finite_product_relation(); + ~finite_product_relation() override; public: context & get_context() const; finite_product_relation_plugin & get_plugin() const { @@ -342,22 +342,22 @@ namespace datalog { /** The function calls garbage_collect, so the internal state may change when it is called. */ - virtual bool empty() const; - void reset() { m_table->reset(); garbage_collect(false); } + bool empty() const override; + void reset() override { m_table->reset(); garbage_collect(false); } - virtual void add_fact(const relation_fact & f); - virtual bool contains_fact(const relation_fact & f) const; + void add_fact(const relation_fact & f) override; + bool contains_fact(const relation_fact & f) const override; - virtual finite_product_relation * clone() const; - virtual finite_product_relation * complement(func_decl* p) const; + finite_product_relation * clone() const override; + finite_product_relation * complement(func_decl* p) const override; - virtual void display(std::ostream & out) const; - virtual void display_tuples(func_decl & pred, std::ostream & out) const; + void display(std::ostream & out) const override; + void display_tuples(func_decl & pred, std::ostream & out) const override; - virtual unsigned get_size_estimate_rows() const { return m_table->get_size_estimate_rows(); } - virtual unsigned get_size_estimate_bytes() const { return m_table->get_size_estimate_bytes(); } + unsigned get_size_estimate_rows() const override { return m_table->get_size_estimate_rows(); } + unsigned get_size_estimate_bytes() const override { return m_table->get_size_estimate_bytes(); } - virtual void to_formula(expr_ref& fml) const; + void to_formula(expr_ref& fml) const override; }; }; diff --git a/src/muz/rel/dl_instruction.cpp b/src/muz/rel/dl_instruction.cpp index 26139fb7c..d82f42b19 100644 --- a/src/muz/rel/dl_instruction.cpp +++ b/src/muz/rel/dl_instruction.cpp @@ -192,7 +192,7 @@ namespace datalog { public: instr_io(bool store, func_decl_ref const& pred, reg_idx reg) : m_store(store), m_pred(pred), m_reg(reg) {} - virtual bool perform(execution_context & ctx) { + bool perform(execution_context & ctx) override { log_verbose(ctx); if (m_store) { if (ctx.reg(m_reg)) { @@ -218,10 +218,10 @@ namespace datalog { } return true; } - virtual void make_annotations(execution_context & ctx) { + void make_annotations(execution_context & ctx) override { ctx.set_register_annotation(m_reg, m_pred->get_name().bare_str()); } - virtual void display_head_impl(execution_context const& ctx, std::ostream & out) const { + void display_head_impl(execution_context const& ctx, std::ostream & out) const override { const char * rel_name = m_pred->get_name().bare_str(); if (m_store) { out << "store " << m_reg << " into " << rel_name; @@ -245,14 +245,14 @@ namespace datalog { reg_idx m_reg; public: instr_dealloc(reg_idx reg) : m_reg(reg) {} - virtual bool perform(execution_context & ctx) { + bool perform(execution_context & ctx) override { ctx.make_empty(m_reg); return true; } - virtual void make_annotations(execution_context & ctx) { + void make_annotations(execution_context & ctx) override { ctx.set_register_annotation(m_reg, "alloc"); } - virtual void display_head_impl(execution_context const& ctx, std::ostream & out) const { + void display_head_impl(execution_context const& ctx, std::ostream & out) const override { out << "dealloc " << m_reg; } }; @@ -268,7 +268,7 @@ namespace datalog { public: instr_clone_move(bool clone, reg_idx src, reg_idx tgt) : m_clone(clone), m_src(src), m_tgt(tgt) {} - virtual bool perform(execution_context & ctx) { + bool perform(execution_context & ctx) override { if (ctx.reg(m_src)) log_verbose(ctx); if (m_clone) { ctx.set_reg(m_tgt, ctx.reg(m_src) ? ctx.reg(m_src)->clone() : 0); @@ -278,7 +278,7 @@ namespace datalog { } return true; } - virtual void make_annotations(execution_context & ctx) { + void make_annotations(execution_context & ctx) override { std::string str; if (ctx.get_register_annotation(m_src, str)) { ctx.set_register_annotation(m_tgt, str); @@ -287,7 +287,7 @@ namespace datalog { ctx.set_register_annotation(m_src, str); } } - virtual void display_head_impl(execution_context const& ctx, std::ostream & out) const { + void display_head_impl(execution_context const& ctx, std::ostream & out) const override { out << (m_clone ? "clone " : "move ") << m_src << " into " << m_tgt; } }; @@ -317,17 +317,17 @@ namespace datalog { return true; } protected: - virtual void process_all_costs() { + void process_all_costs() override { instruction::process_all_costs(); m_body->process_all_costs(); } public: instr_while_loop(unsigned control_reg_cnt, const reg_idx * control_regs, instruction_block * body) : m_controls(control_reg_cnt, control_regs), m_body(body) {} - virtual ~instr_while_loop() { + ~instr_while_loop() override { dealloc(m_body); } - virtual bool perform(execution_context & ctx) { + bool perform(execution_context & ctx) override { log_verbose(ctx); TRACE("dl", tout << "loop entered\n";); unsigned count = 0; @@ -341,14 +341,14 @@ namespace datalog { TRACE("dl", tout << "while loop exited\n";); return true; } - virtual void make_annotations(execution_context & ctx) { + void make_annotations(execution_context & ctx) override { m_body->make_annotations(ctx); } - virtual void display_head_impl(execution_context const & ctx, std::ostream & out) const { + void display_head_impl(execution_context const & ctx, std::ostream & out) const override { out << "while"; print_container(m_controls, out); } - virtual void display_body_impl(execution_context const & ctx, std::ostream & out, const std::string & indentation) const { + void display_body_impl(execution_context const & ctx, std::ostream & out, const std::string & indentation) const override { m_body->display_indented(ctx, out, indentation+" "); } }; @@ -371,7 +371,7 @@ namespace datalog { const unsigned * cols2, reg_idx result) : m_rel1(rel1), m_rel2(rel2), m_cols1(col_cnt, cols1), m_cols2(col_cnt, cols2), m_res(result) {} - virtual bool perform(execution_context & ctx) { + bool perform(execution_context & ctx) override { log_verbose(ctx); ++ctx.m_stats.m_join; if (!ctx.reg(m_rel1) || !ctx.reg(m_rel2)) { @@ -408,13 +408,13 @@ namespace datalog { } return true; } - virtual void make_annotations(execution_context & ctx) { + void make_annotations(execution_context & ctx) override { std::string a1 = "rel1", a2 = "rel2"; ctx.get_register_annotation(m_rel1, a1); ctx.get_register_annotation(m_rel1, a1); ctx.set_register_annotation(m_res, "join " + a1 + " " + a2); } - virtual void display_head_impl(execution_context const & ctx, std::ostream & out) const { + void display_head_impl(execution_context const & ctx, std::ostream & out) const override { out << "join " << m_rel1; print_container(m_cols1, out); out << " and " << m_rel2; @@ -435,7 +435,7 @@ namespace datalog { public: instr_filter_equal(ast_manager & m, reg_idx reg, const relation_element & value, unsigned col) : m_reg(reg), m_value(value, m), m_col(col) {} - virtual bool perform(execution_context & ctx) { + bool perform(execution_context & ctx) override { log_verbose(ctx); ++ctx.m_stats.m_filter_eq; if (!ctx.reg(m_reg)) { @@ -460,12 +460,12 @@ namespace datalog { } return true; } - virtual void make_annotations(execution_context & ctx) { + void make_annotations(execution_context & ctx) override { std::stringstream a; a << "filter_equal " << m_col << " val: " << ctx.get_rel_context().get_rmanager().to_nice_string(m_value); ctx.set_register_annotation(m_reg, a.str()); } - virtual void display_head_impl(execution_context const& ctx, std::ostream & out) const { + void display_head_impl(execution_context const& ctx, std::ostream & out) const override { out << "filter_equal " << m_reg << " col: " << m_col << " val: " << ctx.get_rel_context().get_rmanager().to_nice_string(m_value); } @@ -484,7 +484,7 @@ namespace datalog { public: instr_filter_identical(reg_idx reg, unsigned col_cnt, const unsigned * identical_cols) : m_reg(reg), m_cols(col_cnt, identical_cols) {} - virtual bool perform(execution_context & ctx) { + bool perform(execution_context & ctx) override { log_verbose(ctx); ++ctx.m_stats.m_filter_id; if (!ctx.reg(m_reg)) { @@ -509,11 +509,11 @@ namespace datalog { } return true; } - virtual void display_head_impl(execution_context const& ctx, std::ostream & out) const { + void display_head_impl(execution_context const& ctx, std::ostream & out) const override { out << "filter_identical " << m_reg << " "; print_container(m_cols, out); } - virtual void make_annotations(execution_context & ctx) { + void make_annotations(execution_context & ctx) override { ctx.set_register_annotation(m_reg, "filter_identical"); } }; @@ -529,7 +529,7 @@ namespace datalog { public: instr_filter_interpreted(reg_idx reg, app_ref & condition) : m_reg(reg), m_cond(condition) {} - virtual bool perform(execution_context & ctx) { + bool perform(execution_context & ctx) override { if (!ctx.reg(m_reg)) { return true; } @@ -557,11 +557,11 @@ namespace datalog { return true; } - virtual void display_head_impl(execution_context const& ctx, std::ostream & out) const { + void display_head_impl(execution_context const& ctx, std::ostream & out) const override { out << "filter_interpreted " << m_reg << " using " << mk_pp(m_cond, m_cond.get_manager()); } - virtual void make_annotations(execution_context & ctx) { + void make_annotations(execution_context & ctx) override { std::stringstream a; a << "filter_interpreted " << mk_pp(m_cond, m_cond.get_manager()); ctx.set_register_annotation(m_reg, a.str()); @@ -584,7 +584,7 @@ namespace datalog { : m_src(src), m_cond(condition), m_cols(col_cnt, removed_cols), m_res(result) {} - virtual bool perform(execution_context & ctx) { + bool perform(execution_context & ctx) override { log_verbose(ctx); if (!ctx.reg(m_src)) { ctx.make_empty(m_res); @@ -614,14 +614,14 @@ namespace datalog { return true; } - virtual void display_head_impl(execution_context const& ctx, std::ostream & out) const { + void display_head_impl(execution_context const& ctx, std::ostream & out) const override { out << "filter_interpreted_and_project " << m_src << " into " << m_res; out << " using " << mk_pp(m_cond, m_cond.get_manager()); out << " deleting columns "; print_container(m_cols, out); } - virtual void make_annotations(execution_context & ctx) { + void make_annotations(execution_context & ctx) override { std::stringstream s; std::string a = "rel_src"; ctx.get_register_annotation(m_src, a); @@ -644,7 +644,7 @@ namespace datalog { public: instr_union(reg_idx src, reg_idx tgt, reg_idx delta, bool widen) : m_src(src), m_tgt(tgt), m_delta(delta), m_widen(widen) {} - virtual bool perform(execution_context & ctx) { + bool perform(execution_context & ctx) override { TRACE("dl", tout << "union " << m_src << " into " << m_tgt << " " << ctx.reg(m_src) << " " << ctx.reg(m_tgt) << "\n";); if (!ctx.reg(m_src)) { @@ -721,7 +721,7 @@ namespace datalog { return true; } - virtual void make_annotations(execution_context & ctx) { + void make_annotations(execution_context & ctx) override { std::string str = "union"; if (!ctx.get_register_annotation(m_tgt, str)) { ctx.set_register_annotation(m_tgt, "union"); @@ -731,7 +731,7 @@ namespace datalog { } ctx.set_register_annotation(m_delta, str); } - virtual void display_head_impl(execution_context const& ctx, std::ostream & out) const { + void display_head_impl(execution_context const& ctx, std::ostream & out) const override { out << (m_widen ? "widen " : "union ") << m_src << " into " << m_tgt; if (m_delta!=execution_context::void_register) { out << " with delta " << m_delta; @@ -758,7 +758,7 @@ namespace datalog { instr_project_rename(bool projection, reg_idx src, unsigned col_cnt, const unsigned * cols, reg_idx tgt) : m_projection(projection), m_src(src), m_cols(col_cnt, cols), m_tgt(tgt) {} - virtual bool perform(execution_context & ctx) { + bool perform(execution_context & ctx) override { if (!ctx.reg(m_src)) { ctx.make_empty(m_tgt); return true; @@ -787,12 +787,12 @@ namespace datalog { return true; } - virtual void display_head_impl(execution_context const& ctx, std::ostream & out) const { + void display_head_impl(execution_context const& ctx, std::ostream & out) const override { out << (m_projection ? "project " : "rename ") << m_src << " into " << m_tgt; out << (m_projection ? " deleting columns " : " with cycle "); print_container(m_cols, out); } - virtual void make_annotations(execution_context & ctx) { + void make_annotations(execution_context & ctx) override { std::stringstream s; std::string a = "rel_src"; ctx.get_register_annotation(m_src, a); @@ -825,7 +825,7 @@ namespace datalog { : m_rel1(rel1), m_rel2(rel2), m_cols1(joined_col_cnt, cols1), m_cols2(joined_col_cnt, cols2), m_removed_cols(removed_col_cnt, removed_cols), m_res(result) { } - virtual bool perform(execution_context & ctx) { + bool perform(execution_context & ctx) override { log_verbose(ctx); if (!ctx.reg(m_rel1) || !ctx.reg(m_rel2)) { ctx.make_empty(m_res); @@ -852,7 +852,7 @@ namespace datalog { } return true; } - virtual void display_head_impl(execution_context const& ctx, std::ostream & out) const { + void display_head_impl(execution_context const& ctx, std::ostream & out) const override { relation_base const* r1 = ctx.reg(m_rel1); relation_base const* r2 = ctx.reg(m_rel2); out << "join_project " << m_rel1; @@ -870,7 +870,7 @@ namespace datalog { out << " into " << m_res << " removing columns "; print_container(m_removed_cols, out); } - virtual void make_annotations(execution_context & ctx) { + void make_annotations(execution_context & ctx) override { std::string s1 = "rel1", s2 = "rel2"; ctx.get_register_annotation(m_rel1, s1); ctx.get_register_annotation(m_rel2, s2); @@ -898,7 +898,7 @@ namespace datalog { // TRACE("dl", tout << "src:" << m_src << " result: " << m_result << " value:" << m_value << " column:" << m_col << "\n";); } - virtual bool perform(execution_context & ctx) { + bool perform(execution_context & ctx) override { if (!ctx.reg(m_src)) { ctx.make_empty(m_result); return true; @@ -923,11 +923,11 @@ namespace datalog { } return true; } - virtual void display_head_impl(execution_context const& ctx, std::ostream & out) const { + void display_head_impl(execution_context const& ctx, std::ostream & out) const override { out << "select_equal_and_project " << m_src <<" into " << m_result << " col: " << m_col << " val: " << ctx.get_rel_context().get_rmanager().to_nice_string(m_value); } - virtual void make_annotations(execution_context & ctx) { + void make_annotations(execution_context & ctx) override { std::stringstream s; std::string s1 = "src"; ctx.get_register_annotation(m_src, s1); @@ -953,7 +953,7 @@ namespace datalog { instr_filter_by_negation(reg_idx tgt, reg_idx neg_rel, unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) : m_tgt(tgt), m_neg_rel(neg_rel), m_cols1(col_cnt, cols1), m_cols2(col_cnt, cols2) {} - virtual bool perform(execution_context & ctx) { + bool perform(execution_context & ctx) override { log_verbose(ctx); if (!ctx.reg(m_tgt) || !ctx.reg(m_neg_rel)) { return true; @@ -980,14 +980,14 @@ namespace datalog { } return true; } - virtual void display_head_impl(execution_context const& ctx, std::ostream & out) const { + void display_head_impl(execution_context const& ctx, std::ostream & out) const override { out << "filter_by_negation on " << m_tgt; print_container(m_cols1, out); out << " with " << m_neg_rel; print_container(m_cols2, out); out << " as the negated table"; } - virtual void make_annotations(execution_context & ctx) { + void make_annotations(execution_context & ctx) override { std::string s = "negated relation"; ctx.get_register_annotation(m_neg_rel, s); ctx.set_register_annotation(m_tgt, "filter by negation " + s); @@ -1011,7 +1011,7 @@ namespace datalog { m_sig.push_back(s); m_fact.push_back(val); } - virtual bool perform(execution_context & ctx) { + bool perform(execution_context & ctx) override { log_verbose(ctx); ++ctx.m_stats.m_unary_singleton; relation_base * rel = ctx.get_rel_context().get_rmanager().mk_empty_relation(m_sig, m_pred); @@ -1019,12 +1019,12 @@ namespace datalog { ctx.set_reg(m_tgt, rel); return true; } - virtual void display_head_impl(execution_context const& ctx, std::ostream & out) const { + void display_head_impl(execution_context const& ctx, std::ostream & out) const override { out << "mk_unary_singleton into " << m_tgt << " sort:" << ctx.get_rel_context().get_rmanager().to_nice_string(m_sig[0]) << " val:" << ctx.get_rel_context().get_rmanager().to_nice_string(m_sig[0], m_fact[0]); } - virtual void make_annotations(execution_context & ctx) { + void make_annotations(execution_context & ctx) override { std::string s; if (!ctx.get_register_annotation(m_tgt, s)) { ctx.set_register_annotation(m_tgt, "mk unary singleton"); @@ -1044,18 +1044,18 @@ namespace datalog { reg_idx m_tgt; public: instr_mk_total(const relation_signature & sig, func_decl* p, reg_idx tgt) : m_sig(sig), m_pred(p), m_tgt(tgt) {} - virtual bool perform(execution_context & ctx) { + bool perform(execution_context & ctx) override { log_verbose(ctx); ++ctx.m_stats.m_total; ctx.set_reg(m_tgt, ctx.get_rel_context().get_rmanager().mk_full_relation(m_sig, m_pred)); return true; } - virtual void display_head_impl(execution_context const& ctx, std::ostream & out) const { + void display_head_impl(execution_context const& ctx, std::ostream & out) const override { out << "mk_total into " << m_tgt << " sort:" << ctx.get_rel_context().get_rmanager().to_nice_string(m_sig) << " " << m_pred->get_name(); } - virtual void make_annotations(execution_context & ctx) { + void make_annotations(execution_context & ctx) override { std::string s; if (!ctx.get_register_annotation(m_tgt, s)) { ctx.set_register_annotation(m_tgt, "mk_total"); @@ -1072,15 +1072,15 @@ namespace datalog { public: instr_mark_saturated(ast_manager & m, func_decl * pred) : m_pred(pred, m) {} - virtual bool perform(execution_context & ctx) { + bool perform(execution_context & ctx) override { log_verbose(ctx); ctx.get_rel_context().get_rmanager().mark_saturated(m_pred); return true; } - virtual void display_head_impl(execution_context const& ctx, std::ostream & out) const { + void display_head_impl(execution_context const& ctx, std::ostream & out) const override { out << "mark_saturated " << m_pred->get_name().bare_str(); } - virtual void make_annotations(execution_context & ctx) { + void make_annotations(execution_context & ctx) override { } }; @@ -1094,18 +1094,18 @@ namespace datalog { public: instr_assert_signature(const relation_signature & s, reg_idx tgt) : m_sig(s), m_tgt(tgt) {} - virtual bool perform(execution_context & ctx) { + bool perform(execution_context & ctx) override { log_verbose(ctx); if (ctx.reg(m_tgt)) { SASSERT(ctx.reg(m_tgt)->get_signature()==m_sig); } return true; } - virtual void display_head_impl(execution_context const& ctx, std::ostream & out) const { + void display_head_impl(execution_context const& ctx, std::ostream & out) const override { out << "instr_assert_signature of " << m_tgt << " signature:"; print_container(m_sig, out); } - virtual void make_annotations(execution_context & ctx) { + void make_annotations(execution_context & ctx) override { std::string s; if (!ctx.get_register_annotation(m_tgt, s)) { ctx.set_register_annotation(m_tgt, "assert signature"); diff --git a/src/muz/rel/dl_interval_relation.cpp b/src/muz/rel/dl_interval_relation.cpp index e14d242bb..12b6815cc 100644 --- a/src/muz/rel/dl_interval_relation.cpp +++ b/src/muz/rel/dl_interval_relation.cpp @@ -59,7 +59,7 @@ namespace datalog { : convenient_relation_join_fn(o1_sig, o2_sig, col_cnt, cols1, cols2){ } - virtual relation_base * operator()(const relation_base & _r1, const relation_base & _r2) { + relation_base * operator()(const relation_base & _r1, const relation_base & _r2) override { interval_relation const& r1 = get(_r1); interval_relation const& r2 = get(_r2); interval_relation_plugin& p = r1.get_plugin(); @@ -84,7 +84,7 @@ namespace datalog { : convenient_relation_project_fn(orig_sig, removed_col_cnt, removed_cols) { } - virtual relation_base * operator()(const relation_base & _r) { + relation_base * operator()(const relation_base & _r) override { interval_relation const& r = get(_r); interval_relation_plugin& p = r.get_plugin(); interval_relation* result = dynamic_cast(p.mk_full(0, get_result_signature())); @@ -104,7 +104,7 @@ namespace datalog { : convenient_relation_rename_fn(orig_sig, cycle_len, cycle) { } - virtual relation_base * operator()(const relation_base & _r) { + relation_base * operator()(const relation_base & _r) override { interval_relation const& r = get(_r); interval_relation_plugin& p = r.get_plugin(); interval_relation* result = dynamic_cast(p.mk_full(0, get_result_signature())); @@ -198,7 +198,7 @@ namespace datalog { m_is_widen(is_widen) { } - virtual void operator()(relation_base & _r, const relation_base & _src, relation_base * _delta) { + void operator()(relation_base & _r, const relation_base & _src, relation_base * _delta) override { TRACE("interval_relation", _r.display(tout << "dst:\n"); _src.display(tout << "src:\n");); @@ -237,7 +237,7 @@ namespace datalog { filter_identical_fn(unsigned col_cnt, const unsigned * identical_cols) : m_identical_cols(col_cnt, identical_cols) {} - virtual void operator()(relation_base & r) { + void operator()(relation_base & r) override { interval_relation & pr = get(r); for (unsigned i = 1; i < m_identical_cols.size(); ++i) { unsigned c1 = m_identical_cols[0]; @@ -266,7 +266,7 @@ namespace datalog { VERIFY(arith.is_numeral(value, m_value)); } - virtual void operator()(relation_base & _r) { + void operator()(relation_base & _r) override { interval_relation & r = get(_r); interval_relation_plugin & p = r.get_plugin(); r.mk_intersect(m_col, interval(p.dep(), m_value)); @@ -290,7 +290,7 @@ namespace datalog { m_cond(cond, t.get_plugin().get_ast_manager()) { } - void operator()(relation_base& t) { + void operator()(relation_base& t) override { get(t).filter_interpreted(m_cond); TRACE("interval_relation", tout << mk_pp(m_cond, m_cond.get_manager()) << "\n"; t.display(tout);); } diff --git a/src/muz/rel/dl_interval_relation.h b/src/muz/rel/dl_interval_relation.h index a9cce9802..896bb30ab 100644 --- a/src/muz/rel/dl_interval_relation.h +++ b/src/muz/rel/dl_interval_relation.h @@ -53,25 +53,25 @@ namespace datalog { public: interval_relation_plugin(relation_manager& m); - virtual bool can_handle_signature(const relation_signature & s); + bool can_handle_signature(const relation_signature & s) override; static symbol get_name() { return symbol("interval_relation"); } - virtual relation_base * mk_empty(const relation_signature & s); - virtual relation_base * mk_full(func_decl* p, const relation_signature & s); - virtual relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2, - unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); - virtual relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, - const unsigned * removed_cols); - virtual relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, - const unsigned * permutation_cycle); - virtual relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, - const relation_base * delta); - virtual relation_union_fn * mk_widen_fn(const relation_base & tgt, const relation_base & src, - const relation_base * delta); - virtual relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, - const unsigned * identical_cols); - virtual relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, - unsigned col); - virtual relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition); + relation_base * mk_empty(const relation_signature & s) override; + relation_base * mk_full(func_decl* p, const relation_signature & s) override; + relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2, + unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override; + relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, + const unsigned * removed_cols) override; + relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, + const unsigned * permutation_cycle) override; + relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, + const relation_base * delta) override; + relation_union_fn * mk_widen_fn(const relation_base & tgt, const relation_base & src, + const relation_base * delta) override; + relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, + const unsigned * identical_cols) override; + relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, + unsigned col) override; + relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition) override; static bool is_empty(unsigned idx, interval const& i); static bool is_infinite(interval const& i); @@ -97,39 +97,39 @@ namespace datalog { public: interval_relation(interval_relation_plugin& p, relation_signature const& s, bool is_empty); - virtual void add_fact(const relation_fact & f); - virtual bool contains_fact(const relation_fact & f) const; - virtual interval_relation * clone() const; - virtual interval_relation * complement(func_decl*) const; - virtual void to_formula(expr_ref& fml) const; + void add_fact(const relation_fact & f) override; + bool contains_fact(const relation_fact & f) const override; + interval_relation * clone() const override; + interval_relation * complement(func_decl*) const override; + void to_formula(expr_ref& fml) const override; interval_relation_plugin& get_plugin() const; void filter_interpreted(app* cond); - virtual bool is_precise() const { return false; } + bool is_precise() const override { return false; } private: - virtual interval mk_intersect(interval const& t1, interval const& t2, bool& is_empty) const { + interval mk_intersect(interval const& t1, interval const& t2, bool& is_empty) const override { return get_plugin().meet(t1, t2, is_empty); } - virtual interval mk_unite(interval const& t1, interval const& t2) const { return get_plugin().unite(t1,t2); } + interval mk_unite(interval const& t1, interval const& t2) const override { return get_plugin().unite(t1,t2); } - virtual interval mk_widen(interval const& t1, interval const& t2) const { return get_plugin().widen(t1,t2); } + interval mk_widen(interval const& t1, interval const& t2) const override { return get_plugin().widen(t1,t2); } - virtual bool is_subset_of(interval const& t1, interval const& t2) const { NOT_IMPLEMENTED_YET(); return false; } + bool is_subset_of(interval const& t1, interval const& t2) const override { NOT_IMPLEMENTED_YET(); return false; } - virtual bool is_full(interval const& t) const { + bool is_full(interval const& t) const override { return interval_relation_plugin::is_infinite(t); } - virtual bool is_empty(unsigned idx, interval const& t) const { + bool is_empty(unsigned idx, interval const& t) const override { return interval_relation_plugin::is_empty(idx, t); } - virtual void mk_rename_elem(interval& i, unsigned col_cnt, unsigned const* cycle); + void mk_rename_elem(interval& i, unsigned col_cnt, unsigned const* cycle) override; - virtual void display_index(unsigned idx, interval const & i, std::ostream& out) const; + void display_index(unsigned idx, interval const & i, std::ostream& out) const override; void mk_intersect(unsigned idx, interval const& i); diff --git a/src/muz/rel/dl_lazy_table.cpp b/src/muz/rel/dl_lazy_table.cpp index 54105891a..1b8681ab0 100644 --- a/src/muz/rel/dl_lazy_table.cpp +++ b/src/muz/rel/dl_lazy_table.cpp @@ -50,7 +50,7 @@ namespace datalog { unsigned const* cols1, unsigned const* cols2): convenient_table_join_fn(s1, s2, col_cnt, cols1, cols2) {} - virtual table_base* operator()(const table_base& _t1, const table_base& _t2) { + table_base* operator()(const table_base& _t1, const table_base& _t2) override { lazy_table const& t1 = get(_t1); lazy_table const& t2 = get(_t2); lazy_table_ref* tr = alloc(lazy_table_join, m_cols1.size(), m_cols1.c_ptr(), m_cols2.c_ptr(), t1, t2, get_result_signature()); @@ -75,7 +75,7 @@ namespace datalog { class lazy_table_plugin::union_fn : public table_union_fn { public: void operator()(table_base & _tgt, const table_base & _src, - table_base * _delta) { + table_base * _delta) override { lazy_table& tgt = get(_tgt); lazy_table const& src = get(_src); lazy_table* delta = get(_delta); @@ -111,7 +111,7 @@ namespace datalog { convenient_table_project_fn(orig_sig, cnt, cols) {} - virtual table_base* operator()(table_base const& _t) { + table_base* operator()(table_base const& _t) override { lazy_table const& t = get(_t); return alloc(lazy_table, alloc(lazy_table_project, m_removed_cols.size(), m_removed_cols.c_ptr(), t, get_result_signature())); } @@ -137,7 +137,7 @@ namespace datalog { convenient_table_rename_fn(orig_sig, cnt, cols) {} - virtual table_base* operator()(table_base const& _t) { + table_base* operator()(table_base const& _t) override { lazy_table const& t = get(_t); return alloc(lazy_table, alloc(lazy_table_rename, m_cycle.size(), m_cycle.c_ptr(), t, get_result_signature())); } @@ -163,7 +163,7 @@ namespace datalog { public: filter_identical_fn(unsigned cnt, unsigned const* cols): m_cols(cnt, cols) {} - virtual void operator()(table_base& _t) { + void operator()(table_base& _t) override { lazy_table& t = get(_t); t.set(alloc(lazy_table_filter_identical, m_cols.size(), m_cols.c_ptr(), t)); } @@ -188,7 +188,7 @@ namespace datalog { public: filter_interpreted_fn(app_ref& p): m_condition(p) {} - virtual void operator()(table_base& _t) { + void operator()(table_base& _t) override { lazy_table& t = get(_t); t.set(alloc(lazy_table_filter_interpreted, t, m_condition)); } @@ -214,7 +214,7 @@ namespace datalog { public: filter_by_negation_fn(unsigned cnt, unsigned const* cols1, unsigned const* cols2): m_cols1(cnt, cols1), m_cols2(cnt, cols2) {} - virtual void operator()(table_base & _t, const table_base & _intersected_obj) { + void operator()(table_base & _t, const table_base & _intersected_obj) override { lazy_table& t = get(_t); lazy_table const& it = get(_intersected_obj); t.set(alloc(lazy_table_filter_by_negation, t, it, m_cols1, m_cols2)); @@ -246,7 +246,7 @@ namespace datalog { m_col(col) { } - virtual void operator()(table_base& _t) { + void operator()(table_base& _t) override { lazy_table& t = get(_t); t.set(alloc(lazy_table_filter_equal, m_col, m_value, t)); } diff --git a/src/muz/rel/dl_lazy_table.h b/src/muz/rel/dl_lazy_table.h index 6752e5a5a..19ea6773e 100644 --- a/src/muz/rel/dl_lazy_table.h +++ b/src/muz/rel/dl_lazy_table.h @@ -48,37 +48,37 @@ namespace datalog { table_plugin(mk_name(p), p.get_manager()), m_plugin(p) {} - virtual bool can_handle_signature(const table_signature & s) { + bool can_handle_signature(const table_signature & s) override { return m_plugin.can_handle_signature(s); } - virtual table_base * mk_empty(const table_signature & s); + table_base * mk_empty(const table_signature & s) override; static table_plugin* mk_sparse(relation_manager& rm); protected: - virtual table_join_fn * mk_join_fn( + table_join_fn * mk_join_fn( const table_base & t1, const table_base & t2, - unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); - virtual table_union_fn * mk_union_fn( - const table_base & tgt, const table_base & src, - const table_base * delta); - virtual table_transformer_fn * mk_project_fn( - const table_base & t, unsigned col_cnt, - const unsigned * removed_cols); - virtual table_transformer_fn * mk_rename_fn( + unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override; + table_union_fn * mk_union_fn( + const table_base & tgt, const table_base & src, + const table_base * delta) override; + table_transformer_fn * mk_project_fn( + const table_base & t, unsigned col_cnt, + const unsigned * removed_cols) override; + table_transformer_fn * mk_rename_fn( const table_base & t, unsigned permutation_cycle_len, - const unsigned * permutation_cycle); - virtual table_mutator_fn * mk_filter_identical_fn( - const table_base & t, unsigned col_cnt, const unsigned * identical_cols); - virtual table_mutator_fn * mk_filter_equal_fn( - const table_base & t, const table_element & value, unsigned col); - virtual table_mutator_fn * mk_filter_interpreted_fn( - const table_base & t, app * condition); - virtual table_intersection_filter_fn * mk_filter_by_negation_fn( - const table_base & t, - const table_base & negated_obj, unsigned joined_col_cnt, - const unsigned * t_cols, const unsigned * negated_cols); + const unsigned * permutation_cycle) override; + table_mutator_fn * mk_filter_identical_fn( + const table_base & t, unsigned col_cnt, const unsigned * identical_cols) override; + table_mutator_fn * mk_filter_equal_fn( + const table_base & t, const table_element & value, unsigned col) override; + table_mutator_fn * mk_filter_interpreted_fn( + const table_base & t, app * condition) override; + table_intersection_filter_fn * mk_filter_by_negation_fn( + const table_base & t, + const table_base & negated_obj, unsigned joined_col_cnt, + const unsigned * t_cols, const unsigned * negated_cols) override; static lazy_table const& get(table_base const& tb); static lazy_table& get(table_base& tb); @@ -129,30 +129,30 @@ namespace datalog { m_ref(t) {} - virtual ~lazy_table() {} + ~lazy_table() override {} lazy_table_plugin& get_lplugin() const { return dynamic_cast(table_base::get_plugin()); } - virtual table_base * clone() const; - virtual table_base * complement(func_decl* p, const table_element * func_columns = 0) const; - virtual bool empty() const; - virtual bool contains_fact(const table_fact & f) const; - virtual void remove_fact(table_element const* fact); - virtual void remove_facts(unsigned fact_cnt, const table_fact * facts); - virtual void remove_facts(unsigned fact_cnt, const table_element * facts); - virtual void reset(); - virtual void add_fact(table_fact const& f); + table_base * clone() const override; + table_base * complement(func_decl* p, const table_element * func_columns = 0) const override; + bool empty() const override; + bool contains_fact(const table_fact & f) const override; + void remove_fact(table_element const* fact) override; + void remove_facts(unsigned fact_cnt, const table_fact * facts) override; + void remove_facts(unsigned fact_cnt, const table_element * facts) override; + void reset() override; + void add_fact(table_fact const& f) override; - virtual unsigned get_size_estimate_rows() const { return 1; } - virtual unsigned get_size_estimate_bytes() const { return 1; } - virtual bool knows_exact_size() const { return false; } + unsigned get_size_estimate_rows() const override { return 1; } + unsigned get_size_estimate_bytes() const override { return 1; } + bool knows_exact_size() const override { return false; } table_base* eval() const; - virtual table_base::iterator begin() const; - virtual table_base::iterator end() const; + table_base::iterator begin() const override; + table_base::iterator end() const override; lazy_table_ref* get_ref() const { return m_ref.get(); } void set(lazy_table_ref* r) { m_ref = r; } @@ -165,9 +165,9 @@ namespace datalog { m_table = table; // SASSERT(&p.m_plugin == &table->get_lplugin()); } - virtual ~lazy_table_base() {} - virtual lazy_table_kind kind() const { return LAZY_TABLE_BASE; } - virtual table_base* force() { return m_table.get(); } + ~lazy_table_base() override {} + lazy_table_kind kind() const override { return LAZY_TABLE_BASE; } + table_base* force() override { return m_table.get(); } }; class lazy_table_join : public lazy_table_ref { @@ -184,13 +184,13 @@ namespace datalog { m_cols2(col_cnt, cols2), m_t1(t1.get_ref()), m_t2(t2.get_ref()) { } - virtual ~lazy_table_join() {} - virtual lazy_table_kind kind() const { return LAZY_TABLE_JOIN; } + ~lazy_table_join() override {} + lazy_table_kind kind() const override { return LAZY_TABLE_JOIN; } unsigned_vector const& cols1() const { return m_cols1; } unsigned_vector const& cols2() const { return m_cols2; } lazy_table_ref* t1() const { return m_t1.get(); } lazy_table_ref* t2() const { return m_t2.get(); } - virtual table_base* force(); + table_base* force() override; }; @@ -202,12 +202,12 @@ namespace datalog { : lazy_table_ref(src.get_lplugin(), sig), m_cols(col_cnt, cols), m_src(src.get_ref()) {} - virtual ~lazy_table_project() {} + ~lazy_table_project() override {} - virtual lazy_table_kind kind() const { return LAZY_TABLE_PROJECT; } + lazy_table_kind kind() const override { return LAZY_TABLE_PROJECT; } unsigned_vector const& cols() const { return m_cols; } lazy_table_ref* src() const { return m_src.get(); } - virtual table_base* force(); + table_base* force() override; }; class lazy_table_rename : public lazy_table_ref { @@ -218,12 +218,12 @@ namespace datalog { : lazy_table_ref(src.get_lplugin(), sig), m_cols(col_cnt, cols), m_src(src.get_ref()) {} - virtual ~lazy_table_rename() {} + ~lazy_table_rename() override {} - virtual lazy_table_kind kind() const { return LAZY_TABLE_RENAME; } + lazy_table_kind kind() const override { return LAZY_TABLE_RENAME; } unsigned_vector const& cols() const { return m_cols; } lazy_table_ref* src() const { return m_src.get(); } - virtual table_base* force(); + table_base* force() override; }; class lazy_table_filter_identical : public lazy_table_ref { @@ -232,12 +232,12 @@ namespace datalog { public: lazy_table_filter_identical(unsigned col_cnt, const unsigned * cols, lazy_table const& src) : lazy_table_ref(src.get_lplugin(), src.get_signature()), m_cols(col_cnt, cols), m_src(src.get_ref()) {} - virtual ~lazy_table_filter_identical() {} + ~lazy_table_filter_identical() override {} - virtual lazy_table_kind kind() const { return LAZY_TABLE_FILTER_IDENTICAL; } + lazy_table_kind kind() const override { return LAZY_TABLE_FILTER_IDENTICAL; } unsigned_vector const& cols() const { return m_cols; } lazy_table_ref* src() const { return m_src.get(); } - virtual table_base* force(); + table_base* force() override; }; class lazy_table_filter_equal : public lazy_table_ref { @@ -250,13 +250,13 @@ namespace datalog { m_col(col), m_value(value), m_src(src.get_ref()) {} - virtual ~lazy_table_filter_equal() {} + ~lazy_table_filter_equal() override {} - virtual lazy_table_kind kind() const { return LAZY_TABLE_FILTER_EQUAL; } + lazy_table_kind kind() const override { return LAZY_TABLE_FILTER_EQUAL; } unsigned col() const { return m_col; } table_element value() const { return m_value; } lazy_table_ref* src() const { return m_src.get(); } - virtual table_base* force(); + table_base* force() override; }; class lazy_table_filter_interpreted : public lazy_table_ref { @@ -266,12 +266,12 @@ namespace datalog { lazy_table_filter_interpreted(lazy_table const& src, app* condition) : lazy_table_ref(src.get_lplugin(), src.get_signature()), m_condition(condition, src.get_lplugin().get_ast_manager()), m_src(src.get_ref()) {} - virtual ~lazy_table_filter_interpreted() {} + ~lazy_table_filter_interpreted() override {} - virtual lazy_table_kind kind() const { return LAZY_TABLE_FILTER_INTERPRETED; } + lazy_table_kind kind() const override { return LAZY_TABLE_FILTER_INTERPRETED; } app* condition() const { return m_condition; } lazy_table_ref* src() const { return m_src.get(); } - virtual table_base* force(); + table_base* force() override; }; @@ -288,13 +288,13 @@ namespace datalog { m_src(src.get_ref()), m_cols1(c1), m_cols2(c2) {} - virtual ~lazy_table_filter_by_negation() {} - virtual lazy_table_kind kind() const { return LAZY_TABLE_FILTER_BY_NEGATION; } + ~lazy_table_filter_by_negation() override {} + lazy_table_kind kind() const override { return LAZY_TABLE_FILTER_BY_NEGATION; } lazy_table_ref* tgt() const { return m_tgt.get(); } lazy_table_ref* src() const { return m_src.get(); } unsigned_vector const& cols1() const { return m_cols1; } unsigned_vector const& cols2() const { return m_cols2; } - virtual table_base* force(); + table_base* force() override; }; diff --git a/src/muz/rel/dl_mk_explanations.cpp b/src/muz/rel/dl_mk_explanations.cpp index ca04ca099..4823ffb9b 100644 --- a/src/muz/rel/dl_mk_explanations.cpp +++ b/src/muz/rel/dl_mk_explanations.cpp @@ -69,7 +69,7 @@ namespace datalog { m_relation_level_explanations(relation_level), m_union_decl(mk_explanations::get_union_decl(get_context()), get_ast_manager()) {} - ~explanation_relation_plugin() { + ~explanation_relation_plugin() override { for (unsigned i = 0; i < m_pool.size(); ++i) { for (unsigned j = 0; j < m_pool[i].size(); ++j) { dealloc(m_pool[i][j]); @@ -77,7 +77,7 @@ namespace datalog { } } - virtual bool can_handle_signature(const relation_signature & s) { + bool can_handle_signature(const relation_signature & s) override { unsigned n=s.size(); for (unsigned i=0; i(relation_base::get_plugin()); } - virtual void to_formula(expr_ref& fml) const { + void to_formula(expr_ref& fml) const override { ast_manager& m = fml.get_manager(); fml = m.mk_eq(m.mk_var(0, m.get_sort(m_data[0])), m_data[0]); } @@ -204,23 +204,23 @@ namespace datalog { return true; } - virtual bool empty() const { return m_empty; } + bool empty() const override { return m_empty; } - virtual void reset() { + void reset() override { m_empty = true; } - virtual void add_fact(const relation_fact & f) { + void add_fact(const relation_fact & f) override { SASSERT(empty()); assign_data(f); } - virtual bool contains_fact(const relation_fact & f) const { + bool contains_fact(const relation_fact & f) const override { UNREACHABLE(); throw 0; } - virtual explanation_relation * clone() const { + explanation_relation * clone() const override { explanation_relation * res = static_cast(get_plugin().mk_empty(get_signature())); res->m_empty = m_empty; SASSERT(res->m_data.empty()); @@ -228,7 +228,7 @@ namespace datalog { return res; } - virtual relation_base * complement(func_decl* pred) const { + relation_base * complement(func_decl* pred) const override { explanation_relation * res = static_cast(get_plugin().mk_empty(get_signature())); if (empty()) { res->set_undefined(); @@ -247,7 +247,7 @@ namespace datalog { } } - virtual void display(std::ostream & out) const { + void display(std::ostream & out) const override { if (empty()) { out << "\n"; return; @@ -298,7 +298,7 @@ namespace datalog { join_fn(const relation_signature & sig1, const relation_signature & sig2) : convenient_relation_join_fn(sig1, sig2, 0, 0, 0) {} - virtual relation_base * operator()(const relation_base & r1_0, const relation_base & r2_0) { + relation_base * operator()(const relation_base & r1_0, const relation_base & r2_0) override { const explanation_relation & r1 = static_cast(r1_0); const explanation_relation & r2 = static_cast(r2_0); explanation_relation_plugin & plugin = r1.get_plugin(); @@ -331,7 +331,7 @@ namespace datalog { project_fn(const relation_signature & sig, unsigned col_cnt, const unsigned * removed_cols) : convenient_relation_project_fn(sig, col_cnt, removed_cols) {} - virtual relation_base * operator()(const relation_base & r0) { + relation_base * operator()(const relation_base & r0) override { const explanation_relation & r = static_cast(r0); explanation_relation_plugin & plugin = r.get_plugin(); @@ -359,7 +359,7 @@ namespace datalog { rename_fn(const relation_signature & sig, unsigned permutation_cycle_len, const unsigned * permutation_cycle) : convenient_relation_rename_fn(sig, permutation_cycle_len, permutation_cycle) {} - virtual relation_base * operator()(const relation_base & r0) { + relation_base * operator()(const relation_base & r0) override { const explanation_relation & r = static_cast(r0); explanation_relation_plugin & plugin = r.get_plugin(); @@ -382,7 +382,7 @@ namespace datalog { class explanation_relation_plugin::union_fn : public relation_union_fn { scoped_ptr m_delta_union_fun; public: - virtual void operator()(relation_base & tgt0, const relation_base & src0, relation_base * delta0) { + void operator()(relation_base & tgt0, const relation_base & src0, relation_base * delta0) override { explanation_relation & tgt = static_cast(tgt0); const explanation_relation & src = static_cast(src0); explanation_relation * delta = delta0 ? static_cast(delta0) : 0; @@ -418,7 +418,7 @@ namespace datalog { class explanation_relation_plugin::foreign_union_fn : public relation_union_fn { scoped_ptr m_delta_union_fun; public: - virtual void operator()(relation_base & tgt0, const relation_base & src, relation_base * delta0) { + void operator()(relation_base & tgt0, const relation_base & src, relation_base * delta0) override { explanation_relation & tgt = static_cast(tgt0); explanation_relation * delta = delta0 ? static_cast(delta0) : 0; @@ -456,7 +456,7 @@ namespace datalog { m_col_idx(col_idx), m_new_rule(std::move(new_rule)) {} - virtual void operator()(relation_base & r0) { + void operator()(relation_base & r0) override { explanation_relation & r = static_cast(r0); if (!r.is_undefined(m_col_idx)) { @@ -509,7 +509,7 @@ namespace datalog { class explanation_relation_plugin::negation_filter_fn : public relation_intersection_filter_fn { public: - virtual void operator()(relation_base & r, const relation_base & neg) { + void operator()(relation_base & r, const relation_base & neg) override { if (!neg.empty()) { r.reset(); } @@ -531,7 +531,7 @@ namespace datalog { intersection_filter_fn(explanation_relation_plugin & plugin) : m_union_decl(plugin.m_union_decl) {} - virtual void operator()(relation_base & tgt0, const relation_base & src0) { + void operator()(relation_base & tgt0, const relation_base & src0) override { explanation_relation & tgt = static_cast(tgt0); const explanation_relation & src = static_cast(src0); diff --git a/src/muz/rel/dl_mk_explanations.h b/src/muz/rel/dl_mk_explanations.h index 6142b61d6..a96d50cb3 100644 --- a/src/muz/rel/dl_mk_explanations.h +++ b/src/muz/rel/dl_mk_explanations.h @@ -76,7 +76,7 @@ namespace datalog { return get_union_decl(m_context); } - rule_set * operator()(rule_set const & source); + rule_set * operator()(rule_set const & source) override; static expr* get_explanation(relation_base const& r); }; diff --git a/src/muz/rel/dl_mk_similarity_compressor.h b/src/muz/rel/dl_mk_similarity_compressor.h index 096305c59..da56e9eca 100644 --- a/src/muz/rel/dl_mk_similarity_compressor.h +++ b/src/muz/rel/dl_mk_similarity_compressor.h @@ -69,7 +69,7 @@ namespace datalog { public: mk_similarity_compressor(context & ctx); - rule_set * operator()(rule_set const & source); + rule_set * operator()(rule_set const & source) override; }; }; diff --git a/src/muz/rel/dl_mk_simple_joins.h b/src/muz/rel/dl_mk_simple_joins.h index cf4522c22..8eb6bd0c2 100644 --- a/src/muz/rel/dl_mk_simple_joins.h +++ b/src/muz/rel/dl_mk_simple_joins.h @@ -54,7 +54,7 @@ namespace datalog { public: mk_simple_joins(context & ctx); - rule_set * operator()(rule_set const & source); + rule_set * operator()(rule_set const & source) override; }; }; diff --git a/src/muz/rel/dl_product_relation.cpp b/src/muz/rel/dl_product_relation.cpp index 1a91d6828..56fd56505 100644 --- a/src/muz/rel/dl_product_relation.cpp +++ b/src/muz/rel/dl_product_relation.cpp @@ -444,12 +444,12 @@ namespace datalog { init(r1.get_signature(), 1, rels1, r2.get_signature(), 1, rels2, col_cnt, cols1, cols2); } - ~join_fn() { + ~join_fn() override { dealloc_ptr_vector_content(m_joins); dealloc_ptr_vector_content(m_full); } - virtual relation_base * operator()(const relation_base & _r1, const relation_base & _r2) { + relation_base * operator()(const relation_base & _r1, const relation_base & _r2) override { TRACE("dl", _r1.display(tout); _r2.display(tout);); ptr_vector relations; unsigned sz = m_joins.size(); @@ -491,9 +491,9 @@ namespace datalog { m_sig(std::move(s)), m_transforms(num_trans, trans) {} - ~transform_fn() { dealloc_ptr_vector_content(m_transforms); } + ~transform_fn() override { dealloc_ptr_vector_content(m_transforms); } - virtual relation_base * operator()(const relation_base & _r) { + relation_base * operator()(const relation_base & _r) override { product_relation const& r = get(_r); product_relation_plugin& p = r.get_plugin(); SASSERT(m_transforms.size() == r.size()); @@ -628,14 +628,14 @@ namespace datalog { init(tgt.m_relations, src.m_relations, delta ? &delta->m_relations : 0); } - ~aligned_union_fn() { + ~aligned_union_fn() override { unsigned sz = m_unions.size(); for(unsigned i=0; iis_precise()) { return false; diff --git a/src/muz/rel/dl_relation_manager.cpp b/src/muz/rel/dl_relation_manager.cpp index 1eb973776..8226d0198 100644 --- a/src/muz/rel/dl_relation_manager.cpp +++ b/src/muz/rel/dl_relation_manager.cpp @@ -538,7 +538,7 @@ namespace datalog { class relation_manager::empty_signature_relation_join_fn : public relation_join_fn { public: - virtual relation_base * operator()(const relation_base & r1, const relation_base & r2) { + relation_base * operator()(const relation_base & r1, const relation_base & r2) override { TRACE("dl", tout << r1.get_plugin().get_name() << " " << r2.get_plugin().get_name() << "\n";); if(r1.get_signature().empty()) { if(r1.empty()) { @@ -615,7 +615,7 @@ namespace datalog { m_project(0), m_removed_cols(removed_col_cnt, removed_cols) {} - virtual relation_base * operator()(const relation_base & t) { + relation_base * operator()(const relation_base & t) override { scoped_rel t1 = t.clone(); (*m_filter)(*t1); if( !m_project) { @@ -658,11 +658,11 @@ namespace datalog { default_relation_apply_sequential_fn(unsigned n, relation_mutator_fn ** mutators): m_mutators(n, mutators) { } - virtual ~default_relation_apply_sequential_fn() { + ~default_relation_apply_sequential_fn() override { std::for_each(m_mutators.begin(), m_mutators.end(), delete_proc()); } - virtual void operator()(relation_base& t) { + void operator()(relation_base& t) override { for (unsigned i = 0; i < m_mutators.size(); ++i) { if (t.empty()) return; (*(m_mutators[i]))(t); @@ -688,7 +688,7 @@ namespace datalog { const unsigned * removed_cols) : m_join(join), m_project(0), m_removed_cols(removed_col_cnt, removed_cols) {} - virtual relation_base * operator()(const relation_base & t1, const relation_base & t2) { + relation_base * operator()(const relation_base & t1, const relation_base & t2) override { scoped_rel aux = (*m_join)(t1, t2); if(!m_project) { relation_manager & rmgr = aux->get_plugin().get_manager(); @@ -787,7 +787,7 @@ namespace datalog { default_relation_select_equal_and_project_fn(relation_mutator_fn * filter, relation_transformer_fn * project) : m_filter(filter), m_project(project) {} - virtual relation_base * operator()(const relation_base & t1) { + relation_base * operator()(const relation_base & t1) override { TRACE("dl", tout << t1.get_plugin().get_name() << "\n";); scoped_rel aux = t1.clone(); (*m_filter)(*aux); @@ -823,7 +823,7 @@ namespace datalog { default_relation_intersection_filter_fn(relation_join_fn * join_fun, relation_union_fn * union_fun) : m_join_fun(join_fun), m_union_fun(union_fun) {} - virtual void operator()(relation_base & tgt, const relation_base & intersected_obj) { + void operator()(relation_base & tgt, const relation_base & intersected_obj) override { scoped_rel filtered_rel = (*m_join_fun)(tgt, intersected_obj); TRACE("dl", tgt.display(tout << "tgt:\n"); @@ -926,7 +926,7 @@ namespace datalog { const unsigned * cols1, const unsigned * cols2) : convenient_table_join_fn(t1_sig, t2_sig, col_cnt, cols1, cols2), m_col_cnt(col_cnt) {} - virtual table_base * operator()(const table_base & t1, const table_base & t2) { + table_base * operator()(const table_base & t1, const table_base & t2) override { table_plugin * plugin = &t1.get_plugin(); const table_signature & res_sign = get_result_signature(); @@ -1037,15 +1037,15 @@ namespace datalog { SASSERT(removed_col_cnt>0); } - virtual const table_signature & get_result_signature() const { + const table_signature & get_result_signature() const override { return convenient_table_project_fn::get_result_signature(); } - virtual void modify_fact(table_fact & f) const { + void modify_fact(table_fact & f) const override { project_out_vector_columns(f, m_removed_cols); } - virtual table_base * operator()(const table_base & t) { + table_base * operator()(const table_base & t) override { return auxiliary_table_transformer_fn::operator()(t); } }; @@ -1054,7 +1054,7 @@ namespace datalog { const table_signature m_empty_sig; public: null_signature_table_project_fn() : m_empty_sig() {} - virtual table_base * operator()(const table_base & t) { + table_base * operator()(const table_base & t) override { relation_manager & m = t.get_plugin().get_manager(); table_base * res = m.mk_empty_table(m_empty_sig); if(!t.empty()) { @@ -1096,14 +1096,14 @@ namespace datalog { m_removed_cols(removed_col_cnt, removed_cols) {} class unreachable_reducer : public table_row_pair_reduce_fn { - virtual void operator()(table_element * func_columns, const table_element * merged_func_columns) { + void operator()(table_element * func_columns, const table_element * merged_func_columns) override { //we do project_with_reduce only if we are sure there will be no reductions //(see code of the table_signature::from_join_project function) UNREACHABLE(); } }; - virtual table_base * operator()(const table_base & t1, const table_base & t2) { + table_base * operator()(const table_base & t1, const table_base & t2) override { table_base * aux = (*m_join)(t1, t2); if(m_project==0) { relation_manager & rmgr = aux->get_plugin().get_manager(); @@ -1154,15 +1154,15 @@ namespace datalog { SASSERT(permutation_cycle_len>=2); } - virtual const table_signature & get_result_signature() const { + const table_signature & get_result_signature() const override { return convenient_table_rename_fn::get_result_signature(); } - virtual void modify_fact(table_fact & f) const { + void modify_fact(table_fact & f) const override { permutate_by_cycle(f, m_cycle); } - virtual table_base * operator()(const table_base & t) { + table_base * operator()(const table_base & t) override { return auxiliary_table_transformer_fn::operator()(t); } @@ -1190,7 +1190,7 @@ namespace datalog { class relation_manager::default_table_union_fn : public table_union_fn { table_fact m_row; public: - virtual void operator()(table_base & tgt, const table_base & src, table_base * delta) { + void operator()(table_base & tgt, const table_base & src, table_base * delta) override { table_base::iterator it = src.begin(); table_base::iterator iend = src.end(); @@ -1283,7 +1283,7 @@ namespace datalog { SASSERT(col_cnt>=2); } - virtual bool should_remove(const table_fact & f) const { + bool should_remove(const table_fact & f) const override { table_element val=f[m_identical_cols[0]]; for(unsigned i=1; i(m_args); args.reset(); @@ -1425,7 +1425,7 @@ namespace datalog { return m_ast_manager.is_false(ground); } - virtual void operator()(table_base & t) { + void operator()(table_base & t) override { auxiliary_table_filter_fn::operator()(t); } }; @@ -1455,7 +1455,7 @@ namespace datalog { : m_filter(filter), m_condition(condition, ctx.get_manager()), m_removed_cols(removed_col_cnt, removed_cols) {} - virtual table_base* operator()(const table_base & tb) { + table_base* operator()(const table_base & tb) override { table_base *t2 = tb.clone(); (*m_filter)(*t2); if (!m_project) { @@ -1506,7 +1506,7 @@ namespace datalog { m_aux_fact.resize(neg_t.get_signature().size()); } - virtual bool should_remove(const table_fact & f) const { + bool should_remove(const table_fact & f) const override { if(!m_all_neg_bound || m_overlap) { table_base::iterator nit = m_negated_table->begin(); table_base::iterator nend = m_negated_table->end(); @@ -1524,7 +1524,7 @@ namespace datalog { } } - virtual void operator()(table_base & tgt, const table_base & negated_table) { + void operator()(table_base & tgt, const table_base & negated_table) override { SASSERT(m_negated_table==0); flet flet_neg_table(m_negated_table, &negated_table); auxiliary_table_filter_fn::operator()(tgt); @@ -1568,7 +1568,7 @@ namespace datalog { default_table_select_equal_and_project_fn(table_mutator_fn * filter, table_transformer_fn * project) : m_filter(filter), m_project(project) {} - virtual table_base * operator()(const table_base & t1) { + table_base * operator()(const table_base & t1) override { TRACE("dl", tout << t1.get_plugin().get_name() << "\n";); scoped_rel aux = t1.clone(); (*m_filter)(*aux); @@ -1606,9 +1606,9 @@ namespace datalog { m_union_fn = plugin.mk_union_fn(t, *m_aux_table, static_cast(0)); } - virtual ~default_table_map_fn() {} + ~default_table_map_fn() override {} - virtual void operator()(table_base & t) { + void operator()(table_base & t) override { SASSERT(t.get_signature()==m_aux_table->get_signature()); if(!m_aux_table->empty()) { m_aux_table->reset(); @@ -1664,7 +1664,7 @@ namespace datalog { m_former_row.resize(get_result_signature().size()); } - virtual ~default_table_project_with_reduce_fn() {} + ~default_table_project_with_reduce_fn() override {} virtual void modify_fact(table_fact & f) const { unsigned ofs=1; @@ -1693,7 +1693,7 @@ namespace datalog { } } - virtual table_base * operator()(const table_base & t) { + table_base * operator()(const table_base & t) override { table_plugin & plugin = t.get_plugin(); const table_signature & res_sign = get_result_signature(); SASSERT(plugin.can_handle_signature(res_sign)); diff --git a/src/muz/rel/dl_sieve_relation.cpp b/src/muz/rel/dl_sieve_relation.cpp index 7e274cbef..401d519d5 100644 --- a/src/muz/rel/dl_sieve_relation.cpp +++ b/src/muz/rel/dl_sieve_relation.cpp @@ -294,7 +294,7 @@ namespace datalog { } } - virtual relation_base * operator()(const relation_base & r1, const relation_base & r2) { + relation_base * operator()(const relation_base & r1, const relation_base & r2) override { bool r1_sieved = r1.get_plugin().is_sieve_relation(); bool r2_sieved = r2.get_plugin().is_sieve_relation(); SASSERT(r1_sieved || r2_sieved); @@ -357,7 +357,7 @@ namespace datalog { get_result_signature() = result_sig; } - virtual relation_base * operator()(const relation_base & r0) { + relation_base * operator()(const relation_base & r0) override { SASSERT(r0.get_plugin().is_sieve_relation()); const sieve_relation & r = static_cast(r0); sieve_relation_plugin & plugin = r.get_plugin(); @@ -439,7 +439,7 @@ namespace datalog { public: union_fn(relation_union_fn * union_fun) : m_union_fun(union_fun) {} - virtual void operator()(relation_base & tgt, const relation_base & src, relation_base * delta) { + void operator()(relation_base & tgt, const relation_base & src, relation_base * delta) override { bool tgt_sieved = tgt.get_plugin().is_sieve_relation(); bool src_sieved = src.get_plugin().is_sieve_relation(); bool delta_sieved = delta && delta->get_plugin().is_sieve_relation(); @@ -504,7 +504,7 @@ namespace datalog { filter_fn(relation_mutator_fn * inner_fun) : m_inner_fun(inner_fun) {} - virtual void operator()(relation_base & r0) { + void operator()(relation_base & r0) override { SASSERT(r0.get_plugin().is_sieve_relation()); sieve_relation & r = static_cast(r0); @@ -600,7 +600,7 @@ namespace datalog { negation_filter_fn(relation_intersection_filter_fn * inner_fun) : m_inner_fun(inner_fun) {} - virtual void operator()(relation_base & r, const relation_base & neg) { + void operator()(relation_base & r, const relation_base & neg) override { bool r_sieved = r.get_plugin().is_sieve_relation(); bool neg_sieved = neg.get_plugin().is_sieve_relation(); SASSERT(r_sieved || neg_sieved); diff --git a/src/muz/rel/dl_sieve_relation.h b/src/muz/rel/dl_sieve_relation.h index e369e04aa..5f20cecb4 100644 --- a/src/muz/rel/dl_sieve_relation.h +++ b/src/muz/rel/dl_sieve_relation.h @@ -85,7 +85,7 @@ namespace datalog { sieve_relation_plugin(relation_manager & manager); - virtual void initialize(family_id fid); + void initialize(family_id fid) override; family_id get_relation_kind(const relation_signature & sig, const bool * inner_columns, family_id inner_kind); @@ -95,15 +95,15 @@ namespace datalog { return get_relation_kind(sig, inner_columns.c_ptr(), inner_kind); } - virtual bool can_handle_signature(const relation_signature & s); + bool can_handle_signature(const relation_signature & s) override; - virtual relation_base * mk_empty(const relation_signature & s); + relation_base * mk_empty(const relation_signature & s) override; sieve_relation * mk_empty(const sieve_relation & original); - virtual relation_base * mk_empty(const relation_base & original); - virtual relation_base * mk_empty(const relation_signature & s, family_id kind); + relation_base * mk_empty(const relation_base & original) override; + relation_base * mk_empty(const relation_signature & s, family_id kind) override; sieve_relation * mk_empty(const relation_signature & s, relation_plugin & inner_plugin); - virtual relation_base * mk_full(func_decl* p, const relation_signature & s); + relation_base * mk_full(func_decl* p, const relation_signature & s) override; sieve_relation * full(func_decl* p, const relation_signature & s, relation_plugin & inner_plugin); sieve_relation * mk_from_inner(const relation_signature & s, const bool * inner_columns, @@ -116,22 +116,22 @@ namespace datalog { protected: - virtual relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2, - unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); - virtual relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, - const unsigned * removed_cols); - virtual relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, - const unsigned * permutation_cycle); - virtual relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, - const relation_base * delta); - virtual relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, - const unsigned * identical_cols); - virtual relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, - unsigned col); - virtual relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition); - virtual relation_intersection_filter_fn * mk_filter_by_negation_fn(const relation_base & t, - const relation_base & negated_obj, unsigned joined_col_cnt, - const unsigned * t_cols, const unsigned * negated_cols); + relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2, + unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override; + relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, + const unsigned * removed_cols) override; + relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, + const unsigned * permutation_cycle) override; + relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, + const relation_base * delta) override; + relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, + const unsigned * identical_cols) override; + relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, + unsigned col) override; + relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition) override; + relation_intersection_filter_fn * mk_filter_by_negation_fn(const relation_base & t, + const relation_base & negated_obj, unsigned joined_col_cnt, + const unsigned * t_cols, const unsigned * negated_cols) override; }; @@ -176,18 +176,18 @@ namespace datalog { relation_base & get_inner() { return *m_inner; } const relation_base & get_inner() const { return *m_inner; } - virtual void add_fact(const relation_fact & f); - virtual bool contains_fact(const relation_fact & f) const; - virtual sieve_relation * clone() const; - virtual relation_base * complement(func_decl*p) const; - virtual void to_formula(expr_ref& fml) const; + void add_fact(const relation_fact & f) override; + bool contains_fact(const relation_fact & f) const override; + sieve_relation * clone() const override; + relation_base * complement(func_decl*p) const override; + void to_formula(expr_ref& fml) const override; - virtual bool empty() const { return get_inner().empty(); } - virtual void reset() { get_inner().reset(); } - virtual unsigned get_size_estimate_rows() const { return get_inner().get_size_estimate_rows(); } - virtual unsigned get_size_estimate_bytes() const { return get_inner().get_size_estimate_bytes(); } + bool empty() const override { return get_inner().empty(); } + void reset() override { get_inner().reset(); } + unsigned get_size_estimate_rows() const override { return get_inner().get_size_estimate_rows(); } + unsigned get_size_estimate_bytes() const override { return get_inner().get_size_estimate_bytes(); } - virtual void display(std::ostream & out) const; + void display(std::ostream & out) const override; }; diff --git a/src/muz/rel/dl_sparse_table.cpp b/src/muz/rel/dl_sparse_table.cpp index 6048f358b..50386152c 100644 --- a/src/muz/rel/dl_sparse_table.cpp +++ b/src/muz/rel/dl_sparse_table.cpp @@ -198,7 +198,7 @@ namespace datalog { row_interface(t), m_parent(parent) {} - virtual table_element operator[](unsigned col) const { + table_element operator[](unsigned col) const override { return m_parent.m_layout.get(m_parent.m_ptr, col); } @@ -218,15 +218,15 @@ namespace datalog { m_row_obj(t, *this), m_layout(t.m_column_layout) {} - virtual bool is_finished() const { + bool is_finished() const override { return m_ptr == m_end; } - virtual row_interface & operator*() { + row_interface & operator*() override { SASSERT(!is_finished()); return m_row_obj; } - virtual void operator++() { + void operator++() override { SASSERT(!is_finished()); m_ptr+=m_fact_size; } @@ -312,7 +312,7 @@ namespace datalog { m_keys(key_len*sizeof(table_element)), m_first_nonindexed(0) {} - virtual void update(const sparse_table & t) { + void update(const sparse_table & t) override { if (m_first_nonindexed == t.m_data.after_last_offset()) { return; } @@ -351,7 +351,7 @@ namespace datalog { m_first_nonindexed = t.m_data.after_last_offset(); } - virtual query_result get_matching_offsets(const key_value & key) const { + query_result get_matching_offsets(const key_value & key) const override { key_to_reserve(key); store_offset ofs; if (!m_keys.find_reserve_content(ofs)) { @@ -406,9 +406,9 @@ namespace datalog { m_key_fact.resize(t.get_signature().size()); } - virtual ~full_signature_key_indexer() {} + ~full_signature_key_indexer() override {} - virtual query_result get_matching_offsets(const key_value & key) const { + query_result get_matching_offsets(const key_value & key) const override { unsigned key_len = m_key_cols.size(); for (unsigned i=0; i0; } - virtual table_base * mk_empty(const table_signature & s); + table_base * mk_empty(const table_signature & s) override; sparse_table * mk_clone(const sparse_table & t); protected: - virtual table_join_fn * mk_join_fn(const table_base & t1, const table_base & t2, - unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); - virtual table_join_fn * mk_join_project_fn(const table_base & t1, const table_base & t2, - unsigned col_cnt, const unsigned * cols1, const unsigned * cols2, unsigned removed_col_cnt, - const unsigned * removed_cols); - virtual table_union_fn * mk_union_fn(const table_base & tgt, const table_base & src, - const table_base * delta); - virtual table_transformer_fn * mk_project_fn(const table_base & t, unsigned col_cnt, - const unsigned * removed_cols); - virtual table_transformer_fn * mk_rename_fn(const table_base & t, unsigned permutation_cycle_len, - const unsigned * permutation_cycle); - virtual table_transformer_fn * mk_select_equal_and_project_fn(const table_base & t, - const table_element & value, unsigned col); - virtual table_intersection_filter_fn * mk_filter_by_negation_fn(const table_base & t, - const table_base & negated_obj, unsigned joined_col_cnt, - const unsigned * t_cols, const unsigned * negated_cols); - virtual table_intersection_join_filter_fn* mk_filter_by_negated_join_fn( - const table_base & t, - const table_base & src1, - const table_base & src2, + table_join_fn * mk_join_fn(const table_base & t1, const table_base & t2, + unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override; + table_join_fn * mk_join_project_fn(const table_base & t1, const table_base & t2, + unsigned col_cnt, const unsigned * cols1, const unsigned * cols2, unsigned removed_col_cnt, + const unsigned * removed_cols) override; + table_union_fn * mk_union_fn(const table_base & tgt, const table_base & src, + const table_base * delta) override; + table_transformer_fn * mk_project_fn(const table_base & t, unsigned col_cnt, + const unsigned * removed_cols) override; + table_transformer_fn * mk_rename_fn(const table_base & t, unsigned permutation_cycle_len, + const unsigned * permutation_cycle) override; + table_transformer_fn * mk_select_equal_and_project_fn(const table_base & t, + const table_element & value, unsigned col) override; + table_intersection_filter_fn * mk_filter_by_negation_fn(const table_base & t, + const table_base & negated_obj, unsigned joined_col_cnt, + const unsigned * t_cols, const unsigned * negated_cols) override; + table_intersection_join_filter_fn* mk_filter_by_negated_join_fn( + const table_base & t, + const table_base & src1, + const table_base & src2, unsigned_vector const& t_cols, unsigned_vector const& src_cols, unsigned_vector const& src1_cols, - unsigned_vector const& src2_cols); + unsigned_vector const& src2_cols) override; static sparse_table const& get(table_base const&); static sparse_table& get(table_base&); @@ -463,10 +463,10 @@ namespace datalog { sparse_table(sparse_table_plugin & p, const table_signature & sig, unsigned init_capacity=0); sparse_table(const sparse_table & t); - virtual ~sparse_table(); + ~sparse_table() override; public: - virtual void deallocate() { + void deallocate() override { get_plugin().recycle(this); } @@ -475,22 +475,22 @@ namespace datalog { sparse_table_plugin & get_plugin() const { return static_cast(table_base::get_plugin()); } - virtual bool empty() const { return row_count()==0; } - virtual void add_fact(const table_fact & f); - virtual bool contains_fact(const table_fact & f) const; - virtual bool fetch_fact(table_fact & f) const; - virtual void ensure_fact(const table_fact & f); - virtual void remove_fact(const table_element* fact); - virtual void reset(); + bool empty() const override { return row_count()==0; } + void add_fact(const table_fact & f) override; + bool contains_fact(const table_fact & f) const override; + bool fetch_fact(table_fact & f) const override; + void ensure_fact(const table_fact & f) override; + void remove_fact(const table_element* fact) override; + void reset() override; - virtual table_base * clone() const; + table_base * clone() const override; - virtual table_base::iterator begin() const; - virtual table_base::iterator end() const; + table_base::iterator begin() const override; + table_base::iterator end() const override; - virtual unsigned get_size_estimate_rows() const { return row_count(); } - virtual unsigned get_size_estimate_bytes() const; - virtual bool knows_exact_size() const { return true; } + unsigned get_size_estimate_rows() const override { return row_count(); } + unsigned get_size_estimate_bytes() const override; + bool knows_exact_size() const override { return true; } }; }; diff --git a/src/muz/rel/dl_table.cpp b/src/muz/rel/dl_table.cpp index 1c068a878..963820c91 100644 --- a/src/muz/rel/dl_table.cpp +++ b/src/muz/rel/dl_table.cpp @@ -43,7 +43,7 @@ namespace datalog { : convenient_table_join_fn(t1_sig, t2_sig, col_cnt, cols1, cols2), m_joined_col_cnt(col_cnt) {} - virtual table_base * operator()(const table_base & t1, const table_base & t2) { + table_base * operator()(const table_base & t1, const table_base & t2) override { const hashtable_table & ht1 = static_cast(t1); const hashtable_table & ht2 = static_cast(t2); @@ -105,10 +105,10 @@ namespace datalog { public: our_row(const our_iterator_core & parent) : row_interface(parent.m_parent), m_parent(parent) {} - virtual void get_fact(table_fact & result) const { + void get_fact(table_fact & result) const override { result = *m_parent.m_inner; } - virtual table_element operator[](unsigned col) const { + table_element operator[](unsigned col) const override { return (*m_parent.m_inner)[col]; } @@ -121,15 +121,15 @@ namespace datalog { m_parent(t), m_inner(finished ? t.m_data.end() : t.m_data.begin()), m_end(t.m_data.end()), m_row_obj(*this) {} - virtual bool is_finished() const { + bool is_finished() const override { return m_inner==m_end; } - virtual row_interface & operator*() { + row_interface & operator*() override { SASSERT(!is_finished()); return m_row_obj; } - virtual void operator++() { + void operator++() override { SASSERT(!is_finished()); ++m_inner; } @@ -192,7 +192,7 @@ namespace datalog { const bv_iterator& m_parent; public: our_row(const bv_iterator & p) : caching_row_interface(p.m_bv), m_parent(p) {} - virtual void get_fact(table_fact& result) const { + void get_fact(table_fact& result) const override { if (result.size() < size()) { result.resize(size(), 0); } @@ -210,15 +210,15 @@ namespace datalog { } } - virtual bool is_finished() const { + bool is_finished() const override { return m_offset == m_bv.m_bv.size(); } - virtual row_interface & operator*() { + row_interface & operator*() override { SASSERT(!is_finished()); return m_row_obj; } - virtual void operator++() { + void operator++() override { SASSERT(!is_finished()); ++m_offset; while (!is_finished() && !m_bv.m_bv.get(m_offset)) { diff --git a/src/muz/rel/dl_table.h b/src/muz/rel/dl_table.h index c428191af..168108e65 100644 --- a/src/muz/rel/dl_table.h +++ b/src/muz/rel/dl_table.h @@ -61,10 +61,10 @@ namespace datalog { hashtable_table_plugin(relation_manager & manager) : table_plugin(symbol("hashtable"), manager) {} - virtual table_base * mk_empty(const table_signature & s); + table_base * mk_empty(const table_signature & s) override; - virtual table_join_fn * mk_join_fn(const table_base & t1, const table_base & t2, - unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); + table_join_fn * mk_join_fn(const table_base & t1, const table_base & t2, + unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override; }; class hashtable_table : public table_base { @@ -84,23 +84,23 @@ namespace datalog { hashtable_table_plugin & get_plugin() const { return static_cast(table_base::get_plugin()); } - virtual void add_fact(const table_fact & f) { + void add_fact(const table_fact & f) override { m_data.insert(f); } - virtual void remove_fact(const table_element* fact) { + void remove_fact(const table_element* fact) override { table_fact f(get_signature().size(), fact); m_data.remove(f); } - virtual bool contains_fact(const table_fact & f) const { + bool contains_fact(const table_fact & f) const override { return m_data.contains(f); } - virtual iterator begin() const; - virtual iterator end() const; + iterator begin() const override; + iterator end() const override; - virtual unsigned get_size_estimate_rows() const { return m_data.size(); } - virtual unsigned get_size_estimate_bytes() const { return m_data.size()*get_signature().size()*8; } - virtual bool knows_exact_size() const { return true; } + unsigned get_size_estimate_rows() const override { return m_data.size(); } + unsigned get_size_estimate_bytes() const override { return m_data.size()*get_signature().size()*8; } + bool knows_exact_size() const override { return true; } }; // ----------------------------------- @@ -118,9 +118,9 @@ namespace datalog { bitvector_table_plugin(relation_manager & manager) : table_plugin(symbol("bitvector"), manager) {} - virtual bool can_handle_signature(const table_signature & s); + bool can_handle_signature(const table_signature & s) override; - virtual table_base * mk_empty(const table_signature & s); + table_base * mk_empty(const table_signature & s) override; }; class bitvector_table : public table_base { @@ -137,11 +137,11 @@ namespace datalog { bitvector_table(bitvector_table_plugin & plugin, const table_signature & sig); public: - virtual void add_fact(const table_fact & f); - virtual void remove_fact(const table_element* fact); - virtual bool contains_fact(const table_fact & f) const; - virtual iterator begin() const; - virtual iterator end() const; + void add_fact(const table_fact & f) override; + void remove_fact(const table_element* fact) override; + bool contains_fact(const table_fact & f) const override; + iterator begin() const override; + iterator end() const override; }; diff --git a/src/muz/rel/dl_table_relation.cpp b/src/muz/rel/dl_table_relation.cpp index b8cf8e724..d5d8fd3c9 100644 --- a/src/muz/rel/dl_table_relation.cpp +++ b/src/muz/rel/dl_table_relation.cpp @@ -82,7 +82,7 @@ namespace datalog { : convenient_relation_join_project_fn(s1, s2, col_cnt, cols1, cols2, removed_col_cnt, removed_cols), m_tfun(tfun) {} - virtual relation_base * operator()(const relation_base & t1, const relation_base & t2) { + relation_base * operator()(const relation_base & t1, const relation_base & t2) override { SASSERT(t1.from_table()); SASSERT(t2.from_table()); table_relation_plugin & plugin = static_cast(t1.get_plugin()); @@ -146,7 +146,7 @@ namespace datalog { tr_transformer_fn(const relation_signature & rsig, table_transformer_fn * tfun) : m_tfun(tfun) { get_result_signature() = rsig; } - virtual relation_base * operator()(const relation_base & t) { + relation_base * operator()(const relation_base & t) override { SASSERT(t.from_table()); table_relation_plugin & plugin = static_cast(t.get_plugin()); @@ -235,7 +235,7 @@ namespace datalog { by iterating through the table and calling \c add_fact of the target relation. */ class table_relation_plugin::universal_target_union_fn : public relation_union_fn { - virtual void operator()(relation_base & tgt, const relation_base & src, relation_base * delta) { + void operator()(relation_base & tgt, const relation_base & src, relation_base * delta) override { SASSERT(src.from_table()); const table_relation & tr_src = static_cast(src); @@ -271,7 +271,7 @@ namespace datalog { public: tr_union_fn(table_union_fn * tfun) : m_tfun(tfun) {} - virtual void operator()(relation_base & tgt, const relation_base & src, relation_base * delta) { + void operator()(relation_base & tgt, const relation_base & src, relation_base * delta) override { SASSERT(tgt.from_table()); SASSERT(src.from_table()); SASSERT(!delta || delta->from_table()); @@ -311,7 +311,7 @@ namespace datalog { public: tr_mutator_fn(table_mutator_fn * tfun) : m_tfun(tfun) {} - virtual void operator()(relation_base & r) { + void operator()(relation_base & r) override { SASSERT(r.from_table()); table_relation & tr = static_cast(r); (*m_tfun)(tr.get_table()); @@ -377,7 +377,7 @@ namespace datalog { public: tr_intersection_filter_fn(table_intersection_filter_fn * tfun) : m_tfun(tfun) {} - virtual void operator()(relation_base & r, const relation_base & src) { + void operator()(relation_base & r, const relation_base & src) override { SASSERT(r.from_table()); SASSERT(src.from_table()); diff --git a/src/muz/rel/dl_table_relation.h b/src/muz/rel/dl_table_relation.h index 16ff8c482..8ebb6d44d 100644 --- a/src/muz/rel/dl_table_relation.h +++ b/src/muz/rel/dl_table_relation.h @@ -46,40 +46,40 @@ namespace datalog { table_plugin & get_table_plugin() { return m_table_plugin; } - virtual bool can_handle_signature(const relation_signature & s); + bool can_handle_signature(const relation_signature & s) override; - virtual relation_base * mk_empty(const relation_signature & s); + relation_base * mk_empty(const relation_signature & s) override; virtual relation_base * mk_full_relation(const relation_signature & s, func_decl* p, family_id kind); relation_base * mk_from_table(const relation_signature & s, table_base * t); protected: - virtual relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2, - unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); - virtual relation_join_fn * mk_join_project_fn(const relation_base & t1, const relation_base & t2, - unsigned joined_col_cnt, const unsigned * cols1, const unsigned * cols2, unsigned removed_col_cnt, - const unsigned * removed_cols); - virtual relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, - const unsigned * removed_cols); - virtual relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, - const unsigned * permutation_cycle); - virtual relation_transformer_fn * mk_permutation_rename_fn(const relation_base & t, - const unsigned * permutation); - virtual relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, - const relation_base * delta); - virtual relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, - const unsigned * identical_cols); - virtual relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, - unsigned col); - virtual relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition); - virtual relation_transformer_fn * mk_filter_interpreted_and_project_fn(const relation_base & t, - app * condition, unsigned removed_col_cnt, const unsigned * removed_cols); - virtual relation_intersection_filter_fn * mk_filter_by_intersection_fn(const relation_base & t, - const relation_base & src, unsigned joined_col_cnt, const unsigned * t_cols, const unsigned * src_cols); - virtual relation_intersection_filter_fn * mk_filter_by_negation_fn(const relation_base & t, - const relation_base & negated_obj, unsigned joined_col_cnt, - const unsigned * t_cols, const unsigned * negated_cols); - virtual relation_transformer_fn * mk_select_equal_and_project_fn(const relation_base & t, - const relation_element & value, unsigned col); + relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2, + unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override; + relation_join_fn * mk_join_project_fn(const relation_base & t1, const relation_base & t2, + unsigned joined_col_cnt, const unsigned * cols1, const unsigned * cols2, unsigned removed_col_cnt, + const unsigned * removed_cols) override; + relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, + const unsigned * removed_cols) override; + relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, + const unsigned * permutation_cycle) override; + relation_transformer_fn * mk_permutation_rename_fn(const relation_base & t, + const unsigned * permutation) override; + relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, + const relation_base * delta) override; + relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, + const unsigned * identical_cols) override; + relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, + unsigned col) override; + relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition) override; + relation_transformer_fn * mk_filter_interpreted_and_project_fn(const relation_base & t, + app * condition, unsigned removed_col_cnt, const unsigned * removed_cols) override; + relation_intersection_filter_fn * mk_filter_by_intersection_fn(const relation_base & t, + const relation_base & src, unsigned joined_col_cnt, const unsigned * t_cols, const unsigned * src_cols) override; + relation_intersection_filter_fn * mk_filter_by_negation_fn(const relation_base & t, + const relation_base & negated_obj, unsigned joined_col_cnt, + const unsigned * t_cols, const unsigned * negated_cols) override; + relation_transformer_fn * mk_select_equal_and_project_fn(const relation_base & t, + const relation_element & value, unsigned col) override; }; class table_relation : public relation_base { @@ -107,24 +107,24 @@ namespace datalog { table_base & get_table() { return *m_table; } const table_base & get_table() const { return *m_table; } - virtual bool empty() const { return m_table->empty(); } + bool empty() const override { return m_table->empty(); } void add_table_fact(const table_fact & f); - virtual void add_fact(const relation_fact & f); - virtual bool contains_fact(const relation_fact & f) const; - virtual relation_base * clone() const; - virtual relation_base * complement(func_decl* p) const; - virtual void to_formula(expr_ref& fml) const { get_table().to_formula(get_signature(), fml); } + void add_fact(const relation_fact & f) override; + bool contains_fact(const relation_fact & f) const override; + relation_base * clone() const override; + relation_base * complement(func_decl* p) const override; + void to_formula(expr_ref& fml) const override { get_table().to_formula(get_signature(), fml); } - virtual void display(std::ostream & out) const { + void display(std::ostream & out) const override { get_table().display(out); } - virtual void display_tuples(func_decl & pred, std::ostream & out) const; + void display_tuples(func_decl & pred, std::ostream & out) const override; - virtual unsigned get_size_estimate_rows() const { return m_table->get_size_estimate_rows(); } - virtual unsigned get_size_estimate_bytes() const { return m_table->get_size_estimate_bytes(); } - virtual bool knows_exact_size() const { return m_table->knows_exact_size(); } + unsigned get_size_estimate_rows() const override { return m_table->get_size_estimate_rows(); } + unsigned get_size_estimate_bytes() const override { return m_table->get_size_estimate_bytes(); } + bool knows_exact_size() const override { return m_table->knows_exact_size(); } }; }; diff --git a/src/muz/rel/dl_vector_relation.h b/src/muz/rel/dl_vector_relation.h index 85e7a78d1..fe1d603fe 100644 --- a/src/muz/rel/dl_vector_relation.h +++ b/src/muz/rel/dl_vector_relation.h @@ -55,12 +55,12 @@ namespace datalog { } } - virtual ~vector_relation() { + ~vector_relation() override { dealloc(m_eqs); dealloc(m_elems); } - virtual void swap(relation_base& other) { + void swap(relation_base& other) override { vector_relation& o = dynamic_cast(other); if (&o == this) return; std::swap(o.m_eqs, m_eqs); @@ -85,7 +85,7 @@ namespace datalog { } - virtual bool empty() const { return m_empty; } + bool empty() const override { return m_empty; } T& operator[](unsigned i) { return (*m_elems)[find(i)]; } @@ -93,7 +93,7 @@ namespace datalog { virtual void display_index(unsigned i, T const& t, std::ostream& out) const = 0; - virtual void display(std::ostream & out) const { + void display(std::ostream & out) const override { if (empty()) { out << "empty\n"; return; diff --git a/src/muz/rel/karr_relation.cpp b/src/muz/rel/karr_relation.cpp index c8a489d69..c73b8356d 100644 --- a/src/muz/rel/karr_relation.cpp +++ b/src/muz/rel/karr_relation.cpp @@ -36,13 +36,13 @@ namespace datalog { { } - virtual bool empty() const { + bool empty() const override { return m_empty; } - virtual bool is_precise() const { return false; } + bool is_precise() const override { return false; } - virtual void add_fact(const relation_fact & f) { + void add_fact(const relation_fact & f) override { SASSERT(m_empty); SASSERT(!m_basis_valid); m_empty = false; @@ -60,12 +60,12 @@ namespace datalog { } } - virtual bool contains_fact(const relation_fact & f) const { + bool contains_fact(const relation_fact & f) const override { UNREACHABLE(); return false; } - virtual void display(std::ostream & out) const { + void display(std::ostream & out) const override { if (m_fn) { out << m_fn->get_name() << "\n"; } @@ -82,18 +82,18 @@ namespace datalog { } } - virtual karr_relation * clone() const { + karr_relation * clone() const override { karr_relation* result = alloc(karr_relation, m_plugin, m_fn, get_signature(), m_empty); result->copy(*this); return result; } - virtual karr_relation * complement(func_decl*) const { + karr_relation * complement(func_decl*) const override { UNREACHABLE(); return 0; } - virtual void to_formula(expr_ref& fml) const { + void to_formula(expr_ref& fml) const override { if (empty()) { fml = m.mk_false(); } @@ -514,7 +514,7 @@ namespace datalog { : convenient_relation_join_fn(o1_sig, o2_sig, col_cnt, cols1, cols2){ } - virtual relation_base * operator()(const relation_base & _r1, const relation_base & _r2) { + relation_base * operator()(const relation_base & _r1, const relation_base & _r2) override { karr_relation const& r1 = get(_r1); karr_relation const& r2 = get(_r2); karr_relation_plugin& p = r1.get_plugin(); @@ -540,7 +540,7 @@ namespace datalog { : convenient_relation_project_fn(orig_sig, removed_col_cnt, removed_cols) { } - virtual relation_base * operator()(const relation_base & _r) { + relation_base * operator()(const relation_base & _r) override { karr_relation const& r = get(_r); karr_relation_plugin& p = r.get_plugin(); karr_relation* result = dynamic_cast(p.mk_full(0, get_result_signature())); @@ -559,7 +559,7 @@ namespace datalog { rename_fn(karr_relation_plugin& p, const relation_signature & orig_sig, unsigned cycle_len, const unsigned * cycle) : convenient_relation_rename_fn(orig_sig, cycle_len, cycle) {} - virtual relation_base * operator()(const relation_base & _r) { + relation_base * operator()(const relation_base & _r) override { karr_relation const& r = get(_r); karr_relation_plugin& p = r.get_plugin(); karr_relation* result = dynamic_cast(p.mk_full(0, get_result_signature())); @@ -676,7 +676,7 @@ namespace datalog { public: union_fn() {} - virtual void operator()(relation_base & _r, const relation_base & _src, relation_base * _delta) { + void operator()(relation_base & _r, const relation_base & _src, relation_base * _delta) override { karr_relation& r = get(_r); karr_relation const& src = get(_src); @@ -707,7 +707,7 @@ namespace datalog { filter_identical_fn(unsigned col_cnt, const unsigned * identical_cols) : m_identical_cols(col_cnt, identical_cols) {} - virtual void operator()(relation_base & _r) { + void operator()(relation_base & _r) override { karr_relation & r = get(_r); TRACE("dl", r.display(tout << "src:\n");); r.get_ineqs(); @@ -747,7 +747,7 @@ namespace datalog { m_valid = arith.is_numeral(value, m_value) && m_value.is_int(); } - virtual void operator()(relation_base & _r) { + void operator()(relation_base & _r) override { karr_relation & r = get(_r); if (m_valid) { r.get_ineqs(); @@ -779,7 +779,7 @@ namespace datalog { m_cond(cond, t.get_plugin().get_ast_manager()) { } - void operator()(relation_base& t) { + void operator()(relation_base& t) override { get(t).filter_interpreted(m_cond); TRACE("dl", tout << mk_pp(m_cond, m_cond.get_manager()) << "\n"; t.display(tout);); } diff --git a/src/muz/rel/karr_relation.h b/src/muz/rel/karr_relation.h index 47e10f09e..e8637f2bd 100644 --- a/src/muz/rel/karr_relation.h +++ b/src/muz/rel/karr_relation.h @@ -45,33 +45,33 @@ namespace datalog { a(get_ast_manager()) {} - virtual bool can_handle_signature(const relation_signature & sig) { + bool can_handle_signature(const relation_signature & sig) override { return get_manager().get_context().karr(); } static symbol get_name() { return symbol("karr_relation"); } - virtual relation_base * mk_empty(const relation_signature & s); + relation_base * mk_empty(const relation_signature & s) override; - virtual relation_base * mk_full(func_decl* p, const relation_signature & s); + relation_base * mk_full(func_decl* p, const relation_signature & s) override; static karr_relation& get(relation_base& r); static karr_relation const & get(relation_base const& r); - virtual relation_join_fn * mk_join_fn( - const relation_base & t1, const relation_base & t2, - unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); - virtual relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, - const unsigned * removed_cols); - virtual relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, - const unsigned * permutation_cycle); - virtual relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, - const relation_base * delta); - virtual relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, - const unsigned * identical_cols); - virtual relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, - unsigned col); - virtual relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition); + relation_join_fn * mk_join_fn( + const relation_base & t1, const relation_base & t2, + unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override; + relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, + const unsigned * removed_cols) override; + relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, + const unsigned * permutation_cycle) override; + relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, + const relation_base * delta) override; + relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, + const unsigned * identical_cols) override; + relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, + unsigned col) override; + relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition) override; private: bool dualizeI(matrix& dst, matrix const& src); diff --git a/src/muz/rel/rel_context.h b/src/muz/rel/rel_context.h index f4a87d496..0a31c4e9f 100644 --- a/src/muz/rel/rel_context.h +++ b/src/muz/rel/rel_context.h @@ -56,72 +56,72 @@ namespace datalog { public: rel_context(context& ctx); - virtual ~rel_context(); + ~rel_context() override; - virtual relation_manager & get_rmanager(); - virtual const relation_manager & get_rmanager() const; + relation_manager & get_rmanager() override; + const relation_manager & get_rmanager() const override; ast_manager& get_manager() const { return m; } context& get_context() const { return m_context; } - virtual relation_base & get_relation(func_decl * pred); - virtual relation_base * try_get_relation(func_decl * pred) const; - virtual bool is_empty_relation(func_decl* pred) const; - virtual expr_ref try_get_formula(func_decl * pred) const; - virtual expr_ref get_answer() { return m_answer; } + relation_base & get_relation(func_decl * pred) override; + relation_base * try_get_relation(func_decl * pred) const override; + bool is_empty_relation(func_decl* pred) const override; + expr_ref try_get_formula(func_decl * pred) const override; + expr_ref get_answer() override { return m_answer; } - virtual bool output_profile() const; + bool output_profile() const override; - virtual lbool query(expr* q); - virtual lbool query(unsigned num_rels, func_decl * const* rels); + lbool query(expr* q) override; + lbool query(unsigned num_rels, func_decl * const* rels) override; - virtual void set_predicate_representation(func_decl * pred, unsigned relation_name_cnt, - symbol const * relation_names); + void set_predicate_representation(func_decl * pred, unsigned relation_name_cnt, + symbol const * relation_names) override; - virtual void inherit_predicate_kind(func_decl* new_pred, func_decl* orig_pred); + void inherit_predicate_kind(func_decl* new_pred, func_decl* orig_pred) override; - virtual void collect_statistics(statistics& st) const; + void collect_statistics(statistics& st) const override; - virtual void updt_params(); + void updt_params() override; /** \brief Restrict the set of used predicates to \c res. The function deallocates unsused relations, it does not deal with rules. */ - virtual void restrict_predicates(func_decl_set const& predicates); + void restrict_predicates(func_decl_set const& predicates) override; - virtual void transform_rules(); + void transform_rules() override; - virtual bool try_get_size(func_decl* pred, unsigned& rel_size) const; + bool try_get_size(func_decl* pred, unsigned& rel_size) const override; /** \brief query result if it contains fact. */ - virtual bool result_contains_fact(relation_fact const& f); + bool result_contains_fact(relation_fact const& f) override; - virtual void collect_non_empty_predicates(func_decl_set& ps) { + void collect_non_empty_predicates(func_decl_set& ps) override { return get_rmanager().collect_non_empty_predicates(ps); } /** \brief add facts to relation */ - virtual void add_fact(func_decl* pred, relation_fact const& fact); - virtual void add_fact(func_decl* pred, table_fact const& fact); + void add_fact(func_decl* pred, relation_fact const& fact) override; + void add_fact(func_decl* pred, table_fact const& fact) override; /** \brief check if facts were added to relation */ - virtual bool has_facts(func_decl * pred) const; + bool has_facts(func_decl * pred) const override; /** \brief Store the relation \c rel under the predicate \c pred. The \c context object takes over the ownership of the relation object. */ - virtual void store_relation(func_decl * pred, relation_base * rel); + void store_relation(func_decl * pred, relation_base * rel) override; - virtual void display_output_facts(rule_set const& rules, std::ostream & out) const; - virtual void display_facts(std::ostream & out) const; + void display_output_facts(rule_set const& rules, std::ostream & out) const override; + void display_facts(std::ostream & out) const override; - virtual void display_profile(std::ostream& out); + void display_profile(std::ostream& out) override; - virtual lbool saturate(); + lbool saturate() override; }; }; diff --git a/src/muz/rel/udoc_relation.cpp b/src/muz/rel/udoc_relation.cpp index febabb36d..a5b9a2084 100644 --- a/src/muz/rel/udoc_relation.cpp +++ b/src/muz/rel/udoc_relation.cpp @@ -328,7 +328,7 @@ namespace datalog { t2.expand_column_vector(m_cols2); } - virtual relation_base * operator()(const relation_base & _r1, const relation_base & _r2) { + relation_base * operator()(const relation_base & _r1, const relation_base & _r2) override { udoc_relation const& r1 = get(_r1); udoc_relation const& r2 = get(_r2); TRACE("doc", r1.display(tout << "r1:\n"); r2.display(tout << "r2:\n");); @@ -369,7 +369,7 @@ namespace datalog { } } - virtual relation_base * operator()(const relation_base & tb) { + relation_base * operator()(const relation_base & tb) override { TRACE("doc", tb.display(tout << "src:\n");); udoc_relation const& t = get(tb); udoc_plugin& p = t.get_plugin(); @@ -462,7 +462,7 @@ namespace datalog { } } - virtual relation_base * operator()(const relation_base & _r) { + relation_base * operator()(const relation_base & _r) override { udoc_relation const& r = get(_r); TRACE("doc", r.display(tout << "r:\n");); udoc_plugin& p = r.get_plugin(); @@ -494,7 +494,7 @@ namespace datalog { public: union_fn() {} - virtual void operator()(relation_base & _r, const relation_base & _src, relation_base * _delta) { + void operator()(relation_base & _r, const relation_base & _src, relation_base * _delta) override { TRACE("doc", _r.display(tout << "dst:\n"); _src.display(tout << "src:\n");); udoc_relation& r = get(_r); udoc_relation const& src = get(_src); @@ -574,7 +574,7 @@ namespace datalog { } } - virtual void operator()(relation_base & _r) { + void operator()(relation_base & _r) override { udoc_relation& r = get(_r); udoc& d = r.get_udoc(); doc_manager& dm = r.get_dm(); @@ -602,10 +602,10 @@ namespace datalog { SASSERT(num_bits == hi - lo); dm.tbvm().set(m_filter->pos(), r, hi-1, lo); } - virtual ~filter_equal_fn() { + ~filter_equal_fn() override { dm.deallocate(m_filter); } - virtual void operator()(relation_base & tb) { + void operator()(relation_base & tb) override { udoc_relation & t = get(tb); t.get_udoc().intersect(dm, *m_filter); SASSERT(t.get_udoc().well_formed(t.get_dm())); @@ -932,11 +932,11 @@ namespace datalog { m_udoc.display(dm, tout) << "\n";); } - virtual ~filter_interpreted_fn() { + ~filter_interpreted_fn() override { m_udoc.reset(dm); } - virtual void operator()(relation_base & tb) { + void operator()(relation_base & tb) override { udoc_relation & t = get(tb); udoc& u = t.get_udoc(); SASSERT(u.well_formed(dm)); @@ -987,7 +987,7 @@ namespace datalog { // TBD: replace this by "join" given below. - virtual relation_base* operator()(relation_base const& t1, relation_base const& t2) { + relation_base* operator()(relation_base const& t1, relation_base const& t2) override { #if 1 return join(get(t1), get(t2)); #else @@ -1043,7 +1043,7 @@ namespace datalog { public: join_project_and_fn() {} - virtual relation_base* operator()(relation_base const& t1, relation_base const& t2) { + relation_base* operator()(relation_base const& t1, relation_base const& t2) override { udoc_relation *result = get(t1.clone()); result->get_udoc().intersect(result->get_dm(), get(t2).get_udoc()); return result; @@ -1121,7 +1121,7 @@ namespace datalog { neg.expand_column_vector(m_neg_cols); } - virtual void operator()(relation_base& tb, const relation_base& negb) { + void operator()(relation_base& tb, const relation_base& negb) override { udoc_relation& t = get(tb); udoc_relation const& n = get(negb); IF_VERBOSE(3, t.display(verbose_stream() << "dst:");); @@ -1223,10 +1223,10 @@ namespace datalog { t.compile_guard(guard, m_udoc, m_to_delete); } - virtual ~filter_proj_fn() { + ~filter_proj_fn() override { m_udoc.reset(dm); } - virtual relation_base* operator()(const relation_base & tb) { + relation_base* operator()(const relation_base & tb) override { udoc_relation const & t = get(tb); udoc const& u1 = t.get_udoc(); doc_manager& dm = t.get_dm(); diff --git a/src/muz/rel/udoc_relation.h b/src/muz/rel/udoc_relation.h index 15918d80d..87755f75e 100644 --- a/src/muz/rel/udoc_relation.h +++ b/src/muz/rel/udoc_relation.h @@ -39,21 +39,21 @@ namespace datalog { expr_ref to_formula(doc const& d) const; public: udoc_relation(udoc_plugin& p, relation_signature const& s); - virtual ~udoc_relation(); - virtual void reset(); - virtual void add_fact(const relation_fact & f); - virtual void add_new_fact(const relation_fact & f); - virtual bool contains_fact(const relation_fact & f) const; - virtual udoc_relation * clone() const; - virtual udoc_relation * complement(func_decl*) const; - virtual void to_formula(expr_ref& fml) const; + ~udoc_relation() override; + void reset() override; + void add_fact(const relation_fact & f) override; + void add_new_fact(const relation_fact & f) override; + bool contains_fact(const relation_fact & f) const override; + udoc_relation * clone() const override; + udoc_relation * complement(func_decl*) const override; + void to_formula(expr_ref& fml) const override; udoc_plugin& get_plugin() const; - virtual bool fast_empty() const { return m_elems.is_empty(); } - virtual bool empty() const; - virtual void display(std::ostream& out) const; - virtual bool is_precise() const { return true; } - virtual unsigned get_size_estimate_rows() const { return m_elems.size(); } - virtual unsigned get_size_estimate_bytes() const; + bool fast_empty() const override { return m_elems.is_empty(); } + bool empty() const override; + void display(std::ostream& out) const override; + bool is_precise() const override { return true; } + unsigned get_size_estimate_rows() const override { return m_elems.size(); } + unsigned get_size_estimate_bytes() const override; doc_manager& get_dm() const { return dm; } udoc const& get_udoc() const { return m_elems; } @@ -113,38 +113,38 @@ namespace datalog { expr* mk_numeral(rational const& r, sort* s); public: udoc_plugin(relation_manager& rm); - ~udoc_plugin(); - virtual bool can_handle_signature(const relation_signature & s); + ~udoc_plugin() override; + bool can_handle_signature(const relation_signature & s) override; static symbol get_name() { return symbol("doc"); } - virtual relation_base * mk_empty(const relation_signature & s); - virtual relation_base * mk_full(func_decl* p, const relation_signature & s); - virtual relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2, - unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); - virtual relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, - const unsigned * removed_cols); - virtual relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, - const unsigned * permutation_cycle); - virtual relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, - const relation_base * delta); - virtual relation_union_fn * mk_widen_fn(const relation_base & tgt, const relation_base & src, - const relation_base * delta); - virtual relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, - const unsigned * identical_cols); - virtual relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, - unsigned col); - virtual relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition); - virtual relation_intersection_filter_fn * mk_filter_by_negation_fn( + relation_base * mk_empty(const relation_signature & s) override; + relation_base * mk_full(func_decl* p, const relation_signature & s) override; + relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2, + unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override; + relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, + const unsigned * removed_cols) override; + relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, + const unsigned * permutation_cycle) override; + relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, + const relation_base * delta) override; + relation_union_fn * mk_widen_fn(const relation_base & tgt, const relation_base & src, + const relation_base * delta) override; + relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, + const unsigned * identical_cols) override; + relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, + unsigned col) override; + relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition) override; + relation_intersection_filter_fn * mk_filter_by_negation_fn( const relation_base& t, const relation_base& neg, unsigned joined_col_cnt, const unsigned *t_cols, - const unsigned *negated_cols); - virtual relation_transformer_fn * mk_filter_interpreted_and_project_fn( + const unsigned *negated_cols) override; + relation_transformer_fn * mk_filter_interpreted_and_project_fn( const relation_base & t, app * condition, - unsigned removed_col_cnt, const unsigned * removed_cols); - virtual relation_join_fn * mk_join_project_fn( + unsigned removed_col_cnt, const unsigned * removed_cols) override; + relation_join_fn * mk_join_project_fn( relation_base const& t1, relation_base const& t2, - unsigned joined_col_cnt, const unsigned * cols1, const unsigned * cols2, - unsigned removed_col_cnt, const unsigned * removed_cols); - + unsigned joined_col_cnt, const unsigned * cols1, const unsigned * cols2, + unsigned removed_col_cnt, const unsigned * removed_cols) override; + void disable_fast_pass() { m_disable_fast_pass = true; } }; }; diff --git a/src/muz/spacer/spacer_dl_interface.h b/src/muz/spacer/spacer_dl_interface.h index 1581762d5..e5a41427d 100644 --- a/src/muz/spacer/spacer_dl_interface.h +++ b/src/muz/spacer/spacer_dl_interface.h @@ -45,39 +45,39 @@ class dl_interface : public datalog::engine_base { public: dl_interface(datalog::context& ctx); - ~dl_interface(); + ~dl_interface() override; - lbool query(expr* query); + lbool query(expr* query) override; - lbool query_from_lvl(expr* query, unsigned lvl); + lbool query_from_lvl(expr* query, unsigned lvl) override; - void display_certificate(std::ostream& out) const; + void display_certificate(std::ostream& out) const override; - void collect_statistics(statistics& st) const; + void collect_statistics(statistics& st) const override; - void reset_statistics(); + void reset_statistics() override; - expr_ref get_answer(); + expr_ref get_answer() override; - expr_ref get_ground_sat_answer(); + expr_ref get_ground_sat_answer() override; - void get_rules_along_trace(datalog::rule_ref_vector& rules); + void get_rules_along_trace(datalog::rule_ref_vector& rules) override; - unsigned get_num_levels(func_decl* pred); + unsigned get_num_levels(func_decl* pred) override; - expr_ref get_cover_delta(int level, func_decl* pred); + expr_ref get_cover_delta(int level, func_decl* pred) override; - void add_cover(int level, func_decl* pred, expr* property); + void add_cover(int level, func_decl* pred, expr* property) override; - void add_invariant(func_decl* pred, expr* property); + void add_invariant(func_decl* pred, expr* property) override; - expr_ref get_reachable(func_decl *pred); + expr_ref get_reachable(func_decl *pred) override; - void updt_params(); + void updt_params() override; - model_ref get_model(); + model_ref get_model() override; - proof_ref get_proof(); + proof_ref get_proof() override; }; } diff --git a/src/muz/spacer/spacer_generalizers.h b/src/muz/spacer/spacer_generalizers.h index aa542ec04..1962e74e0 100644 --- a/src/muz/spacer/spacer_generalizers.h +++ b/src/muz/spacer/spacer_generalizers.h @@ -30,8 +30,8 @@ namespace spacer { class lemma_sanity_checker : public lemma_generalizer { public: lemma_sanity_checker(context& ctx) : lemma_generalizer(ctx) {} - virtual ~lemma_sanity_checker() {} - virtual void operator()(lemma_ref &lemma); + ~lemma_sanity_checker() override {} + void operator()(lemma_ref &lemma) override; }; /** @@ -53,11 +53,11 @@ class lemma_bool_inductive_generalizer : public lemma_generalizer { public: lemma_bool_inductive_generalizer(context& ctx, unsigned failure_limit) : lemma_generalizer(ctx), m_failure_limit(failure_limit) {} - virtual ~lemma_bool_inductive_generalizer() {} - virtual void operator()(lemma_ref &lemma); + ~lemma_bool_inductive_generalizer() override {} + void operator()(lemma_ref &lemma) override; - virtual void collect_statistics(statistics& st) const; - virtual void reset_statistics() {m_st.reset();} + void collect_statistics(statistics& st) const override; + void reset_statistics() override {m_st.reset();} }; class unsat_core_generalizer : public lemma_generalizer { @@ -72,26 +72,26 @@ class unsat_core_generalizer : public lemma_generalizer { stats m_st; public: unsat_core_generalizer(context &ctx) : lemma_generalizer(ctx) {} - virtual ~unsat_core_generalizer() {} - virtual void operator()(lemma_ref &lemma); + ~unsat_core_generalizer() override {} + void operator()(lemma_ref &lemma) override; - virtual void collect_statistics(statistics &st) const; - virtual void reset_statistics() {m_st.reset();} + void collect_statistics(statistics &st) const override; + void reset_statistics() override {m_st.reset();} }; class lemma_array_eq_generalizer : public lemma_generalizer { public: lemma_array_eq_generalizer(context &ctx) : lemma_generalizer(ctx) {} - virtual ~lemma_array_eq_generalizer() {} - virtual void operator()(lemma_ref &lemma); + ~lemma_array_eq_generalizer() override {} + void operator()(lemma_ref &lemma) override; }; class lemma_eq_generalizer : public lemma_generalizer { public: lemma_eq_generalizer(context &ctx) : lemma_generalizer(ctx) {} - virtual ~lemma_eq_generalizer() {} - virtual void operator()(lemma_ref &lemma); + ~lemma_eq_generalizer() override {} + void operator()(lemma_ref &lemma) override; }; diff --git a/src/muz/spacer/spacer_itp_solver.h b/src/muz/spacer/spacer_itp_solver.h index 8194379b8..8dbac022e 100644 --- a/src/muz/spacer/spacer_itp_solver.h +++ b/src/muz/spacer/spacer_itp_solver.h @@ -86,10 +86,10 @@ public: m_farkas_a_const(farkas_a_const) {} - virtual ~itp_solver() {} + ~itp_solver() override {} /* itp solver specific */ - virtual void get_unsat_core(expr_ref_vector &core); + void get_unsat_core(expr_ref_vector &core) override; virtual void get_itp_core(expr_ref_vector &core); void set_split_literals(bool v) {m_split_literals = v;} bool mk_proxies(expr_ref_vector &v, unsigned from = 0); @@ -104,53 +104,53 @@ public: /* solver interface */ - virtual solver* translate(ast_manager &m, params_ref const &p) + solver* translate(ast_manager &m, params_ref const &p) override {return m_solver.translate(m, p);} - virtual void updt_params(params_ref const &p) + void updt_params(params_ref const &p) override {m_solver.updt_params(p);} - virtual void collect_param_descrs(param_descrs &r) + void collect_param_descrs(param_descrs &r) override {m_solver.collect_param_descrs(r);} - virtual void set_produce_models(bool f) + void set_produce_models(bool f) override {m_solver.set_produce_models(f);} - virtual void assert_expr(expr *t) + void assert_expr(expr *t) override {m_solver.assert_expr(t);} - virtual void assert_expr(expr *t, expr *a) + void assert_expr(expr *t, expr *a) override {NOT_IMPLEMENTED_YET();} - virtual void push(); - virtual void pop(unsigned n); - virtual unsigned get_scope_level() const + void push() override; + void pop(unsigned n) override; + unsigned get_scope_level() const override {return m_solver.get_scope_level();} - virtual lbool check_sat(unsigned num_assumptions, expr * const *assumptions); - virtual void set_progress_callback(progress_callback *callback) + lbool check_sat(unsigned num_assumptions, expr * const *assumptions) override; + void set_progress_callback(progress_callback *callback) override {m_solver.set_progress_callback(callback);} - virtual unsigned get_num_assertions() const + unsigned get_num_assertions() const override {return m_solver.get_num_assertions();} - virtual expr * get_assertion(unsigned idx) const + expr * get_assertion(unsigned idx) const override {return m_solver.get_assertion(idx);} - virtual unsigned get_num_assumptions() const + unsigned get_num_assumptions() const override {return m_solver.get_num_assumptions();} - virtual expr * get_assumption(unsigned idx) const + expr * get_assumption(unsigned idx) const override {return m_solver.get_assumption(idx);} - virtual std::ostream &display(std::ostream &out, unsigned n, expr* const* es) const + std::ostream &display(std::ostream &out, unsigned n, expr* const* es) const override { return m_solver.display(out, n, es); } /* check_sat_result interface */ - virtual void collect_statistics(statistics &st) const ; + void collect_statistics(statistics &st) const override ; virtual void reset_statistics(); - virtual void get_unsat_core(ptr_vector &r); - virtual void get_model(model_ref &m) {m_solver.get_model(m);} - virtual proof *get_proof() {return m_solver.get_proof();} - virtual std::string reason_unknown() const + void get_unsat_core(ptr_vector &r) override; + void get_model(model_ref &m) override {m_solver.get_model(m);} + proof *get_proof() override {return m_solver.get_proof();} + std::string reason_unknown() const override {return m_solver.reason_unknown();} - virtual void set_reason_unknown(char const* msg) + void set_reason_unknown(char const* msg) override {m_solver.set_reason_unknown(msg);} - virtual void get_labels(svector &r) + void get_labels(svector &r) override {m_solver.get_labels(r);} - virtual ast_manager &get_manager() const {return m;} + ast_manager &get_manager() const override {return m;} virtual void refresh(); diff --git a/src/muz/spacer/spacer_qe_project.cpp b/src/muz/spacer/spacer_qe_project.cpp index 9f4f4e4fe..cde188aac 100644 --- a/src/muz/spacer/spacer_qe_project.cpp +++ b/src/muz/spacer/spacer_qe_project.cpp @@ -190,14 +190,14 @@ namespace qe { class is_relevant_default : public i_expr_pred { public: - bool operator()(expr* e) { + bool operator()(expr* e) override { return true; } }; class mk_atom_default : public i_nnf_atom { public: - virtual void operator()(expr* e, bool pol, expr_ref& result) { + void operator()(expr* e, bool pol, expr_ref& result) override { if (pol) result = e; else result = result.get_manager().mk_not(e); } diff --git a/src/muz/spacer/spacer_unsat_core_plugin.h b/src/muz/spacer/spacer_unsat_core_plugin.h index 96d03140c..2ea4b4b51 100644 --- a/src/muz/spacer/spacer_unsat_core_plugin.h +++ b/src/muz/spacer/spacer_unsat_core_plugin.h @@ -43,7 +43,7 @@ class unsat_core_plugin_lemma : public unsat_core_plugin { public: unsat_core_plugin_lemma(unsat_core_learner& learner) : unsat_core_plugin(learner){}; - virtual void compute_partial_core(proof* step) override; + void compute_partial_core(proof* step) override; private: void add_lowest_split_to_core(proof* step) const; @@ -55,7 +55,7 @@ class unsat_core_plugin_farkas_lemma : public unsat_core_plugin { public: unsat_core_plugin_farkas_lemma(unsat_core_learner& learner, bool split_literals, bool use_constant_from_a=true) : unsat_core_plugin(learner), m_split_literals(split_literals), m_use_constant_from_a(use_constant_from_a) {}; - virtual void compute_partial_core(proof* step) override; + void compute_partial_core(proof* step) override; private: bool m_split_literals; @@ -71,8 +71,8 @@ private: public: unsat_core_plugin_farkas_lemma_optimized(unsat_core_learner& learner, ast_manager& m) : unsat_core_plugin(learner), m(m) {}; - virtual void compute_partial_core(proof* step) override; - virtual void finalize() override; + void compute_partial_core(proof* step) override; + void finalize() override; protected: vector > > m_linear_combinations; @@ -88,7 +88,7 @@ private: public: unsat_core_plugin_farkas_lemma_bounded(unsat_core_learner& learner, ast_manager& m) : unsat_core_plugin_farkas_lemma_optimized(learner, m) {}; - virtual void finalize() override; + void finalize() override; }; class unsat_core_plugin_min_cut : public unsat_core_plugin { @@ -96,8 +96,8 @@ private: public: unsat_core_plugin_min_cut(unsat_core_learner& learner, ast_manager& m); - virtual void compute_partial_core(proof* step) override; - virtual void finalize() override; + void compute_partial_core(proof* step) override; + void finalize() override; private: ast_manager& m; diff --git a/src/muz/spacer/spacer_virtual_solver.h b/src/muz/spacer/spacer_virtual_solver.h index fed64c589..38e038d9e 100644 --- a/src/muz/spacer/spacer_virtual_solver.h +++ b/src/muz/spacer/spacer_virtual_solver.h @@ -65,46 +65,46 @@ private: void refresh(); public: - virtual ~virtual_solver(); - virtual unsigned get_num_assumptions() const + ~virtual_solver() override; + unsigned get_num_assumptions() const override { unsigned sz = solver_na2as::get_num_assumptions(); return m_virtual ? sz - 1 : sz; } - virtual expr* get_assumption(unsigned idx) const + expr* get_assumption(unsigned idx) const override { if(m_virtual) { idx++; } return solver_na2as::get_assumption(idx); } - virtual void get_unsat_core(ptr_vector &r); - virtual void assert_expr(expr *e); - virtual void collect_statistics(statistics &st) const {} - virtual void get_model(model_ref &m) {m_context.get_model(m);} - virtual proof* get_proof(); - virtual std::string reason_unknown() const + void get_unsat_core(ptr_vector &r) override; + void assert_expr(expr *e) override; + void collect_statistics(statistics &st) const override {} + void get_model(model_ref &m) override {m_context.get_model(m);} + proof* get_proof() override; + std::string reason_unknown() const override {return m_context.last_failure_as_string();} - virtual void set_reason_unknown(char const *msg) + void set_reason_unknown(char const *msg) override {m_context.set_reason_unknown(msg);} - virtual ast_manager& get_manager() const {return m;} - virtual void get_labels(svector &r); - virtual void set_produce_models(bool f); + ast_manager& get_manager() const override {return m;} + void get_labels(svector &r) override; + void set_produce_models(bool f) override; virtual bool get_produce_models(); virtual smt_params &fparams(); virtual void reset(); - virtual void set_progress_callback(progress_callback *callback) + void set_progress_callback(progress_callback *callback) override {UNREACHABLE();} - virtual solver *translate(ast_manager &m, params_ref const &p); + solver *translate(ast_manager &m, params_ref const &p) override; - virtual void updt_params(params_ref const &p); - virtual void collect_param_descrs(param_descrs &r); + void updt_params(params_ref const &p) override; + void collect_param_descrs(param_descrs &r) override; protected: - virtual lbool check_sat_core(unsigned num_assumptions, expr *const * assumptions); - virtual void push_core(); - virtual void pop_core(unsigned n); + lbool check_sat_core(unsigned num_assumptions, expr *const * assumptions) override; + void push_core() override; + void pop_core(unsigned n) override; }; /// multi-solver abstraction on top of a single smt::kernel diff --git a/src/muz/tab/tab_context.h b/src/muz/tab/tab_context.h index 329234524..84d6e2420 100644 --- a/src/muz/tab/tab_context.h +++ b/src/muz/tab/tab_context.h @@ -32,13 +32,13 @@ namespace datalog { imp* m_imp; public: tab(context& ctx); - ~tab(); - virtual lbool query(expr* query); - virtual void cleanup(); - virtual void reset_statistics(); - virtual void collect_statistics(statistics& st) const; - virtual void display_certificate(std::ostream& out) const; - virtual expr_ref get_answer(); + ~tab() override; + lbool query(expr* query) override; + void cleanup() override; + void reset_statistics() override; + void collect_statistics(statistics& st) const override; + void display_certificate(std::ostream& out) const override; + expr_ref get_answer() override; }; }; diff --git a/src/muz/transforms/dl_mk_array_blast.h b/src/muz/transforms/dl_mk_array_blast.h index e7b951168..ba2f826dd 100644 --- a/src/muz/transforms/dl_mk_array_blast.h +++ b/src/muz/transforms/dl_mk_array_blast.h @@ -66,9 +66,9 @@ namespace datalog { */ mk_array_blast(context & ctx, unsigned priority); - virtual ~mk_array_blast(); + ~mk_array_blast() override; - rule_set * operator()(rule_set const & source); + rule_set * operator()(rule_set const & source) override; }; diff --git a/src/muz/transforms/dl_mk_array_eq_rewrite.h b/src/muz/transforms/dl_mk_array_eq_rewrite.h index 166c01142..298697998 100644 --- a/src/muz/transforms/dl_mk_array_eq_rewrite.h +++ b/src/muz/transforms/dl_mk_array_eq_rewrite.h @@ -40,8 +40,8 @@ namespace datalog { public: mk_array_eq_rewrite(context & ctx, unsigned priority); - rule_set * operator()(rule_set const & source); - virtual ~mk_array_eq_rewrite(){} + rule_set * operator()(rule_set const & source) override; + ~mk_array_eq_rewrite() override{} }; diff --git a/src/muz/transforms/dl_mk_array_instantiation.h b/src/muz/transforms/dl_mk_array_instantiation.h index b87f679fc..cd5715a4f 100644 --- a/src/muz/transforms/dl_mk_array_instantiation.h +++ b/src/muz/transforms/dl_mk_array_instantiation.h @@ -112,8 +112,8 @@ namespace datalog { expr_ref_vector getId(app*old_pred, const expr_ref_vector& new_args); public: mk_array_instantiation(context & ctx, unsigned priority); - rule_set * operator()(rule_set const & source); - virtual ~mk_array_instantiation(){} + rule_set * operator()(rule_set const & source) override; + ~mk_array_instantiation() override{} }; diff --git a/src/muz/transforms/dl_mk_backwards.h b/src/muz/transforms/dl_mk_backwards.h index ca441fd0a..344da2afb 100644 --- a/src/muz/transforms/dl_mk_backwards.h +++ b/src/muz/transforms/dl_mk_backwards.h @@ -28,8 +28,8 @@ namespace datalog { context& m_ctx; public: mk_backwards(context & ctx, unsigned priority = 33000); - ~mk_backwards(); - rule_set * operator()(rule_set const & source); + ~mk_backwards() override; + rule_set * operator()(rule_set const & source) override; }; }; diff --git a/src/muz/transforms/dl_mk_bit_blast.cpp b/src/muz/transforms/dl_mk_bit_blast.cpp index 3c8045e34..8637af14f 100644 --- a/src/muz/transforms/dl_mk_bit_blast.cpp +++ b/src/muz/transforms/dl_mk_bit_blast.cpp @@ -59,11 +59,11 @@ namespace datalog { m_new_funcs.push_back(new_f); } - virtual model_converter * translate(ast_translation & translator) { + model_converter * translate(ast_translation & translator) override { return alloc(bit_blast_model_converter, m); } - virtual void operator()(model_ref & model) { + void operator()(model_ref & model) override { for (unsigned i = 0; i < m_new_funcs.size(); ++i) { func_decl* p = m_new_funcs[i].get(); func_decl* q = m_old_funcs[i].get(); diff --git a/src/muz/transforms/dl_mk_bit_blast.h b/src/muz/transforms/dl_mk_bit_blast.h index 31df57567..a8be254a6 100644 --- a/src/muz/transforms/dl_mk_bit_blast.h +++ b/src/muz/transforms/dl_mk_bit_blast.h @@ -28,8 +28,8 @@ namespace datalog { impl* m_impl; public: mk_bit_blast(context & ctx, unsigned priority = 35000); - ~mk_bit_blast(); - rule_set * operator()(rule_set const & source); + ~mk_bit_blast() override; + rule_set * operator()(rule_set const & source) override; }; }; diff --git a/src/muz/transforms/dl_mk_coalesce.h b/src/muz/transforms/dl_mk_coalesce.h index 47d702fbb..7721d7556 100644 --- a/src/muz/transforms/dl_mk_coalesce.h +++ b/src/muz/transforms/dl_mk_coalesce.h @@ -52,7 +52,7 @@ namespace datalog { */ mk_coalesce(context & ctx); - rule_set * operator()(rule_set const & source); + rule_set * operator()(rule_set const & source) override; }; }; diff --git a/src/muz/transforms/dl_mk_coi_filter.h b/src/muz/transforms/dl_mk_coi_filter.h index c03308b6a..4fe7033bd 100644 --- a/src/muz/transforms/dl_mk_coi_filter.h +++ b/src/muz/transforms/dl_mk_coi_filter.h @@ -42,7 +42,7 @@ namespace datalog { m(ctx.get_manager()), m_context(ctx) {} - rule_set * operator()(rule_set const & source); + rule_set * operator()(rule_set const & source) override; }; } diff --git a/src/muz/transforms/dl_mk_filter_rules.h b/src/muz/transforms/dl_mk_filter_rules.h index b81921d59..3e357dc4e 100644 --- a/src/muz/transforms/dl_mk_filter_rules.h +++ b/src/muz/transforms/dl_mk_filter_rules.h @@ -73,11 +73,11 @@ namespace datalog { public: mk_filter_rules(context & ctx); - ~mk_filter_rules(); + ~mk_filter_rules() override; /** \brief Return a new rule set where only filter rules contain atoms with repeated variables and/or values. */ - rule_set * operator()(rule_set const & source); + rule_set * operator()(rule_set const & source) override; }; }; diff --git a/src/muz/transforms/dl_mk_interp_tail_simplifier.h b/src/muz/transforms/dl_mk_interp_tail_simplifier.h index a8a7393cd..e9120b9b1 100644 --- a/src/muz/transforms/dl_mk_interp_tail_simplifier.h +++ b/src/muz/transforms/dl_mk_interp_tail_simplifier.h @@ -90,7 +90,7 @@ namespace datalog { bool transform_rules(const rule_set & orig, rule_set & tgt); public: mk_interp_tail_simplifier(context & ctx, unsigned priority=40000); - virtual ~mk_interp_tail_simplifier(); + ~mk_interp_tail_simplifier() override; /**If rule should be retained, assign transformed version to res and return true; if rule can be deleted, return false. @@ -100,7 +100,7 @@ namespace datalog { */ bool transform_rule(rule * r, rule_ref& res); - rule_set * operator()(rule_set const & source); + rule_set * operator()(rule_set const & source) override; }; }; diff --git a/src/muz/transforms/dl_mk_karr_invariants.cpp b/src/muz/transforms/dl_mk_karr_invariants.cpp index 48219eeb9..5dafafb19 100644 --- a/src/muz/transforms/dl_mk_karr_invariants.cpp +++ b/src/muz/transforms/dl_mk_karr_invariants.cpp @@ -111,7 +111,7 @@ namespace datalog { add_invariant_model_converter(ast_manager& m): m(m), a(m), m_funcs(m), m_invs(m) {} - virtual ~add_invariant_model_converter() { } + ~add_invariant_model_converter() override { } void add(func_decl* p, expr* inv) { if (!m.is_true(inv)) { @@ -120,7 +120,7 @@ namespace datalog { } } - virtual void operator()(model_ref & mr) { + void operator()(model_ref & mr) override { for (unsigned i = 0; i < m_funcs.size(); ++i) { func_decl* p = m_funcs[i].get(); func_interp* f = mr->get_func_interp(p); @@ -142,7 +142,7 @@ namespace datalog { } } - virtual model_converter * translate(ast_translation & translator) { + model_converter * translate(ast_translation & translator) override { add_invariant_model_converter* mc = alloc(add_invariant_model_converter, m); for (unsigned i = 0; i < m_funcs.size(); ++i) { mc->add(translator(m_funcs[i].get()), m_invs[i].get()); diff --git a/src/muz/transforms/dl_mk_karr_invariants.h b/src/muz/transforms/dl_mk_karr_invariants.h index b31f1f8d9..cf021efda 100644 --- a/src/muz/transforms/dl_mk_karr_invariants.h +++ b/src/muz/transforms/dl_mk_karr_invariants.h @@ -65,9 +65,9 @@ namespace datalog { public: mk_karr_invariants(context & ctx, unsigned priority); - virtual ~mk_karr_invariants(); + ~mk_karr_invariants() override; - rule_set * operator()(rule_set const & source); + rule_set * operator()(rule_set const & source) override; }; diff --git a/src/muz/transforms/dl_mk_loop_counter.h b/src/muz/transforms/dl_mk_loop_counter.h index fb4b6d704..cf79dc218 100644 --- a/src/muz/transforms/dl_mk_loop_counter.h +++ b/src/muz/transforms/dl_mk_loop_counter.h @@ -36,9 +36,9 @@ namespace datalog { app_ref del_arg(app* fn); public: mk_loop_counter(context & ctx, unsigned priority = 33000); - ~mk_loop_counter(); + ~mk_loop_counter() override; - rule_set * operator()(rule_set const & source); + rule_set * operator()(rule_set const & source) override; func_decl* get_old(func_decl* f) const { return m_new2old.find(f); } diff --git a/src/muz/transforms/dl_mk_magic_sets.h b/src/muz/transforms/dl_mk_magic_sets.h index 73b5e94f6..dc3ad03b7 100644 --- a/src/muz/transforms/dl_mk_magic_sets.h +++ b/src/muz/transforms/dl_mk_magic_sets.h @@ -126,7 +126,7 @@ namespace datalog { */ mk_magic_sets(context & ctx, func_decl* goal); - rule_set * operator()(rule_set const & source); + rule_set * operator()(rule_set const & source) override; }; }; diff --git a/src/muz/transforms/dl_mk_magic_symbolic.h b/src/muz/transforms/dl_mk_magic_symbolic.h index 9c51a5287..451b2c46f 100644 --- a/src/muz/transforms/dl_mk_magic_symbolic.h +++ b/src/muz/transforms/dl_mk_magic_symbolic.h @@ -30,8 +30,8 @@ namespace datalog { app_ref mk_query(app* q); public: mk_magic_symbolic(context & ctx, unsigned priority = 33037); - ~mk_magic_symbolic(); - rule_set * operator()(rule_set const & source); + ~mk_magic_symbolic() override; + rule_set * operator()(rule_set const & source) override; }; }; diff --git a/src/muz/transforms/dl_mk_quantifier_abstraction.cpp b/src/muz/transforms/dl_mk_quantifier_abstraction.cpp index b171aaa7c..a4a5ac35f 100644 --- a/src/muz/transforms/dl_mk_quantifier_abstraction.cpp +++ b/src/muz/transforms/dl_mk_quantifier_abstraction.cpp @@ -47,9 +47,9 @@ namespace datalog { qa_model_converter(ast_manager& m): m(m), m_old_funcs(m), m_new_funcs(m) {} - virtual ~qa_model_converter() {} + ~qa_model_converter() override {} - virtual model_converter * translate(ast_translation & translator) { + model_converter * translate(ast_translation & translator) override { return alloc(qa_model_converter, m); } @@ -61,7 +61,7 @@ namespace datalog { m_sorts.push_back(sorts); } - virtual void operator()(model_ref & old_model) { + void operator()(model_ref & old_model) override { model_ref new_model = alloc(model, m); for (unsigned i = 0; i < m_new_funcs.size(); ++i) { func_decl* p = m_new_funcs[i].get(); diff --git a/src/muz/transforms/dl_mk_quantifier_abstraction.h b/src/muz/transforms/dl_mk_quantifier_abstraction.h index 593e458b9..83d0e975d 100644 --- a/src/muz/transforms/dl_mk_quantifier_abstraction.h +++ b/src/muz/transforms/dl_mk_quantifier_abstraction.h @@ -51,9 +51,9 @@ namespace datalog { public: mk_quantifier_abstraction(context & ctx, unsigned priority); - virtual ~mk_quantifier_abstraction(); + ~mk_quantifier_abstraction() override; - rule_set * operator()(rule_set const & source); + rule_set * operator()(rule_set const & source) override; }; diff --git a/src/muz/transforms/dl_mk_quantifier_instantiation.h b/src/muz/transforms/dl_mk_quantifier_instantiation.h index 4f1626ec6..f8e12f712 100644 --- a/src/muz/transforms/dl_mk_quantifier_instantiation.h +++ b/src/muz/transforms/dl_mk_quantifier_instantiation.h @@ -61,9 +61,9 @@ namespace datalog { public: mk_quantifier_instantiation(context & ctx, unsigned priority); - virtual ~mk_quantifier_instantiation(); + ~mk_quantifier_instantiation() override; - rule_set * operator()(rule_set const & source); + rule_set * operator()(rule_set const & source) override; }; diff --git a/src/muz/transforms/dl_mk_rule_inliner.h b/src/muz/transforms/dl_mk_rule_inliner.h index 55b9b9487..7b00d26ad 100644 --- a/src/muz/transforms/dl_mk_rule_inliner.h +++ b/src/muz/transforms/dl_mk_rule_inliner.h @@ -89,7 +89,7 @@ namespace datalog { obj_map m_positions; public: visitor(context& c, substitution & s): st_visitor(s), m_context(c) { (void) m_context; } - virtual bool operator()(expr* e); + bool operator()(expr* e) override; void reset() { m_unifiers.reset(); } void reset(unsigned sz); svector& can_remove() { return m_can_remove; } @@ -194,9 +194,9 @@ namespace datalog { m_head_visitor(ctx, m_subst), m_tail_visitor(ctx, m_subst) {} - virtual ~mk_rule_inliner() { } + ~mk_rule_inliner() override { } - rule_set * operator()(rule_set const & source); + rule_set * operator()(rule_set const & source) override; }; }; diff --git a/src/muz/transforms/dl_mk_scale.cpp b/src/muz/transforms/dl_mk_scale.cpp index 5bc10b957..abc5d20e7 100644 --- a/src/muz/transforms/dl_mk_scale.cpp +++ b/src/muz/transforms/dl_mk_scale.cpp @@ -30,7 +30,7 @@ namespace datalog { public: scale_model_converter(ast_manager& m): m(m), m_trail(m), a(m) {} - virtual ~scale_model_converter() {} + ~scale_model_converter() override {} void add_new2old(func_decl* new_f, func_decl* old_f) { m_trail.push_back(old_f); @@ -38,7 +38,7 @@ namespace datalog { m_new2old.insert(new_f, old_f); } - virtual void operator()(model_ref& md) { + void operator()(model_ref& md) override { model_ref old_model = alloc(model, m); obj_map::iterator it = m_new2old.begin(); obj_map::iterator end = m_new2old.end(); @@ -95,7 +95,7 @@ namespace datalog { //TRACE("dl", model_smt2_pp(tout, m, *md, 0); ); } - virtual model_converter * translate(ast_translation & translator) { + model_converter * translate(ast_translation & translator) override { UNREACHABLE(); return 0; } diff --git a/src/muz/transforms/dl_mk_scale.h b/src/muz/transforms/dl_mk_scale.h index 10a5ea8b2..c171a1d06 100644 --- a/src/muz/transforms/dl_mk_scale.h +++ b/src/muz/transforms/dl_mk_scale.h @@ -43,8 +43,8 @@ namespace datalog { app_ref mk_constraint(unsigned num_vars, app* q); public: mk_scale(context & ctx, unsigned priority = 33039); - virtual ~mk_scale(); - rule_set * operator()(rule_set const & source); + ~mk_scale() override; + rule_set * operator()(rule_set const & source) override; }; }; diff --git a/src/muz/transforms/dl_mk_separate_negated_tails.h b/src/muz/transforms/dl_mk_separate_negated_tails.h index a5cdda003..aae90b2db 100644 --- a/src/muz/transforms/dl_mk_separate_negated_tails.h +++ b/src/muz/transforms/dl_mk_separate_negated_tails.h @@ -51,7 +51,7 @@ namespace datalog { public: mk_separate_negated_tails(context& ctx, unsigned priority = 21000); - rule_set * operator()(rule_set const & source); + rule_set * operator()(rule_set const & source) override; }; } diff --git a/src/muz/transforms/dl_mk_slice.cpp b/src/muz/transforms/dl_mk_slice.cpp index dc11935e3..3c5cf53c7 100644 --- a/src/muz/transforms/dl_mk_slice.cpp +++ b/src/muz/transforms/dl_mk_slice.cpp @@ -271,14 +271,14 @@ namespace datalog { m_renaming.insert(orig_rule, unsigned_vector(sz, renaming)); } - virtual void operator()(ast_manager& m, unsigned num_source, proof * const * source, proof_ref & result) { + void operator()(ast_manager& m, unsigned num_source, proof * const * source, proof_ref & result) override { SASSERT(num_source == 1); result = source[0]; init_form2rule(); translate_proof(result); } - virtual proof_converter * translate(ast_translation & translator) { + proof_converter * translate(ast_translation & translator) override { UNREACHABLE(); // this would require implementing translation for the dl_context. return 0; @@ -305,7 +305,7 @@ namespace datalog { m_sliceable.insert(f, bv); } - virtual void operator()(model_ref & md) { + void operator()(model_ref & md) override { if (m_slice2old.empty()) { return; } @@ -391,7 +391,7 @@ namespace datalog { TRACE("dl", model_smt2_pp(tout, m, *md, 0); ); } - virtual model_converter * translate(ast_translation & translator) { + model_converter * translate(ast_translation & translator) override { UNREACHABLE(); return 0; } diff --git a/src/muz/transforms/dl_mk_slice.h b/src/muz/transforms/dl_mk_slice.h index 4a7d4a81a..0bc58c95a 100644 --- a/src/muz/transforms/dl_mk_slice.h +++ b/src/muz/transforms/dl_mk_slice.h @@ -100,9 +100,9 @@ namespace datalog { */ mk_slice(context & ctx); - virtual ~mk_slice() { } + ~mk_slice() override { } - rule_set * operator()(rule_set const & source); + rule_set * operator()(rule_set const & source) override; func_decl* get_predicate(func_decl* p) { func_decl* q = p; m_predicates.find(p, q); return q; } diff --git a/src/muz/transforms/dl_mk_subsumption_checker.h b/src/muz/transforms/dl_mk_subsumption_checker.h index 01d828d6e..8c71096c3 100644 --- a/src/muz/transforms/dl_mk_subsumption_checker.h +++ b/src/muz/transforms/dl_mk_subsumption_checker.h @@ -80,11 +80,11 @@ namespace datalog { m_context(ctx), m_ref_holder(ctx.get_rule_manager()), m_new_total_relation_discovery_during_transformation(true) {} - ~mk_subsumption_checker() { + ~mk_subsumption_checker() override { reset_dealloc_values(m_ground_unconditional_rule_heads); } - virtual rule_set * operator()(rule_set const & source); + rule_set * operator()(rule_set const & source) override; }; }; diff --git a/src/muz/transforms/dl_mk_unbound_compressor.h b/src/muz/transforms/dl_mk_unbound_compressor.h index 6f53e0707..b37a2f1a7 100644 --- a/src/muz/transforms/dl_mk_unbound_compressor.h +++ b/src/muz/transforms/dl_mk_unbound_compressor.h @@ -86,7 +86,7 @@ namespace datalog { public: mk_unbound_compressor(context & ctx); - rule_set * operator()(rule_set const & source); + rule_set * operator()(rule_set const & source) override; }; }; diff --git a/src/muz/transforms/dl_mk_unfold.h b/src/muz/transforms/dl_mk_unfold.h index 8ebe2d328..02469e6fb 100644 --- a/src/muz/transforms/dl_mk_unfold.h +++ b/src/muz/transforms/dl_mk_unfold.h @@ -44,7 +44,7 @@ namespace datalog { */ mk_unfold(context & ctx); - rule_set * operator()(rule_set const & source); + rule_set * operator()(rule_set const & source) override; }; }; diff --git a/src/opt/maxsmt.h b/src/opt/maxsmt.h index 7b4be9842..ebe226db0 100644 --- a/src/opt/maxsmt.h +++ b/src/opt/maxsmt.h @@ -73,15 +73,15 @@ namespace opt { public: maxsmt_solver_base(maxsat_context& c, weights_t& ws, expr_ref_vector const& soft); - virtual ~maxsmt_solver_base() {} - virtual rational get_lower() const { return m_lower; } - virtual rational get_upper() const { return m_upper; } - virtual bool get_assignment(unsigned index) const { return m_assignment[index]; } - virtual void collect_statistics(statistics& st) const { } - virtual void get_model(model_ref& mdl, svector& labels) { mdl = m_model.get(); labels = m_labels;} + ~maxsmt_solver_base() override {} + rational get_lower() const override { return m_lower; } + rational get_upper() const override { return m_upper; } + bool get_assignment(unsigned index) const override { return m_assignment[index]; } + void collect_statistics(statistics& st) const override { } + void get_model(model_ref& mdl, svector& labels) override { mdl = m_model.get(); labels = m_labels;} virtual void commit_assignment(); void set_model() { s().get_model(m_model); s().get_labels(m_labels); } - virtual void updt_params(params_ref& p); + void updt_params(params_ref& p) override; solver& s(); bool init(); void set_mus(bool f); diff --git a/src/opt/opt_context.h b/src/opt/opt_context.h index 372c6672c..c9e5ce3de 100644 --- a/src/opt/opt_context.h +++ b/src/opt/opt_context.h @@ -173,7 +173,7 @@ namespace opt { std::string m_unknown; public: context(ast_manager& m); - virtual ~context(); + ~context() override; unsigned add_soft_constraint(expr* f, rational const& w, symbol const& id); unsigned add_objective(app* t, bool is_max); void add_hard_constraint(expr* f); @@ -181,30 +181,30 @@ namespace opt { void get_hard_constraints(expr_ref_vector& hard); expr_ref get_objective(unsigned i); - virtual void push(); - virtual void pop(unsigned n); - virtual bool empty() { return m_scoped_state.m_objectives.empty(); } - virtual void set_hard_constraints(ptr_vector & hard); - virtual lbool optimize(); - virtual void set_model(model_ref& _m) { m_model = _m; } - virtual void get_model(model_ref& _m); - virtual void get_box_model(model_ref& _m, unsigned index); - virtual void fix_model(model_ref& _m); - virtual void collect_statistics(statistics& stats) const; - virtual proof* get_proof() { return 0; } - virtual void get_labels(svector & r); - virtual void get_unsat_core(ptr_vector & r); - virtual std::string reason_unknown() const; - virtual void set_reason_unknown(char const* msg) { m_unknown = msg; } + void push() override; + void pop(unsigned n) override; + bool empty() override { return m_scoped_state.m_objectives.empty(); } + void set_hard_constraints(ptr_vector & hard) override; + lbool optimize() override; + void set_model(model_ref& _m) override { m_model = _m; } + void get_model(model_ref& _m) override; + void get_box_model(model_ref& _m, unsigned index) override; + void fix_model(model_ref& _m) override; + void collect_statistics(statistics& stats) const override; + proof* get_proof() override { return 0; } + void get_labels(svector & r) override; + void get_unsat_core(ptr_vector & r) override; + std::string reason_unknown() const override; + void set_reason_unknown(char const* msg) override { m_unknown = msg; } - virtual void display_assignment(std::ostream& out); - virtual bool is_pareto() { return m_pareto.get() != 0; } - virtual void set_logic(symbol const& s) { m_logic = s; } + void display_assignment(std::ostream& out) override; + bool is_pareto() override { return m_pareto.get() != 0; } + void set_logic(symbol const& s) override { m_logic = s; } void set_clausal(bool f) { m_is_clausal = f; } void display(std::ostream& out); static void collect_param_descrs(param_descrs & r); - virtual void updt_params(params_ref const& p); + void updt_params(params_ref const& p) override; params_ref& get_params() { return m_params; } expr_ref get_lower(unsigned idx); @@ -216,25 +216,25 @@ namespace opt { std::string to_string() const; - virtual unsigned num_objectives() { return m_scoped_state.m_objectives.size(); } - virtual expr_ref mk_gt(unsigned i, model_ref& model); - virtual expr_ref mk_ge(unsigned i, model_ref& model); - virtual expr_ref mk_le(unsigned i, model_ref& model); + unsigned num_objectives() override { return m_scoped_state.m_objectives.size(); } + expr_ref mk_gt(unsigned i, model_ref& model) override; + expr_ref mk_ge(unsigned i, model_ref& model) override; + expr_ref mk_le(unsigned i, model_ref& model) override; - virtual smt::context& smt_context() { return m_opt_solver->get_context(); } - virtual filter_model_converter& fm() { return m_fm; } - virtual bool sat_enabled() const { return 0 != m_sat_solver.get(); } - virtual solver& get_solver(); - virtual ast_manager& get_manager() const { return this->m; } - virtual params_ref& params() { return m_params; } - virtual void enable_sls(bool force); - virtual symbol const& maxsat_engine() const { return m_maxsat_engine; } - virtual void get_base_model(model_ref& _m); + smt::context& smt_context() override { return m_opt_solver->get_context(); } + filter_model_converter& fm() override { return m_fm; } + bool sat_enabled() const override { return 0 != m_sat_solver.get(); } + solver& get_solver() override; + ast_manager& get_manager() const override { return this->m; } + params_ref& params() override { return m_params; } + void enable_sls(bool force) override; + symbol const& maxsat_engine() const override { return m_maxsat_engine; } + void get_base_model(model_ref& _m) override; - virtual bool verify_model(unsigned id, model* mdl, rational const& v); + bool verify_model(unsigned id, model* mdl, rational const& v) override; - virtual void model_updated(model* mdl); + void model_updated(model* mdl) override; private: lbool execute(objective const& obj, bool committed, bool scoped); diff --git a/src/opt/opt_pareto.h b/src/opt/opt_pareto.h index c0ccc93da..5a2aab6f3 100644 --- a/src/opt/opt_pareto.h +++ b/src/opt/opt_pareto.h @@ -87,9 +87,9 @@ namespace opt { params_ref & p): pareto_base(m, cb, s, p) { } - virtual ~gia_pareto() {} + ~gia_pareto() override {} - virtual lbool operator()(); + lbool operator()() override; }; // opportunistic improvement algorithm. @@ -101,9 +101,9 @@ namespace opt { params_ref & p): pareto_base(m, cb, s, p) { } - virtual ~oia_pareto() {} + ~oia_pareto() override {} - virtual lbool operator()(); + lbool operator()() override; }; } diff --git a/src/opt/opt_solver.h b/src/opt/opt_solver.h index 4bd23c120..41e9dee2d 100644 --- a/src/opt/opt_solver.h +++ b/src/opt/opt_solver.h @@ -85,28 +85,28 @@ namespace opt { bool m_was_unknown; public: opt_solver(ast_manager & m, params_ref const & p, filter_model_converter& fm); - virtual ~opt_solver(); + ~opt_solver() override; - virtual solver* translate(ast_manager& m, params_ref const& p); - virtual void updt_params(params_ref const& p); - virtual void collect_param_descrs(param_descrs & r); - virtual void collect_statistics(statistics & st) const; - virtual void assert_expr(expr * t); - virtual void push_core(); - virtual void pop_core(unsigned n); - virtual lbool check_sat_core(unsigned num_assumptions, expr * const * assumptions); - virtual void get_unsat_core(ptr_vector & r); - virtual void get_model(model_ref & _m); - virtual proof * get_proof(); - virtual std::string reason_unknown() const; - virtual void set_reason_unknown(char const* msg); - virtual void get_labels(svector & r); - virtual void set_progress_callback(progress_callback * callback); - virtual unsigned get_num_assertions() const; - virtual expr * get_assertion(unsigned idx) const; - virtual ast_manager& get_manager() const { return m; } - virtual lbool find_mutexes(expr_ref_vector const& vars, vector& mutexes); - virtual lbool preferred_sat(expr_ref_vector const& asms, vector& cores); + solver* translate(ast_manager& m, params_ref const& p) override; + void updt_params(params_ref const& p) override; + void collect_param_descrs(param_descrs & r) override; + void collect_statistics(statistics & st) const override; + void assert_expr(expr * t) override; + void push_core() override; + void pop_core(unsigned n) override; + lbool check_sat_core(unsigned num_assumptions, expr * const * assumptions) override; + void get_unsat_core(ptr_vector & r) override; + void get_model(model_ref & _m) override; + proof * get_proof() override; + std::string reason_unknown() const override; + void set_reason_unknown(char const* msg) override; + void get_labels(svector & r) override; + void set_progress_callback(progress_callback * callback) override; + unsigned get_num_assertions() const override; + expr * get_assertion(unsigned idx) const override; + ast_manager& get_manager() const override { return m; } + lbool find_mutexes(expr_ref_vector const& vars, vector& mutexes) override; + lbool preferred_sat(expr_ref_vector const& asms, vector& cores) override; void set_logic(symbol const& logic); smt::theory_var add_objective(app* term); diff --git a/src/parsers/util/cost_parser.h b/src/parsers/util/cost_parser.h index f0330d824..d2a96dc25 100644 --- a/src/parsers/util/cost_parser.h +++ b/src/parsers/util/cost_parser.h @@ -27,9 +27,9 @@ class cost_parser : public simple_parser { var_ref_vector m_vars; public: cost_parser(ast_manager & m); - virtual ~cost_parser() {} - virtual expr * parse_int(rational const & r); - virtual expr * parse_float(rational const & r); + ~cost_parser() override {} + expr * parse_int(rational const & r) override; + expr * parse_float(rational const & r) override; unsigned add_var(symbol name); unsigned add_var(char const * name) { return add_var(symbol(name)); } void reset_vars(); diff --git a/src/qe/nlarith_util.cpp b/src/qe/nlarith_util.cpp index 4f07b59dd..7d86860b3 100644 --- a/src/qe/nlarith_util.cpp +++ b/src/qe/nlarith_util.cpp @@ -1018,13 +1018,13 @@ namespace nlarith { app* m_x; public: basic_subst(imp& i, app* x) : isubst(i), m_x(x) {} - virtual void mk_lt(poly const& p, app_ref& r) { + void mk_lt(poly const& p, app_ref& r) override { imp& I = m_imp; app_ref result(I.m()); I.mk_polynomial(m_x, p, result); r = I.mk_lt(result); } - virtual void mk_eq(poly const& p, app_ref& r) { + void mk_eq(poly const& p, app_ref& r) override { imp& I = m_imp; app_ref result(I.m()); I.mk_polynomial(m_x, p, result); @@ -1039,7 +1039,7 @@ namespace nlarith { // p[e/x] < 0: (a*parity(d) < 0 /\ 0 < a*a - b*b*c) \/ // (b*parity(d) <= 0 /\ (a*parity(d) < 0 \/ a*a - b*b*c < 0)) - virtual void mk_lt(poly const& p, app_ref& r) { + void mk_lt(poly const& p, app_ref& r) override { imp& I = m_imp; ast_manager& m = I.m(); app_ref a(m), b(m), c(m_s.m_c), d(m); @@ -1061,7 +1061,7 @@ namespace nlarith { // p[e/x] = 0: a*b <= 0 & a*a - b*b*c = 0 - virtual void mk_eq(poly const& p, app_ref& r) { + void mk_eq(poly const& p, app_ref& r) override { imp& I = m_imp; ast_manager& m = I.m(); app_ref a(m), b(m), c(m_s.m_c),d(m), aabbc(m); @@ -1076,7 +1076,7 @@ namespace nlarith { } // p[e/x] <= 0: a*parity(d) <= 0 /\ 0 <= a*a - b*b*c \/ b*parity(d) <= 0 /\ a*a - b*b*c <= 0 - virtual void mk_le(poly const& p, app_ref& r) { + void mk_le(poly const& p, app_ref& r) override { imp& I = m_imp; ast_manager& m = I.m(); app_ref a(m), b(m), c(m_s.m_c), d(m); @@ -1125,10 +1125,10 @@ namespace nlarith { public: plus_eps_subst(imp& i, isubst& s) : isubst(i), m_s(s) {} - virtual void mk_lt(poly const& p, app_ref& r) { mk_nu(p, r); } + void mk_lt(poly const& p, app_ref& r) override { mk_nu(p, r); } // /\ p[i] = 0 - virtual void mk_eq(poly const& p, app_ref& r) { r = m_imp.mk_zero(p); } + void mk_eq(poly const& p, app_ref& r) override { r = m_imp.mk_zero(p); } }; class minus_eps_subst : public isubst { @@ -1172,10 +1172,10 @@ namespace nlarith { public: minus_eps_subst(imp& i, isubst& s) : isubst(i), m_s(s) {} - virtual void mk_lt(poly const& p, app_ref& r) { mk_nu(p, true, r); } + void mk_lt(poly const& p, app_ref& r) override { mk_nu(p, true, r); } // /\ p[i] = 0 - virtual void mk_eq(poly const& p, app_ref& r) { r = m_imp.mk_zero(p); } + void mk_eq(poly const& p, app_ref& r) override { r = m_imp.mk_zero(p); } }; class minus_inf_subst : public isubst { @@ -1208,12 +1208,12 @@ namespace nlarith { public: minus_inf_subst(imp& i) : isubst(i) {} - virtual void mk_lt(poly const& p, app_ref& r) { + void mk_lt(poly const& p, app_ref& r) override { r = mk_lt(p, p.size()); } // /\ p[i] = 0 - virtual void mk_eq(poly const& p, app_ref& r) { r = m_imp.mk_zero(p); } + void mk_eq(poly const& p, app_ref& r) override { r = m_imp.mk_zero(p); } }; @@ -1238,10 +1238,10 @@ namespace nlarith { public: plus_inf_subst(imp& i) : isubst(i) {} - virtual void mk_lt(poly const& p, app_ref& r) { r = mk_lt(p, p.size()); } + void mk_lt(poly const& p, app_ref& r) override { r = mk_lt(p, p.size()); } // /\ p[i] = 0 - virtual void mk_eq(poly const& p, app_ref& r) { r = m_imp.mk_zero(p); } + void mk_eq(poly const& p, app_ref& r) override { r = m_imp.mk_zero(p); } }; /** @@ -1615,9 +1615,9 @@ namespace nlarith { public: simple_branch(ast_manager& m, app* cnstr): m_cnstr(cnstr, m), m_atoms(m) {} - virtual ~simple_branch() {} - virtual app* get_constraint() { return m_cnstr.get(); } - virtual void get_updates(ptr_vector& atoms, svector& updates) { + ~simple_branch() override {} + app* get_constraint() override { return m_cnstr.get(); } + void get_updates(ptr_vector& atoms, svector& updates) override { for (unsigned i = 0; i < m_atoms.size(); ++i) { atoms.push_back(m_atoms[i].get()); updates.push_back(m_updates[i]); @@ -1635,7 +1635,7 @@ namespace nlarith { public: ins_rem_branch(ast_manager& m, app* a, app* r, app* cnstr): simple_branch(m, cnstr) { insert(a); remove(r); } - virtual ~ins_rem_branch() {} + ~ins_rem_branch() override {} }; /** diff --git a/src/qe/nlqsat.cpp b/src/qe/nlqsat.cpp index e28f6ae4f..0898afeda 100644 --- a/src/qe/nlqsat.cpp +++ b/src/qe/nlqsat.cpp @@ -555,7 +555,7 @@ namespace qe { } - void reset() { + void reset() override { //m_solver.reset(); m_asms.reset(); m_cached_asms.reset(); @@ -798,16 +798,16 @@ namespace qe { m_nftactic = mk_tseitin_cnf_tactic(m); } - virtual ~nlqsat() { + ~nlqsat() override { } - void updt_params(params_ref const & p) { + void updt_params(params_ref const & p) override { params_ref p2(p); p2.set_bool("factor", false); m_solver.updt_params(p2); } - void collect_param_descrs(param_descrs & r) { + void collect_param_descrs(param_descrs & r) override { } @@ -815,7 +815,7 @@ namespace qe { /* out */ goal_ref_buffer & result, /* out */ model_converter_ref & mc, /* out */ proof_converter_ref & pc, - /* out */ expr_dependency_ref & core) { + /* out */ expr_dependency_ref & core) override { tactic_report report("nlqsat-tactic", *in); @@ -863,27 +863,27 @@ namespace qe { } - void collect_statistics(statistics & st) const { + void collect_statistics(statistics & st) const override { st.copy(m_st); st.update("qsat num rounds", m_stats.m_num_rounds); } - void reset_statistics() { + void reset_statistics() override { m_stats.reset(); m_solver.reset_statistics(); } - void cleanup() { + void cleanup() override { reset(); } - void set_logic(symbol const & l) { + void set_logic(symbol const & l) override { } - void set_progress_callback(progress_callback * callback) { + void set_progress_callback(progress_callback * callback) override { } - tactic * translate(ast_manager & m) { + tactic * translate(ast_manager & m) override { return alloc(nlqsat, m, m_mode, m_params); } }; diff --git a/src/qe/qe.cpp b/src/qe/qe.cpp index 57a8c365b..08a0c44c0 100644 --- a/src/qe/qe.cpp +++ b/src/qe/qe.cpp @@ -1383,7 +1383,7 @@ namespace qe { m_rewriter.updt_params(params); } - virtual ~quant_elim_plugin() { + ~quant_elim_plugin() override { reset(); } @@ -2035,7 +2035,7 @@ namespace qe { { } - virtual ~quant_elim_new() { + ~quant_elim_new() override { reset(); } @@ -2052,17 +2052,17 @@ namespace qe { } - void collect_statistics(statistics & st) const { + void collect_statistics(statistics & st) const override { for (unsigned i = 0; i < m_plugins.size(); ++i) { m_plugins[i]->collect_statistics(st); } } - void updt_params(params_ref const& p) { + void updt_params(params_ref const& p) override { m_eliminate_variables_as_block = p.get_bool("eliminate_variables_as_block", m_eliminate_variables_as_block); } - void eliminate(bool is_forall, unsigned num_vars, app* const* vars, expr_ref& fml) { + void eliminate(bool is_forall, unsigned num_vars, app* const* vars, expr_ref& fml) override { if (is_forall) { eliminate_forall_bind(num_vars, vars, fml); } @@ -2092,14 +2092,14 @@ namespace qe { } } - virtual void set_assumption(expr* fml) { + void set_assumption(expr* fml) override { m_assumption = fml; } - virtual lbool eliminate_exists( + lbool eliminate_exists( unsigned num_vars, app* const* vars, expr_ref& fml, - app_ref_vector& free_vars, bool get_first, guarded_defs* defs) { + app_ref_vector& free_vars, bool get_first, guarded_defs* defs) override { if (get_first) { return eliminate_block(num_vars, vars, fml, free_vars, get_first, defs); } @@ -2483,7 +2483,7 @@ namespace qe { m_fparams.updt_params(p); } - virtual ~simplify_solver_context() { reset(); } + ~simplify_solver_context() override { reset(); } void solve(expr_ref& fml, app_ref_vector& vars) { @@ -2502,16 +2502,16 @@ namespace qe { while (solved); } - virtual ast_manager& get_manager() { return m; } + ast_manager& get_manager() override { return m; } - virtual atom_set const& pos_atoms() const { return m_pos; } - virtual atom_set const& neg_atoms() const { return m_neg; } + atom_set const& pos_atoms() const override { return m_pos; } + atom_set const& neg_atoms() const override { return m_neg; } // Access current set of variables to solve - virtual unsigned get_num_vars() const { return m_vars->size(); } - virtual app* get_var(unsigned idx) const { return (*m_vars)[idx].get(); } - virtual app_ref_vector const& get_vars() const { return *m_vars; } - virtual bool is_var(expr* e, unsigned& idx) const { + unsigned get_num_vars() const override { return m_vars->size(); } + app* get_var(unsigned idx) const override { return (*m_vars)[idx].get(); } + app_ref_vector const& get_vars() const override { return *m_vars; } + bool is_var(expr* e, unsigned& idx) const override { for (unsigned i = 0; i < m_vars->size(); ++i) { if ((*m_vars)[i].get() == e) { idx = i; @@ -2521,12 +2521,12 @@ namespace qe { return false; } - virtual contains_app& contains(unsigned idx) { + contains_app& contains(unsigned idx) override { return *m_contains[idx]; } // callback to replace variable at index 'idx' with definition 'def' and updated formula 'fml' - virtual void elim_var(unsigned idx, expr* fml, expr* def) { + void elim_var(unsigned idx, expr* fml, expr* def) override { TRACE("qe", tout << mk_pp(m_vars->get(idx), m) << " " << mk_pp(fml, m) << "\n";); *m_fml = fml; m_vars->set(idx, m_vars->get(m_vars->size()-1)); @@ -2537,17 +2537,17 @@ namespace qe { } // callback to add new variable to branch. - virtual void add_var(app* x) { + void add_var(app* x) override { TRACE("qe", tout << "add var: " << mk_pp(x, m) << "\n";); m_vars->push_back(x); } // callback to add constraints in branch. - virtual void add_constraint(bool use_var, expr* l1 = 0, expr* l2 = 0, expr* l3 = 0) { + void add_constraint(bool use_var, expr* l1 = 0, expr* l2 = 0, expr* l3 = 0) override { UNREACHABLE(); } // eliminate finite domain variable 'var' from fml. - virtual void blast_or(app* var, expr_ref& fml) { + void blast_or(app* var, expr_ref& fml) override { UNREACHABLE(); } diff --git a/src/qe/qe.h b/src/qe/qe.h index 6946f9566..bdce4d159 100644 --- a/src/qe/qe.h +++ b/src/qe/qe.h @@ -49,13 +49,13 @@ namespace qe { i_solver_context& m_s; public: is_relevant(i_solver_context& s):m_s(s) {} - virtual bool operator()(expr* e); + bool operator()(expr* e) override; }; class mk_atom_fn : public i_nnf_atom { i_solver_context& m_s; public: mk_atom_fn(i_solver_context& s) : m_s(s) {} - void operator()(expr* e, bool p, expr_ref& result); + void operator()(expr* e, bool p, expr_ref& result) override; }; is_relevant m_is_relevant; diff --git a/src/qe/qe_arith.h b/src/qe/qe_arith.h index 88675d5a4..8e2400ac7 100644 --- a/src/qe/qe_arith.h +++ b/src/qe/qe_arith.h @@ -25,11 +25,11 @@ namespace qe { imp* m_imp; public: arith_project_plugin(ast_manager& m); - virtual ~arith_project_plugin(); - virtual bool operator()(model& model, app* var, app_ref_vector& vars, expr_ref_vector& lits); - virtual bool solve(model& model, app_ref_vector& vars, expr_ref_vector& lits); - virtual family_id get_family_id(); - virtual void operator()(model& model, app_ref_vector& vars, expr_ref_vector& lits); + ~arith_project_plugin() override; + bool operator()(model& model, app* var, app_ref_vector& vars, expr_ref_vector& lits) override; + bool solve(model& model, app_ref_vector& vars, expr_ref_vector& lits) override; + family_id get_family_id() override; + void operator()(model& model, app_ref_vector& vars, expr_ref_vector& lits) override; opt::inf_eps maximize(expr_ref_vector const& fmls, model& mdl, app* t, expr_ref& ge, expr_ref& gt); diff --git a/src/qe/qe_arith_plugin.cpp b/src/qe/qe_arith_plugin.cpp index 89dee9586..9e056cdc2 100644 --- a/src/qe/qe_arith_plugin.cpp +++ b/src/qe/qe_arith_plugin.cpp @@ -1536,14 +1536,14 @@ public: m_trail(m) {} - ~arith_plugin() { + ~arith_plugin() override { bounds_cache::iterator it = m_bounds_cache.begin(), end = m_bounds_cache.end(); for (; it != end; ++it) { dealloc(it->get_value()); } } - virtual void assign(contains_app& contains_x, expr* fml, rational const& vl) { + void assign(contains_app& contains_x, expr* fml, rational const& vl) override { SASSERT(vl.is_unsigned()); app* x = contains_x.x(); unsigned v = vl.get_unsigned(); @@ -1633,7 +1633,7 @@ public: } - virtual bool get_num_branches(contains_app& contains_x, expr* fml, rational& nb) { + bool get_num_branches(contains_app& contains_x, expr* fml, rational& nb) override { app* x = contains_x.x(); if (!update_bounds(contains_x, fml)) { return false; @@ -1645,7 +1645,7 @@ public: return true; } - virtual void subst(contains_app& contains_x, rational const& vl, expr_ref& fml, expr_ref* def) { + void subst(contains_app& contains_x, rational const& vl, expr_ref& fml, expr_ref* def) override { SASSERT(vl.is_unsigned()); if (def) { get_def(contains_x, vl.get_unsigned(), fml, *def); @@ -1654,7 +1654,7 @@ public: TRACE("qe", tout << mk_pp(contains_x.x(), m) << " " << vl << "\n" << mk_pp(fml, m) << "\n";); } - virtual bool project(contains_app& x, model_ref& model, expr_ref& fml) { + bool project(contains_app& x, model_ref& model, expr_ref& fml) override { if (!update_bounds(x, fml)) { TRACE("qe", tout << mk_pp(x.x(), m) << " failed to update bounds\n";); return false; @@ -1668,19 +1668,19 @@ public: } - virtual unsigned get_weight(contains_app& contains_x, expr* fml) { + unsigned get_weight(contains_app& contains_x, expr* fml) override { return 2; } - virtual bool solve(conj_enum& conjs, expr* fml) { + bool solve(conj_enum& conjs, expr* fml) override { return m_util.solve(conjs, fml); } - virtual bool mk_atom(expr* e, bool p, expr_ref& result) { + bool mk_atom(expr* e, bool p, expr_ref& result) override { return m_util.mk_atom(e, p, result); } - virtual bool is_uninterpreted(app* f) { + bool is_uninterpreted(app* f) override { switch(f->get_decl_kind()) { case OP_NUM: case OP_LE: @@ -2456,7 +2456,7 @@ public: m_util.set_enable_linear(true); // (produce_models); } - virtual ~nlarith_plugin() { + ~nlarith_plugin() override { bcs_t::iterator it = m_cache.begin(), end = m_cache.end(); for (; it != end; ++it) { dealloc(it->get_value()); @@ -2467,7 +2467,7 @@ public: } } - virtual bool simplify(expr_ref& fml) { + bool simplify(expr_ref& fml) override { expr_ref tmp(m), tmp2(m); m_factor_rw(fml, tmp); m_rewriter(tmp, tmp2); @@ -2478,7 +2478,7 @@ public: return false; } - virtual void assign(contains_app& x, expr* fml, rational const& vl) { + void assign(contains_app& x, expr* fml, rational const& vl) override { nlarith::branch_conditions *brs = 0; VERIFY (m_cache.find(x.x(), fml, brs)); SASSERT(vl.is_unsigned()); @@ -2491,8 +2491,8 @@ public: m_ctx.add_constraint(true, result); } - virtual bool get_num_branches(contains_app& x, - expr* fml, rational& num_branches) { + bool get_num_branches(contains_app& x, + expr* fml, rational& num_branches) override { nlarith::branch_conditions *brs; if (m_cache.find(x.x(), fml, brs)) { num_branches = rational(brs->size()); @@ -2515,7 +2515,7 @@ public: return true; } - virtual void subst(contains_app& x, rational const& vl, expr_ref& fml, expr_ref* def) { + void subst(contains_app& x, rational const& vl, expr_ref& fml, expr_ref* def) override { nlarith::branch_conditions *brs = 0; VERIFY (m_cache.find(x.x(), fml, brs)); SASSERT(vl.is_unsigned()); @@ -2534,7 +2534,7 @@ public: } - virtual unsigned get_weight(contains_app& x, expr* fml) { + unsigned get_weight(contains_app& x, expr* fml) override { obj_map* weights = 0; unsigned weight = 0; if (!m_weights.find(fml, weights)) { @@ -2553,12 +2553,12 @@ public: return UINT_MAX; } - virtual bool solve(conj_enum& conjs, expr* fml) { return false; } + bool solve(conj_enum& conjs, expr* fml) override { return false; } // we don't need to modify the atom. - virtual bool mk_atom(expr* e, bool p, expr_ref& result) { return false; } + bool mk_atom(expr* e, bool p, expr_ref& result) override { return false; } - virtual bool is_uninterpreted(app* f) { + bool is_uninterpreted(app* f) override { if (m_produce_models) { return true; } diff --git a/src/qe/qe_array_plugin.cpp b/src/qe/qe_array_plugin.cpp index 9eeccd6a4..775dd0443 100644 --- a/src/qe/qe_array_plugin.cpp +++ b/src/qe/qe_array_plugin.cpp @@ -27,23 +27,23 @@ namespace qe { { } - virtual ~array_plugin() {} + ~array_plugin() override {} - virtual void assign(contains_app& x, expr* fml, rational const& vl) { + void assign(contains_app& x, expr* fml, rational const& vl) override { UNREACHABLE(); } - virtual bool get_num_branches( contains_app& x, expr* fml, rational& num_branches) { + bool get_num_branches( contains_app& x, expr* fml, rational& num_branches) override { return false; } - virtual void subst(contains_app& x, rational const& vl, expr_ref& fml, expr_ref* def) { + void subst(contains_app& x, rational const& vl, expr_ref& fml, expr_ref* def) override { UNREACHABLE(); } - virtual bool solve(conj_enum& conjs, expr* fml) { + bool solve(conj_enum& conjs, expr* fml) override { conj_enum::iterator it = conjs.begin(), end = conjs.end(); for (; it != end; ++it) { @@ -65,7 +65,7 @@ namespace qe { return false; } - virtual bool is_uninterpreted(app* f) { + bool is_uninterpreted(app* f) override { return true; } diff --git a/src/qe/qe_arrays.h b/src/qe/qe_arrays.h index e100ebce4..a955250a8 100644 --- a/src/qe/qe_arrays.h +++ b/src/qe/qe_arrays.h @@ -31,10 +31,10 @@ namespace qe { imp* m_imp; public: array_project_plugin(ast_manager& m); - virtual ~array_project_plugin(); - virtual bool operator()(model& model, app* var, app_ref_vector& vars, expr_ref_vector& lits); - virtual bool solve(model& model, app_ref_vector& vars, expr_ref_vector& lits); - virtual family_id get_family_id(); + ~array_project_plugin() override; + bool operator()(model& model, app* var, app_ref_vector& vars, expr_ref_vector& lits) override; + bool solve(model& model, app_ref_vector& vars, expr_ref_vector& lits) override; + family_id get_family_id() override; }; }; diff --git a/src/qe/qe_bool_plugin.cpp b/src/qe/qe_bool_plugin.cpp index 82e09bbed..eb0553a0e 100644 --- a/src/qe/qe_bool_plugin.cpp +++ b/src/qe/qe_bool_plugin.cpp @@ -39,16 +39,16 @@ namespace qe { m_replace(m) {} - virtual void assign(contains_app& x, expr* fml, rational const& vl) { + void assign(contains_app& x, expr* fml, rational const& vl) override { SASSERT(vl.is_zero() || vl.is_one()); } - virtual bool get_num_branches(contains_app& x, expr* fml, rational& nb) { + bool get_num_branches(contains_app& x, expr* fml, rational& nb) override { nb = rational(2); return true; } - virtual void subst(contains_app& x, rational const& vl, expr_ref& fml, expr_ref* def) { + void subst(contains_app& x, rational const& vl, expr_ref& fml, expr_ref* def) override { SASSERT(vl.is_one() || vl.is_zero()); expr* tf = (vl.is_one())?m.mk_true():m.mk_false(); m_replace.apply_substitution(x.x(), tf, fml); @@ -57,7 +57,7 @@ namespace qe { } } - virtual bool project(contains_app& x, model_ref& model, expr_ref& fml) { + bool project(contains_app& x, model_ref& model, expr_ref& fml) override { model_evaluator model_eval(*model); expr_ref val_x(m); rational val; @@ -69,7 +69,7 @@ namespace qe { return true; } - virtual unsigned get_weight(contains_app& contains_x, expr* fml) { + unsigned get_weight(contains_app& contains_x, expr* fml) override { app* x = contains_x.x(); bool p = m_ctx.pos_atoms().contains(x); bool n = m_ctx.neg_atoms().contains(x); @@ -79,13 +79,13 @@ namespace qe { return 0; } - virtual bool solve(conj_enum& conjs,expr* fml) { + bool solve(conj_enum& conjs,expr* fml) override { return solve_units(conjs, fml) || solve_polarized(fml); } - virtual bool is_uninterpreted(app* a) { + bool is_uninterpreted(app* a) override { return false; } diff --git a/src/qe/qe_bv_plugin.cpp b/src/qe/qe_bv_plugin.cpp index 6678d6fcf..ef87f235f 100644 --- a/src/qe/qe_bv_plugin.cpp +++ b/src/qe/qe_bv_plugin.cpp @@ -37,16 +37,16 @@ namespace qe { m_bv(m) {} - virtual void assign(contains_app& x, expr* fml, rational const& vl) { + void assign(contains_app& x, expr* fml, rational const& vl) override { } - virtual bool get_num_branches(contains_app& x, expr* fml, rational& nb) { + bool get_num_branches(contains_app& x, expr* fml, rational& nb) override { unsigned sz = m_bv.get_bv_size(x.x()); nb = power(rational(2), sz); return true; } - virtual void subst(contains_app& x, rational const& vl, expr_ref& fml, expr_ref* def) { + void subst(contains_app& x, rational const& vl, expr_ref& fml, expr_ref* def) override { app_ref c(m_bv.mk_numeral(vl, m_bv.get_bv_size(x.x())), m); m_replace.apply_substitution(x.x(), c, fml); if (def) { @@ -54,7 +54,7 @@ namespace qe { } } - virtual bool project(contains_app& x, model_ref& model, expr_ref& fml) { + bool project(contains_app& x, model_ref& model, expr_ref& fml) override { model_evaluator model_eval(*model); expr_ref val_x(m); rational val(0); @@ -65,13 +65,13 @@ namespace qe { return true; } - virtual unsigned get_weight(contains_app& contains_x, expr* fml) { + unsigned get_weight(contains_app& contains_x, expr* fml) override { return 2; } - bool solve(conj_enum& conjs, expr* fml) { return false; } + bool solve(conj_enum& conjs, expr* fml) override { return false; } - virtual bool is_uninterpreted(app* f) { + bool is_uninterpreted(app* f) override { switch(f->get_decl_kind()) { case OP_BSDIV0: case OP_BUDIV0: diff --git a/src/qe/qe_cmd.cpp b/src/qe/qe_cmd.cpp index 3c55c0f49..eb119ce0b 100644 --- a/src/qe/qe_cmd.cpp +++ b/src/qe/qe_cmd.cpp @@ -14,36 +14,36 @@ class qe_cmd : public parametric_cmd { public: qe_cmd(char const* name = "elim-quantifiers"):parametric_cmd(name) {} - virtual char const * get_usage() const { return " ( )*"; } + char const * get_usage() const override { return " ( )*"; } - virtual char const * get_main_descr() const { + char const * get_main_descr() const override { return "apply quantifier elimination to the supplied expression"; } - virtual void init_pdescrs(cmd_context & ctx, param_descrs & p) { + void init_pdescrs(cmd_context & ctx, param_descrs & p) override { insert_timeout(p); p.insert("print", CPK_BOOL, "(default: true) print the simplified term."); p.insert("print_statistics", CPK_BOOL, "(default: false) print statistics."); } - virtual ~qe_cmd() { + ~qe_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 { proof_ref pr(ctx.m()); qe::simplify_rewriter_star qe(ctx.m()); expr_ref result(ctx.m()); diff --git a/src/qe/qe_datatype_plugin.cpp b/src/qe/qe_datatype_plugin.cpp index c3525aa33..0bfe82751 100644 --- a/src/qe/qe_datatype_plugin.cpp +++ b/src/qe/qe_datatype_plugin.cpp @@ -435,7 +435,7 @@ namespace qe { { } - virtual ~datatype_plugin() { + ~datatype_plugin() override { { eqs_cache::iterator it = m_eqs_cache.begin(), end = m_eqs_cache.end(); for (; it != end; ++it) { @@ -451,7 +451,7 @@ namespace qe { } - virtual bool get_num_branches( contains_app& x, expr* fml, rational& num_branches) { + bool get_num_branches( contains_app& x, expr* fml, rational& num_branches) override { sort* s = x.x()->get_decl()->get_range(); SASSERT(m_datatype_util.is_datatype(s)); if (m_datatype_util.is_recursive(s)) { @@ -463,7 +463,7 @@ namespace qe { } - virtual void assign(contains_app& x, expr* fml, rational const& vl) { + void assign(contains_app& x, expr* fml, rational const& vl) override { sort* s = x.x()->get_decl()->get_range(); SASSERT(m_datatype_util.is_datatype(s)); TRACE("qe", tout << mk_pp(x.x(), m) << " " << vl << "\n";); @@ -475,7 +475,7 @@ namespace qe { } } - virtual void subst(contains_app& x, rational const& vl, expr_ref& fml, expr_ref* def) { + void subst(contains_app& x, rational const& vl, expr_ref& fml, expr_ref* def) override { sort* s = x.x()->get_decl()->get_range(); SASSERT(m_datatype_util.is_datatype(s)); TRACE("qe", tout << mk_pp(x.x(), m) << " " << vl << "\n";); @@ -487,20 +487,20 @@ namespace qe { } } - virtual unsigned get_weight( contains_app& x, expr* fml) { + unsigned get_weight( contains_app& x, expr* fml) override { return UINT_MAX; } - virtual bool solve( conj_enum& conj, expr* fml) { + bool solve( conj_enum& conj, expr* fml) override { return false; } - virtual bool simplify( expr_ref& fml) { + bool simplify( expr_ref& fml) override { lift_foreign_vars lift(m, m_datatype_util, m_ctx); return lift.lift(fml); } - virtual bool mk_atom(expr* e, bool p, expr_ref& result) { + bool mk_atom(expr* e, bool p, expr_ref& result) override { return false; } @@ -807,7 +807,7 @@ namespace qe { public: has_select(app* x, func_decl* c, datatype_util& u): m_x(x), m_c(c), m_util(u) {} - virtual bool operator()(expr* e) { + bool operator()(expr* e) override { if (!is_app(e)) return false; app* a = to_app(e); if (!m_util.is_accessor(a)) return false; diff --git a/src/qe/qe_datatypes.h b/src/qe/qe_datatypes.h index 7352b4ca7..9c8eb5a76 100644 --- a/src/qe/qe_datatypes.h +++ b/src/qe/qe_datatypes.h @@ -31,10 +31,10 @@ namespace qe { imp* m_imp; public: datatype_project_plugin(ast_manager& m); - virtual ~datatype_project_plugin(); - virtual bool operator()(model& model, app* var, app_ref_vector& vars, expr_ref_vector& lits); - virtual bool solve(model& model, app_ref_vector& vars, expr_ref_vector& lits); - virtual family_id get_family_id(); + ~datatype_project_plugin() override; + bool operator()(model& model, app* var, app_ref_vector& vars, expr_ref_vector& lits) override; + bool solve(model& model, app_ref_vector& vars, expr_ref_vector& lits) override; + family_id get_family_id() override; }; }; diff --git a/src/qe/qe_dl_plugin.cpp b/src/qe/qe_dl_plugin.cpp index 7ff7bc11e..714540e41 100644 --- a/src/qe/qe_dl_plugin.cpp +++ b/src/qe/qe_dl_plugin.cpp @@ -56,7 +56,7 @@ namespace qe { { } - virtual ~dl_plugin() { + ~dl_plugin() override { eqs_cache::iterator it = m_eqs_cache.begin(), end = m_eqs_cache.end(); for (; it != end; ++it) { dealloc(it->get_value()); @@ -65,7 +65,7 @@ namespace qe { - bool get_num_branches(contains_app & x,expr * fml,rational & num_branches) { + bool get_num_branches(contains_app & x,expr * fml,rational & num_branches) override { if (!update_eqs(x, fml)) { return false; } @@ -80,7 +80,7 @@ namespace qe { return true; } - void assign(contains_app & x,expr * fml,const rational & v) { + void assign(contains_app & x,expr * fml,const rational & v) override { SASSERT(v.is_unsigned()); eq_atoms& eqs = get_eqs(x.x(), fml); unsigned uv = v.get_unsigned(); @@ -94,7 +94,7 @@ namespace qe { } } - void subst(contains_app & x,const rational & v,expr_ref & fml, expr_ref* def) { + void subst(contains_app & x,const rational & v,expr_ref & fml, expr_ref* def) override { SASSERT(v.is_unsigned()); eq_atoms& eqs = get_eqs(x.x(), fml); unsigned uv = v.get_unsigned(); @@ -111,7 +111,7 @@ namespace qe { } } - virtual bool solve(conj_enum& conjs, expr* fml) { return false; } + bool solve(conj_enum& conjs, expr* fml) override { return false; } private: diff --git a/src/qe/qe_lite.cpp b/src/qe/qe_lite.cpp index 1220bd571..678c5e29b 100644 --- a/src/qe/qe_lite.cpp +++ b/src/qe/qe_lite.cpp @@ -2607,43 +2607,43 @@ public: m_imp = alloc(imp, m, p); } - virtual ~qe_lite_tactic() { + ~qe_lite_tactic() override { dealloc(m_imp); } - virtual tactic * translate(ast_manager & m) { + tactic * translate(ast_manager & m) override { return alloc(qe_lite_tactic, m, m_params); } - 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, + void operator()(goal_ref const & in, goal_ref_buffer & result, model_converter_ref & mc, proof_converter_ref & pc, - expr_dependency_ref & core) { + 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); } - virtual void reset_statistics() { + void reset_statistics() override { // m_imp->reset_statistics(); } - virtual void cleanup() { + void cleanup() override { ast_manager & m = m_imp->m; dealloc(m_imp); m_imp = alloc(imp, m, m_params); diff --git a/src/qe/qe_sat_tactic.cpp b/src/qe/qe_sat_tactic.cpp index 250ffff4a..547f6bad1 100644 --- a/src/qe/qe_sat_tactic.cpp +++ b/src/qe/qe_sat_tactic.cpp @@ -39,14 +39,14 @@ namespace qe { class is_relevant_default : public i_expr_pred { public: - bool operator()(expr* e) { + bool operator()(expr* e) override { return true; } }; class mk_atom_default : public i_nnf_atom { public: - virtual void operator()(expr* e, bool pol, expr_ref& result) { + void operator()(expr* e, bool pol, expr_ref& result) override { if (pol) result = e; else result = result.get_manager().mk_not(e); } @@ -97,7 +97,7 @@ namespace qe { m_fml(m), m_projection_mode_param(true) {} - virtual ~solver_context() { + ~solver_context() override { std::for_each(m_contains_app.begin(), m_contains_app.end(), delete_proc()); } @@ -111,28 +111,28 @@ namespace qe { void set_projection_mode(bool p) { m_projection_mode_param = p; } - ast_manager& get_manager() { return m; } + ast_manager& get_manager() override { return m; } expr* fml() { return m_fml; } // set of atoms in current formula. - virtual atom_set const& pos_atoms() const { return m_pos; } - virtual atom_set const& neg_atoms() const { return m_neg; } + atom_set const& pos_atoms() const override { return m_pos; } + atom_set const& neg_atoms() const override { return m_neg; } // Access current set of variables to solve - virtual unsigned get_num_vars() const { return m_vars.size(); } - virtual app* get_var(unsigned idx) const { return m_vars[idx]; } - virtual app_ref_vector const& get_vars() const { return m_vars; } - virtual bool is_var(expr* e, unsigned& idx) const { + unsigned get_num_vars() const override { return m_vars.size(); } + app* get_var(unsigned idx) const override { return m_vars[idx]; } + app_ref_vector const& get_vars() const override { return m_vars; } + bool is_var(expr* e, unsigned& idx) const override { for (unsigned i = 0; i < m_vars.size(); ++i) { if (e == m_vars[i]) return (idx = i, true); } return false; } - virtual contains_app& contains(unsigned idx) { return *m_contains_app[idx]; } + contains_app& contains(unsigned idx) override { return *m_contains_app[idx]; } // callback to replace variable at index 'idx' with definition 'def' and updated formula 'fml' - virtual void elim_var(unsigned idx, expr* fml, expr* def) { + void elim_var(unsigned idx, expr* fml, expr* def) override { m_fml = fml; m_pos.reset(); m_neg.reset(); @@ -143,13 +143,13 @@ namespace qe { } // callback to add new variable to branch. - virtual void add_var(app* x) { + void add_var(app* x) override { m_vars.push_back(x); m_contains_app.push_back(alloc(contains_app, m, x)); } // callback to add constraints in branch. - virtual void add_constraint(bool use_var, expr* l1 = 0, expr* l2 = 0, expr* l3 = 0) { + void add_constraint(bool use_var, expr* l1 = 0, expr* l2 = 0, expr* l3 = 0) override { ptr_buffer args; if (l1) args.push_back(l1); if (l2) args.push_back(l2); @@ -160,7 +160,7 @@ namespace qe { } // eliminate finite domain variable 'var' from fml. - virtual void blast_or(app* var, expr_ref& fml) { + void blast_or(app* var, expr_ref& fml) override { expr_ref result(m); expr_quant_elim qelim(m, m_super.m_fparams); qe::mk_exists(1, &var, fml); @@ -223,20 +223,19 @@ namespace qe { m_fparams.m_model = true; } - virtual tactic * translate(ast_manager & m) { + tactic * translate(ast_manager & m) override { return alloc(sat_tactic, m); } - virtual ~sat_tactic() { + ~sat_tactic() override { reset(); } - virtual void operator()( - goal_ref const& goal, - goal_ref_buffer& result, - model_converter_ref& mc, - proof_converter_ref & pc, - expr_dependency_ref& core) + void operator()(goal_ref const& goal, + goal_ref_buffer& result, + model_converter_ref& mc, + proof_converter_ref & pc, + expr_dependency_ref& core) override { try { checkpoint(); @@ -269,7 +268,7 @@ namespace qe { } } - virtual void collect_statistics(statistics & st) const { + void collect_statistics(statistics & st) const override { for (unsigned i = 0; i < m_solvers.size(); ++i) { m_solvers[i]->collect_statistics(st); } @@ -277,7 +276,7 @@ namespace qe { m_ctx_rewriter.collect_statistics(st); } - virtual void reset_statistics() { + void reset_statistics() override { for (unsigned i = 0; i < m_solvers.size(); ++i) { m_solvers[i]->reset_statistics(); } @@ -285,9 +284,9 @@ namespace qe { m_ctx_rewriter.reset_statistics(); } - virtual void cleanup() {} + void cleanup() override {} - virtual void updt_params(params_ref const & p) { + void updt_params(params_ref const & p) override { m_extrapolate_strategy_param = p.get_uint("extrapolate_strategy", m_extrapolate_strategy_param); m_projection_mode_param = p.get_bool("projection_mode", m_projection_mode_param); m_strong_context_simplify_param = p.get_bool("strong_context_simplify", m_strong_context_simplify_param); @@ -296,7 +295,7 @@ namespace qe { m_qe_rw.updt_params(p); } - virtual void collect_param_descrs(param_descrs & r) { + void collect_param_descrs(param_descrs & r) override { r.insert("extrapolate_strategy",CPK_UINT, "(default: 0 trivial extrapolation) 1 - nnf strengthening 2 - smt-test 3 - nnf_weakening"); r.insert("projection_mode", CPK_BOOL, "(default: true - full) false - partial quantifier instantiation"); r.insert("strong_context_simplify", CPK_BOOL, "(default: true) use strong context simplifier on result of quantifier elimination"); @@ -326,7 +325,7 @@ namespace qe { smt::kernel& solver(unsigned i) { return *m_solvers[i]; } - void reset() { + void reset() override { for (unsigned i = 0; i < m_solvers.size(); ++i) { dealloc(m_solvers[i]); } diff --git a/src/qe/qe_tactic.cpp b/src/qe/qe_tactic.cpp index 5d1a74813..5a8c3061c 100644 --- a/src/qe/qe_tactic.cpp +++ b/src/qe/qe_tactic.cpp @@ -102,46 +102,46 @@ public: m_imp = alloc(imp, m, p); } - virtual tactic * translate(ast_manager & m) { + tactic * translate(ast_manager & m) override { return alloc(qe_tactic, m, m_params); } - virtual ~qe_tactic() { + ~qe_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 { r.insert("qe_nonlinear", CPK_BOOL, "(default: false) enable virtual term substitution."); 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); m_st.reset(); m_imp->collect_statistics(m_st); } - virtual void collect_statistics(statistics & st) const { + void collect_statistics(statistics & st) const override { st.copy(m_st); } - virtual void reset_statistics() { + void reset_statistics() override { m_st.reset(); } - virtual void cleanup() { + void cleanup() override { ast_manager & m = m_imp->m; dealloc(m_imp); m_imp = alloc(imp, m, m_params); diff --git a/src/qe/qe_vartest.h b/src/qe/qe_vartest.h index 047964825..56d9229b8 100644 --- a/src/qe/qe_vartest.h +++ b/src/qe/qe_vartest.h @@ -42,7 +42,7 @@ public: m_num_decls(num_decls), m_var_kind(BY_NUM_DECLS) {} - virtual bool operator()(expr* e) const { + bool operator()(expr* e) const override { if (!is_var(e)) { return false; } diff --git a/src/qe/qsat.cpp b/src/qe/qsat.cpp index 2419d1c77..6d470c5de 100644 --- a/src/qe/qsat.cpp +++ b/src/qe/qsat.cpp @@ -696,7 +696,7 @@ namespace qe { m_level -= num_scopes; } - void reset() { + void reset() override { m_st.reset(); m_fa.s().collect_statistics(m_st); m_ex.s().collect_statistics(m_st); @@ -1204,14 +1204,14 @@ namespace qe { reset(); } - virtual ~qsat() { + ~qsat() override { reset(); } - void updt_params(params_ref const & p) { + void updt_params(params_ref const & p) override { } - void collect_param_descrs(param_descrs & r) { + void collect_param_descrs(param_descrs & r) override { } @@ -1219,7 +1219,7 @@ namespace qe { /* out */ goal_ref_buffer & result, /* out */ model_converter_ref & mc, /* out */ proof_converter_ref & pc, - /* out */ expr_dependency_ref & core) { + /* out */ expr_dependency_ref & core) override { tactic_report report("qsat-tactic", *in); ptr_vector fmls; expr_ref_vector defs(m); @@ -1291,7 +1291,7 @@ namespace qe { } } - void collect_statistics(statistics & st) const { + void collect_statistics(statistics & st) const override { st.copy(m_st); m_fa.s().collect_statistics(st); m_ex.s().collect_statistics(st); @@ -1300,23 +1300,23 @@ namespace qe { m_pred_abs.collect_statistics(st); } - void reset_statistics() { + void reset_statistics() override { m_stats.reset(); m_fa.reset(); m_ex.reset(); } - void cleanup() { + void cleanup() override { reset(); } - void set_logic(symbol const & l) { + void set_logic(symbol const & l) override { } - void set_progress_callback(progress_callback * callback) { + void set_progress_callback(progress_callback * callback) override { } - tactic * translate(ast_manager & m) { + tactic * translate(ast_manager & m) override { return alloc(qsat, m, m_params, m_mode); } diff --git a/src/sat/sat_solver/inc_sat_solver.cpp b/src/sat/sat_solver/inc_sat_solver.cpp index 191c49294..0b0ef24d2 100644 --- a/src/sat/sat_solver/inc_sat_solver.cpp +++ b/src/sat/sat_solver/inc_sat_solver.cpp @@ -83,9 +83,9 @@ public: init_preprocess(); } - virtual ~inc_sat_solver() {} + ~inc_sat_solver() override {} - virtual solver* translate(ast_manager& dst_m, params_ref const& p) { + solver* translate(ast_manager& dst_m, params_ref const& p) override { ast_translation tr(m, dst_m); if (m_num_scopes > 0) { throw default_exception("Cannot translate sat solver at non-base level"); @@ -103,7 +103,7 @@ public: return result; } - virtual void set_progress_callback(progress_callback * callback) {} + void set_progress_callback(progress_callback * callback) override {} void display_weighted(std::ostream& out, unsigned sz, expr * const * assumptions, unsigned const* weights) { if (weights != 0) { @@ -135,7 +135,7 @@ public: (m.is_not(e, e) && is_uninterp_const(e)); } - virtual lbool check_sat(unsigned sz, expr * const * assumptions) { + lbool check_sat(unsigned sz, expr * const * assumptions) override { m_solver.pop_to_base_level(); expr_ref_vector _assumptions(m); obj_map asm2fml; @@ -185,7 +185,7 @@ public: } return r; } - virtual void push() { + void push() override { internalize_formulas(); m_solver.user_push(); ++m_num_scopes; @@ -195,7 +195,7 @@ public: if (m_bb_rewriter) m_bb_rewriter->push(); m_map.push(); } - virtual void pop(unsigned n) { + void pop(unsigned n) override { if (n > m_num_scopes) { // allow inc_sat_solver to n = m_num_scopes; // take over for another solver. } @@ -214,10 +214,10 @@ public: --n; } } - virtual unsigned get_scope_level() const { + unsigned get_scope_level() const override { return m_num_scopes; } - virtual void assert_expr(expr * t, expr * a) { + void assert_expr(expr * t, expr * a) override { if (a) { m_asmsf.push_back(a); assert_expr(m.mk_implies(a, t)); @@ -226,42 +226,42 @@ public: assert_expr(t); } } - virtual ast_manager& get_manager() const { return m; } - virtual void assert_expr(expr * t) { + ast_manager& get_manager() const override { return m; } + void assert_expr(expr * t) override { TRACE("sat", tout << mk_pp(t, m) << "\n";); m_fmls.push_back(t); } - virtual void set_produce_models(bool f) {} - virtual void collect_param_descrs(param_descrs & r) { + void set_produce_models(bool f) override {} + void collect_param_descrs(param_descrs & r) override { goal2sat::collect_param_descrs(r); sat::solver::collect_param_descrs(r); } - virtual void updt_params(params_ref const & p) { + void updt_params(params_ref const & p) override { solver::updt_params(p); m_params.set_bool("elim_vars", false); m_solver.updt_params(m_params); m_optimize_model = m_params.get_bool("optimize_model", false); } - virtual void collect_statistics(statistics & st) const { + void collect_statistics(statistics & st) const override { if (m_preprocess) m_preprocess->collect_statistics(st); m_solver.collect_statistics(st); } - virtual void get_unsat_core(ptr_vector & r) { + void get_unsat_core(ptr_vector & r) override { r.reset(); r.append(m_core.size(), m_core.c_ptr()); } - virtual void get_model(model_ref & mdl) { + void get_model(model_ref & mdl) override { if (!m_model.get()) { extract_model(); } mdl = m_model; } - virtual proof * get_proof() { + proof * get_proof() override { UNREACHABLE(); return 0; } - virtual lbool get_consequences_core(expr_ref_vector const& assumptions, expr_ref_vector const& vars, expr_ref_vector& conseq) { + lbool get_consequences_core(expr_ref_vector const& assumptions, expr_ref_vector const& vars, expr_ref_vector& conseq) override { init_preprocess(); TRACE("sat", tout << assumptions << "\n" << vars << "\n";); sat::literal_vector asms; @@ -304,7 +304,7 @@ public: return r; } - virtual lbool find_mutexes(expr_ref_vector const& vars, vector& mutexes) { + lbool find_mutexes(expr_ref_vector const& vars, vector& mutexes) override { sat::literal_vector ls; u_map lit2var; for (unsigned i = 0; i < vars.size(); ++i) { @@ -330,24 +330,24 @@ public: return l_true; } - virtual std::string reason_unknown() const { + std::string reason_unknown() const override { return m_unknown; } - virtual void set_reason_unknown(char const* msg) { + void set_reason_unknown(char const* msg) override { m_unknown = msg; } - virtual void get_labels(svector & r) { + void get_labels(svector & r) override { } - virtual unsigned get_num_assertions() const { + unsigned get_num_assertions() const override { return m_fmls.size(); } - virtual expr * get_assertion(unsigned idx) const { + expr * get_assertion(unsigned idx) const override { return m_fmls[idx]; } - virtual unsigned get_num_assumptions() const { + unsigned get_num_assumptions() const override { return m_asmsf.size(); } - virtual expr * get_assumption(unsigned idx) const { + expr * get_assumption(unsigned idx) const override { return m_asmsf[idx]; } diff --git a/src/sat/tactic/goal2sat.cpp b/src/sat/tactic/goal2sat.cpp index 1f9dd91d1..bb5907003 100644 --- a/src/sat/tactic/goal2sat.cpp +++ b/src/sat/tactic/goal2sat.cpp @@ -593,7 +593,7 @@ struct sat2goal::imp { } } - virtual void operator()(model_ref & md, unsigned goal_idx) { + void operator()(model_ref & md, unsigned goal_idx) override { SASSERT(goal_idx == 0); TRACE("sat_mc", tout << "before sat_mc\n"; model_v2_pp(tout, *md); display(tout);); // REMARK: potential problem @@ -644,7 +644,7 @@ struct sat2goal::imp { TRACE("sat_mc", tout << "after sat_mc\n"; model_v2_pp(tout, *md);); } - virtual model_converter * translate(ast_translation & translator) { + model_converter * translate(ast_translation & translator) override { sat_model_converter * res = alloc(sat_model_converter, translator.to()); res->m_fmc = static_cast(m_fmc->translate(translator)); unsigned sz = m_var2expr.size(); @@ -653,7 +653,7 @@ struct sat2goal::imp { return res; } - void display(std::ostream & out) { + void display(std::ostream & out) override { out << "(sat-model-converter\n"; m_mc.display(out); sat::bool_var_set vars; diff --git a/src/sat/tactic/sat_tactic.cpp b/src/sat/tactic/sat_tactic.cpp index 4a6171f70..3db379cb1 100644 --- a/src/sat/tactic/sat_tactic.cpp +++ b/src/sat/tactic/sat_tactic.cpp @@ -39,9 +39,9 @@ class sat_tactic : public tactic { SASSERT(!m.proofs_enabled()); } - void operator()(goal_ref const & g, - goal_ref_buffer & result, - model_converter_ref & mc, + void operator()(goal_ref const & g, + goal_ref_buffer & result, + model_converter_ref & mc, proof_converter_ref & pc, expr_dependency_ref & core) { mc = 0; pc = 0; core = 0; @@ -162,29 +162,29 @@ public: m_params(p) { } - virtual tactic * translate(ast_manager & m) { + tactic * translate(ast_manager & m) override { return alloc(sat_tactic, m, m_params); } - virtual ~sat_tactic() { + ~sat_tactic() override { SASSERT(m_imp == 0); } - virtual void updt_params(params_ref const & p) { + void updt_params(params_ref const & p) override { m_params = p; } - virtual void collect_param_descrs(param_descrs & r) { + void collect_param_descrs(param_descrs & r) override { goal2sat::collect_param_descrs(r); sat2goal::collect_param_descrs(r); sat::solver::collect_param_descrs(r); } - void operator()(goal_ref const & g, - goal_ref_buffer & result, - model_converter_ref & mc, + void operator()(goal_ref const & g, + goal_ref_buffer & result, + model_converter_ref & mc, proof_converter_ref & pc, - expr_dependency_ref & core) { + expr_dependency_ref & core) override { imp proc(g->m(), m_params); scoped_set_imp set(this, &proc); try { @@ -198,15 +198,15 @@ public: TRACE("sat_stats", m_stats.display_smt2(tout);); } - virtual void cleanup() { + void cleanup() override { SASSERT(m_imp == 0); } - virtual void collect_statistics(statistics & st) const { + void collect_statistics(statistics & st) const override { st.copy(m_stats); } - virtual void reset_statistics() { + void reset_statistics() override { m_stats.reset(); } diff --git a/src/shell/lp_frontend.cpp b/src/shell/lp_frontend.cpp index 95f9e1eb3..c1afd5e13 100644 --- a/src/shell/lp_frontend.cpp +++ b/src/shell/lp_frontend.cpp @@ -49,7 +49,7 @@ struct front_end_resource_limit : public lp::lp_resource_limit { m_reslim(lim) {} - virtual bool get_cancel_flag() { return !m_reslim.inc(); } + bool get_cancel_flag() override { return !m_reslim.inc(); } }; void run_solver(lp_params & params, char const * mps_file_name) { diff --git a/src/smt/arith_eq_adapter.cpp b/src/smt/arith_eq_adapter.cpp index 307bdc671..febec9565 100644 --- a/src/smt/arith_eq_adapter.cpp +++ b/src/smt/arith_eq_adapter.cpp @@ -42,7 +42,7 @@ namespace smt { m_n2(n2) { } - virtual void undo(context & ctx) { + void undo(context & ctx) override { m_already_processed.erase(m_n1, m_n2); TRACE("arith_eq_adapter_profile", tout << "del #" << m_n1->get_owner_id() << " #" << m_n2->get_owner_id() << "\n";); } @@ -67,9 +67,9 @@ namespace smt { m_ge(ge) { } - virtual ~arith_eq_relevancy_eh() {} + ~arith_eq_relevancy_eh() override {} - virtual void operator()(relevancy_propagator & rp) { + void operator()(relevancy_propagator & rp) override { if (!rp.is_relevant(m_n1)) return; if (!rp.is_relevant(m_n2)) diff --git a/src/smt/asserted_formulas.h b/src/smt/asserted_formulas.h index 88c9e13a7..a67b975eb 100644 --- a/src/smt/asserted_formulas.h +++ b/src/smt/asserted_formulas.h @@ -82,80 +82,80 @@ class asserted_formulas { class reduce_asserted_formulas_fn : public simplify_fmls { public: reduce_asserted_formulas_fn(asserted_formulas& af): simplify_fmls(af, "reduce-asserted") {} - virtual void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) { af.m_rewriter(j.get_fml(), n, p); } + void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { af.m_rewriter(j.get_fml(), n, p); } }; class find_macros_fn : public simplify_fmls { public: find_macros_fn(asserted_formulas& af): simplify_fmls(af, "find-macros") {} - virtual void operator()() { af.find_macros_core(); } - virtual bool should_apply() const { return af.m_params.m_macro_finder && af.has_quantifiers(); } - virtual void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) { UNREACHABLE(); } + void operator()() override { af.find_macros_core(); } + bool should_apply() const override { return af.m_params.m_macro_finder && af.has_quantifiers(); } + void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { UNREACHABLE(); } }; class apply_quasi_macros_fn : public simplify_fmls { public: apply_quasi_macros_fn(asserted_formulas& af): simplify_fmls(af, "find-quasi-macros") {} - virtual void operator()() { af.apply_quasi_macros(); } - virtual bool should_apply() const { return af.m_params.m_quasi_macros && af.has_quantifiers(); } - virtual void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) { UNREACHABLE(); } + void operator()() override { af.apply_quasi_macros(); } + bool should_apply() const override { return af.m_params.m_quasi_macros && af.has_quantifiers(); } + void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { UNREACHABLE(); } }; class nnf_cnf_fn : public simplify_fmls { public: nnf_cnf_fn(asserted_formulas& af): simplify_fmls(af, "nnf-cnf") {} - virtual void operator()() { af.nnf_cnf(); } - virtual bool should_apply() const { return af.m_params.m_nnf_cnf || (af.m_params.m_mbqi && af.has_quantifiers()); } - virtual void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) { UNREACHABLE(); } + void operator()() override { af.nnf_cnf(); } + bool should_apply() const override { return af.m_params.m_nnf_cnf || (af.m_params.m_mbqi && af.has_quantifiers()); } + void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { UNREACHABLE(); } }; class propagate_values_fn : public simplify_fmls { public: propagate_values_fn(asserted_formulas& af): simplify_fmls(af, "propagate-values") {} - virtual void operator()() { af.propagate_values(); } - virtual bool should_apply() const { return af.m_params.m_propagate_values; } - virtual void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) { UNREACHABLE(); } + void operator()() override { af.propagate_values(); } + bool should_apply() const override { return af.m_params.m_propagate_values; } + void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { UNREACHABLE(); } }; class distribute_forall_fn : public simplify_fmls { distribute_forall m_functor; public: distribute_forall_fn(asserted_formulas& af): simplify_fmls(af, "distribute-forall"), m_functor(af.m) {} - virtual void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) { m_functor(j.get_fml(), n); } - virtual bool should_apply() const { return af.m_params.m_distribute_forall && af.has_quantifiers(); } - virtual void post_op() { af.reduce_and_solve(); TRACE("asserted_formulas", af.display(tout);); } + void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { m_functor(j.get_fml(), n); } + bool should_apply() const override { return af.m_params.m_distribute_forall && af.has_quantifiers(); } + void post_op() override { af.reduce_and_solve(); TRACE("asserted_formulas", af.display(tout);); } }; class pattern_inference_fn : public simplify_fmls { pattern_inference_rw m_infer; public: pattern_inference_fn(asserted_formulas& af): simplify_fmls(af, "pattern-inference"), m_infer(af.m, af.m_params) {} - virtual void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) { m_infer(j.get_fml(), n, p); } - virtual bool should_apply() const { return af.m_params.m_ematching && af.has_quantifiers(); } + void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { m_infer(j.get_fml(), n, p); } + bool should_apply() const override { return af.m_params.m_ematching && af.has_quantifiers(); } }; class refine_inj_axiom_fn : public simplify_fmls { public: refine_inj_axiom_fn(asserted_formulas& af): simplify_fmls(af, "refine-injectivity") {} - virtual void simplify(justified_expr const& j, expr_ref& n, proof_ref& p); - virtual bool should_apply() const { return af.m_params.m_refine_inj_axiom && af.has_quantifiers(); } + void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override; + bool should_apply() const override { return af.m_params.m_refine_inj_axiom && af.has_quantifiers(); } }; class max_bv_sharing_fn : public simplify_fmls { public: max_bv_sharing_fn(asserted_formulas& af): simplify_fmls(af, "maximizing-bv-sharing") {} - virtual void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) { af.m_bv_sharing(j.get_fml(), n, p); } - virtual bool should_apply() const { return af.m_params.m_max_bv_sharing; } - virtual void post_op() { af.m_reduce_asserted_formulas(); } + void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { af.m_bv_sharing(j.get_fml(), n, p); } + bool should_apply() const override { return af.m_params.m_max_bv_sharing; } + void post_op() override { af.m_reduce_asserted_formulas(); } }; class elim_term_ite_fn : public simplify_fmls { elim_term_ite_rw m_elim; public: elim_term_ite_fn(asserted_formulas& af): simplify_fmls(af, "elim-term-ite"), m_elim(af.m, af.m_defined_names) {} - virtual void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) { m_elim(j.get_fml(), n, p); } - virtual bool should_apply() const { return af.m_params.m_eliminate_term_ite && af.m_params.m_lift_ite != LI_FULL; } - virtual void post_op() { af.m_formulas.append(m_elim.new_defs()); af.reduce_and_solve(); m_elim.reset(); } + void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { m_elim(j.get_fml(), n, p); } + bool should_apply() const override { return af.m_params.m_eliminate_term_ite && af.m_params.m_lift_ite != LI_FULL; } + void post_op() override { af.m_formulas.append(m_elim.new_defs()); af.reduce_and_solve(); m_elim.reset(); } }; #define MK_SIMPLIFIERA(NAME, FUNCTOR, MSG, APP, ARG, REDUCE) \ diff --git a/src/smt/dyn_ack.cpp b/src/smt/dyn_ack.cpp index baa8129bb..dd77640bc 100644 --- a/src/smt/dyn_ack.cpp +++ b/src/smt/dyn_ack.cpp @@ -39,12 +39,12 @@ namespace smt { SASSERT(m_app1->get_id() < m_app2->get_id()); } - virtual char const * get_name() const { return "dyn-ack"; } + char const * get_name() const override { return "dyn-ack"; } - virtual void get_antecedents(conflict_resolution & cr) { + void get_antecedents(conflict_resolution & cr) override { } - virtual void display_debug_info(conflict_resolution & cr, std::ostream & out) { + void display_debug_info(conflict_resolution & cr, std::ostream & out) override { ast_manager & m = cr.get_manager(); out << "m_app1:\n" << mk_pp(m_app1, m) << "\n"; out << "m_app2:\n" << mk_pp(m_app2, m) << "\n"; @@ -70,7 +70,7 @@ namespace smt { } } - virtual proof * mk_proof(conflict_resolution & cr) { + proof * mk_proof(conflict_resolution & cr) override { ast_manager & m = cr.get_manager(); context & ctx = cr.get_context(); unsigned num_args = m_app1->get_num_args(); @@ -288,8 +288,8 @@ namespace smt { dyn_ack_clause_del_eh(dyn_ack_manager & m): m_manager(m) { } - virtual ~dyn_ack_clause_del_eh() {} - virtual void operator()(ast_manager & m, clause * cls) { + ~dyn_ack_clause_del_eh() override {} + void operator()(ast_manager & m, clause * cls) override { m_manager.del_clause_eh(cls); dealloc(this); } diff --git a/src/smt/mam.cpp b/src/smt/mam.cpp index c979e476e..7fd1dd9d0 100644 --- a/src/smt/mam.cpp +++ b/src/smt/mam.cpp @@ -2844,7 +2844,7 @@ namespace smt { unsigned m_lbl_id; public: mk_tree_trail(ptr_vector & t, unsigned id):m_trees(t), m_lbl_id(id) {} - virtual void undo(mam_impl & m) { + void undo(mam_impl & m) override { dealloc(m_trees[m_lbl_id]); m_trees[m_lbl_id] = 0; } @@ -3104,7 +3104,7 @@ namespace smt { enode * m_enode; public: add_shared_enode_trail(enode * n):m_enode(n) {} - virtual void undo(mam_impl & m) { m.m_shared_enodes.erase(m_enode); } + void undo(mam_impl & m) override { m.m_shared_enodes.erase(m_enode); } }; #ifdef Z3DEBUG @@ -3819,11 +3819,11 @@ namespace smt { reset_pp_pc(); } - virtual ~mam_impl() { + ~mam_impl() override { m_trail_stack.reset(); } - virtual void add_pattern(quantifier * qa, app * mp) { + void add_pattern(quantifier * qa, app * mp) override { SASSERT(m_ast_manager.is_pattern(mp)); TRACE("trigger_bug", tout << "adding pattern\n" << mk_ismt2_pp(qa, m_ast_manager) << "\n" << mk_ismt2_pp(mp, m_ast_manager) << "\n";); TRACE("mam_bug", tout << "adding pattern\n" << mk_pp(qa, m_ast_manager) << "\n" << mk_pp(mp, m_ast_manager) << "\n";); @@ -3846,11 +3846,11 @@ namespace smt { m_trees.add_pattern(qa, mp, i); } - virtual void push_scope() { + void push_scope() override { m_trail_stack.push_scope(); } - virtual void pop_scope(unsigned num_scopes) { + void pop_scope(unsigned num_scopes) override { if (!m_to_match.empty()) { ptr_vector::iterator it = m_to_match.begin(); ptr_vector::iterator end = m_to_match.end(); @@ -3864,7 +3864,7 @@ namespace smt { m_trail_stack.pop_scope(num_scopes); } - virtual void reset() { + void reset() override { m_trail_stack.reset(); m_trees.reset(); m_to_match.reset(); @@ -3875,7 +3875,7 @@ namespace smt { m_tmp_region.reset(); } - virtual void display(std::ostream& out) { + void display(std::ostream& out) override { out << "mam:\n"; m_lbl_hasher.display(out); ptr_vector::iterator it = m_trees.begin_code_trees(); @@ -3886,7 +3886,7 @@ namespace smt { } } - virtual void match() { + void match() override { TRACE("trigger_bug", tout << "match\n"; display(tout);); ptr_vector::iterator it = m_to_match.begin(); ptr_vector::iterator end = m_to_match.end(); @@ -3903,7 +3903,7 @@ namespace smt { } } - virtual void rematch(bool use_irrelevant) { + void rematch(bool use_irrelevant) override { ptr_vector::iterator it = m_trees.begin_code_trees(); ptr_vector::iterator end = m_trees.end_code_trees(); unsigned lbl = 0; @@ -3932,7 +3932,7 @@ namespace smt { } #endif - virtual void on_match(quantifier * qa, app * pat, unsigned num_bindings, enode * const * bindings, unsigned max_generation, ptr_vector & used_enodes) { + void on_match(quantifier * qa, app * pat, unsigned num_bindings, enode * const * bindings, unsigned max_generation, ptr_vector & used_enodes) override { TRACE("trigger_bug", tout << "found match " << mk_pp(qa, m_ast_manager) << "\n";); #ifdef Z3DEBUG if (m_check_missing_instances) { @@ -3955,13 +3955,13 @@ namespace smt { m_context.add_instance(qa, pat, num_bindings, bindings, max_generation, min_gen, max_gen, used_enodes); } - virtual bool is_shared(enode * n) const { + bool is_shared(enode * n) const override { return !m_shared_enodes.empty() && m_shared_enodes.contains(n); } // This method is invoked when n becomes relevant. // If lazy == true, then n is not added to the list of candidate enodes for matching. That is, the method just updates the lbls. - virtual void relevant_eh(enode * n, bool lazy) { + void relevant_eh(enode * n, bool lazy) override { TRACE("trigger_bug", tout << "relevant_eh:\n" << mk_ismt2_pp(n->get_owner(), m_ast_manager) << "\n"; tout << "mam: " << this << "\n";); TRACE("mam", tout << "relevant_eh: #" << n->get_owner_id() << "\n";); @@ -3984,11 +3984,11 @@ namespace smt { } } - virtual bool has_work() const { + bool has_work() const override { return !m_to_match.empty() || !m_new_patterns.empty(); } - virtual void add_eq_eh(enode * r1, enode * r2) { + void add_eq_eh(enode * r1, enode * r2) override { flet l1(m_r1, r1); flet l2(m_r2, r2); diff --git a/src/smt/proto_model/array_factory.h b/src/smt/proto_model/array_factory.h index 4d4f52944..b59df3f94 100644 --- a/src/smt/proto_model/array_factory.h +++ b/src/smt/proto_model/array_factory.h @@ -32,13 +32,13 @@ class array_factory : public struct_factory { public: array_factory(ast_manager & m, proto_model & md); - virtual ~array_factory() {} + ~array_factory() override {} - virtual expr * get_some_value(sort * s); + expr * get_some_value(sort * s) override; - virtual bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2); + bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2) override; - virtual expr * get_fresh_value(sort * s); + expr * get_fresh_value(sort * s) override; }; #endif /* ARRAY_FACTORY_H_ */ diff --git a/src/smt/proto_model/datatype_factory.h b/src/smt/proto_model/datatype_factory.h index 9f64b8daa..85b264382 100644 --- a/src/smt/proto_model/datatype_factory.h +++ b/src/smt/proto_model/datatype_factory.h @@ -33,9 +33,9 @@ class datatype_factory : public struct_factory { public: datatype_factory(ast_manager & m, proto_model & md); - virtual ~datatype_factory() {} - virtual expr * get_some_value(sort * s); - virtual expr * get_fresh_value(sort * s); + ~datatype_factory() override {} + expr * get_some_value(sort * s) override; + expr * get_fresh_value(sort * s) override; }; #endif /* DATATYPE_FACTORY_H_ */ diff --git a/src/smt/proto_model/numeral_factory.h b/src/smt/proto_model/numeral_factory.h index f1b68223b..198ff0d32 100644 --- a/src/smt/proto_model/numeral_factory.h +++ b/src/smt/proto_model/numeral_factory.h @@ -26,17 +26,17 @@ Revision History: class numeral_factory : public simple_factory { public: numeral_factory(ast_manager & m, family_id fid):simple_factory(m, fid) {} - virtual ~numeral_factory() {} + ~numeral_factory() override {} }; class arith_factory : public numeral_factory { arith_util m_util; - virtual app * mk_value_core(rational const & val, sort * s); + app * mk_value_core(rational const & val, sort * s) override; public: arith_factory(ast_manager & m); - virtual ~arith_factory(); + ~arith_factory() override; app * mk_num_value(rational const & val, bool is_int); }; @@ -44,11 +44,11 @@ public: class bv_factory : public numeral_factory { bv_util m_util; - virtual app * mk_value_core(rational const & val, sort * s); + app * mk_value_core(rational const & val, sort * s) override; public: bv_factory(ast_manager & m); - virtual ~bv_factory(); + ~bv_factory() override; app * mk_num_value(rational const & val, unsigned bv_size); }; diff --git a/src/smt/proto_model/proto_model.h b/src/smt/proto_model/proto_model.h index 05af0091c..d92d459e4 100644 --- a/src/smt/proto_model/proto_model.h +++ b/src/smt/proto_model/proto_model.h @@ -60,7 +60,7 @@ class proto_model : public model_core { public: proto_model(ast_manager & m, params_ref const & p = params_ref()); - virtual ~proto_model() {} + ~proto_model() override {} void register_factory(value_factory * f) { m_factories.register_plugin(f); } @@ -69,7 +69,7 @@ public: value_factory * get_factory(family_id fid); - virtual expr * get_some_value(sort * s); + expr * get_some_value(sort * s) override; bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2); @@ -93,9 +93,9 @@ public: void freeze_universe(sort * s); bool is_finite(sort * s) const; obj_hashtable const & get_known_universe(sort * s) const; - virtual ptr_vector const & get_universe(sort * s) const; - virtual unsigned get_num_uninterpreted_sorts() const; - virtual sort * get_uninterpreted_sort(unsigned idx) const; + ptr_vector const & get_universe(sort * s) const override; + unsigned get_num_uninterpreted_sorts() const override; + sort * get_uninterpreted_sort(unsigned idx) const override; // // Complete partial function interps diff --git a/src/smt/proto_model/struct_factory.h b/src/smt/proto_model/struct_factory.h index bfbd90ede..9fe54392c 100644 --- a/src/smt/proto_model/struct_factory.h +++ b/src/smt/proto_model/struct_factory.h @@ -43,11 +43,11 @@ protected: public: struct_factory(ast_manager & m, family_id fid, proto_model & md); - virtual ~struct_factory(); + ~struct_factory() override; - virtual bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2); + bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2) override; - virtual void register_value(expr * array_value); + void register_value(expr * array_value) override; }; #endif /* STRUCT_FACTORY_H_ */ diff --git a/src/smt/proto_model/value_factory.h b/src/smt/proto_model/value_factory.h index e81c63306..3979a47bb 100644 --- a/src/smt/proto_model/value_factory.h +++ b/src/smt/proto_model/value_factory.h @@ -64,13 +64,13 @@ class basic_factory : public value_factory { public: basic_factory(ast_manager & m); - virtual expr * get_some_value(sort * s); + expr * get_some_value(sort * s) override; - virtual bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2); + bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2) override; - virtual expr * get_fresh_value(sort * s); + expr * get_fresh_value(sort * s) override; - virtual void register_value(expr * n) { } + void register_value(expr * n) override { } }; /** @@ -133,11 +133,11 @@ public: m_sorts(m) { } - virtual ~simple_factory() { + ~simple_factory() override { std::for_each(m_sets.begin(), m_sets.end(), delete_proc()); } - virtual expr * get_some_value(sort * s) { + expr * get_some_value(sort * s) override { value_set * set = 0; expr * result = 0; if (m_sort2value_set.find(s, set) && !set->m_values.empty()) @@ -147,7 +147,7 @@ public: return result; } - virtual bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2) { + bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2) override { value_set * set = 0; if (m_sort2value_set.find(s, set)) { switch (set->m_values.size()) { @@ -176,7 +176,7 @@ public: return true; } - virtual expr * get_fresh_value(sort * s) { + expr * get_fresh_value(sort * s) override { value_set * set = get_value_set(s); bool is_new = false; expr * result = 0; @@ -202,7 +202,7 @@ public: return result; } - virtual void register_value(expr * n) { + void register_value(expr * n) override { sort * s = this->m_manager.get_sort(n); value_set * set = get_value_set(s); if (!set->m_values.contains(n)) { @@ -228,10 +228,10 @@ public: class user_sort_factory : public simple_factory { obj_hashtable m_finite; //!< set of sorts that are marked as finite. obj_hashtable m_empty_universe; - virtual app * mk_value_core(unsigned const & val, sort * s); + app * mk_value_core(unsigned const & val, sort * s) override; public: user_sort_factory(ast_manager & m); - virtual ~user_sort_factory() {} + ~user_sort_factory() override {} /** \brief Make the universe of \c s finite, by preventing new @@ -257,13 +257,13 @@ public: */ obj_hashtable const & get_finite_sorts() const { return m_finite; } - virtual expr * get_some_value(sort * s); + expr * get_some_value(sort * s) override; - virtual bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2); + bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2) override; - virtual expr * get_fresh_value(sort * s); + expr * get_fresh_value(sort * s) override; - virtual void register_value(expr * n); + void register_value(expr * n) override; }; #endif /* VALUE_FACTORY_H_ */ diff --git a/src/smt/smt2_extra_cmds.cpp b/src/smt/smt2_extra_cmds.cpp index 136805e43..238295a49 100644 --- a/src/smt/smt2_extra_cmds.cpp +++ b/src/smt/smt2_extra_cmds.cpp @@ -24,22 +24,22 @@ class include_cmd : public cmd { char const * m_filename; public: include_cmd() : cmd("include"), m_filename(0) {} - virtual char const * get_usage() const { return ""; } - virtual char const * get_descr(cmd_context & ctx) const { return "include a file"; } - virtual unsigned get_arity() const { return 1; } - virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const { return CPK_STRING; } - virtual void set_next_arg(cmd_context & ctx, char const * val) { m_filename = val; } - virtual void failure_cleanup(cmd_context & ctx) {} - virtual void execute(cmd_context & ctx) { + char const * get_usage() const override { return ""; } + char const * get_descr(cmd_context & ctx) const override { return "include a file"; } + unsigned get_arity() const override { return 1; } + cmd_arg_kind next_arg_kind(cmd_context & ctx) const override { return CPK_STRING; } + void set_next_arg(cmd_context & ctx, char const * val) override { m_filename = val; } + void failure_cleanup(cmd_context & ctx) override {} + void execute(cmd_context & ctx) override { std::ifstream is(m_filename); if (is.bad() || is.fail()) throw cmd_exception(std::string("failed to open file '") + m_filename + "'"); parse_smt2_commands(ctx, is, false, params_ref(), m_filename); is.close(); } - virtual void prepare(cmd_context & ctx) { reset(ctx); } - virtual void reset(cmd_context & ctx) { m_filename = 0; } - virtual void finalize(cmd_context & ctx) { reset(ctx); } + void prepare(cmd_context & ctx) override { reset(ctx); } + void reset(cmd_context & ctx) override { m_filename = 0; } + void finalize(cmd_context & ctx) override { reset(ctx); } }; void install_smt2_extra_cmds(cmd_context & ctx) { diff --git a/src/smt/smt_case_split_queue.cpp b/src/smt/smt_case_split_queue.cpp index 6aef5f0a9..3da6ce295 100644 --- a/src/smt/smt_case_split_queue.cpp +++ b/src/smt/smt_case_split_queue.cpp @@ -75,42 +75,42 @@ namespace smt { m_queue(1024, bool_var_act_lt(ctx.get_activity_vector())) { } - virtual void activity_increased_eh(bool_var v) { + void activity_increased_eh(bool_var v) override { if (m_queue.contains(v)) m_queue.decreased(v); } - virtual void mk_var_eh(bool_var v) { + void mk_var_eh(bool_var v) override { m_queue.reserve(v+1); SASSERT(!m_queue.contains(v)); m_queue.insert(v); } - virtual void del_var_eh(bool_var v) { + void del_var_eh(bool_var v) override { if (m_queue.contains(v)) m_queue.erase(v); } - virtual void unassign_var_eh(bool_var v) { + void unassign_var_eh(bool_var v) override { if (!m_queue.contains(v)) m_queue.insert(v); } - virtual void relevant_eh(expr * n) {} + void relevant_eh(expr * n) override {} - virtual void init_search_eh() {} + void init_search_eh() override {} - virtual void end_search_eh() {} + void end_search_eh() override {} - virtual void reset() { + void reset() override { m_queue.reset(); } - virtual void push_scope() {} + void push_scope() override {} - virtual void pop_scope(unsigned num_scopes) {} + void pop_scope(unsigned num_scopes) override {} - virtual void next_case_split(bool_var & next, lbool & phase) { + void next_case_split(bool_var & next, lbool & phase) override { phase = l_undef; if (m_context.get_random_value() < static_cast(m_params.m_random_var_freq * random_gen::max_value())) { @@ -129,7 +129,7 @@ namespace smt { next = null_bool_var; } - virtual void display(std::ostream & out) { + void display(std::ostream & out) override { bool first = true; for (unsigned v : m_queue) { if (m_context.get_assignment(v) == l_undef) { @@ -144,7 +144,7 @@ namespace smt { out << "\n"; } - virtual ~act_case_split_queue() {}; + ~act_case_split_queue() override {}; }; /** @@ -159,7 +159,7 @@ namespace smt { m_delayed_queue(1024, bool_var_act_lt(ctx.get_activity_vector())) { } - virtual void activity_increased_eh(bool_var v) { + void activity_increased_eh(bool_var v) override { act_case_split_queue::activity_increased_eh(v); if (m_queue.contains(v)) m_queue.decreased(v); @@ -167,7 +167,7 @@ namespace smt { m_delayed_queue.decreased(v); } - virtual void mk_var_eh(bool_var v) { + void mk_var_eh(bool_var v) override { m_queue.reserve(v+1); m_delayed_queue.reserve(v+1); SASSERT(!m_delayed_queue.contains(v)); @@ -178,28 +178,28 @@ namespace smt { m_queue.insert(v); } - virtual void del_var_eh(bool_var v) { + void del_var_eh(bool_var v) override { act_case_split_queue::del_var_eh(v); if (m_delayed_queue.contains(v)) m_delayed_queue.erase(v); } - virtual void relevant_eh(expr * n) {} + void relevant_eh(expr * n) override {} - virtual void init_search_eh() {} + void init_search_eh() override {} - virtual void end_search_eh() {} + void end_search_eh() override {} - virtual void reset() { + void reset() override { act_case_split_queue::reset(); m_delayed_queue.reset(); } - virtual void push_scope() {} + void push_scope() override {} - virtual void pop_scope(unsigned num_scopes) {} + void pop_scope(unsigned num_scopes) override {} - virtual void next_case_split(bool_var & next, lbool & phase) { + void next_case_split(bool_var & next, lbool & phase) override { act_case_split_queue::next_case_split(next, phase); if (next != null_bool_var) return; @@ -229,7 +229,7 @@ namespace smt { m_cache_domain(ctx.get_manager()) { } - virtual void mk_var_eh(bool_var v) { + void mk_var_eh(bool_var v) override { expr * n = m_context.bool_var2expr(v); double act; if (m_cache.find(n, act)) @@ -237,7 +237,7 @@ namespace smt { act_case_split_queue::mk_var_eh(v); } - virtual void del_var_eh(bool_var v) { + void del_var_eh(bool_var v) override { if (m_context.is_searching()) { double act = m_context.get_activity(v); if (act > 0.0) { @@ -249,14 +249,14 @@ namespace smt { act_case_split_queue::del_var_eh(v); } - virtual void init_search_eh() { + void init_search_eh() override { m_cache.reset(); m_cache_domain.reset(); } - virtual void end_search_eh() {} + void end_search_eh() override {} - virtual void reset() { + void reset() override { init_search_eh(); } }; @@ -322,15 +322,15 @@ namespace smt { m_head2(0) { } - virtual void activity_increased_eh(bool_var v) {} + void activity_increased_eh(bool_var v) override {} - virtual void mk_var_eh(bool_var v) {} + void mk_var_eh(bool_var v) override {} - virtual void del_var_eh(bool_var v) {} + void del_var_eh(bool_var v) override {} - virtual void unassign_var_eh(bool_var v) {} + void unassign_var_eh(bool_var v) override {} - virtual void relevant_eh(expr * n) { + void relevant_eh(expr * n) override { if (!m_manager.is_bool(n)) return; bool is_or = m_manager.is_or(n); @@ -361,15 +361,15 @@ namespace smt { m_queue2.push_back(n); } - virtual void init_search_eh() { + void init_search_eh() override { m_bs_num_bool_vars = m_context.get_num_bool_vars(); } - virtual void end_search_eh() { + void end_search_eh() override { m_bs_num_bool_vars = UINT_MAX; } - virtual void reset() { + void reset() override { m_queue.reset(); m_head = 0; m_queue2.reset(); @@ -377,7 +377,7 @@ namespace smt { m_scopes.reset(); } - virtual void push_scope() { + void push_scope() override { m_scopes.push_back(scope()); scope & s = m_scopes.back(); s.m_queue_trail = m_queue.size(); @@ -387,7 +387,7 @@ namespace smt { TRACE("case_split", tout << "head: " << m_head << "\n";); } - virtual void pop_scope(unsigned num_scopes) { + void pop_scope(unsigned num_scopes) override { SASSERT(num_scopes <= m_scopes.size()); unsigned new_lvl = m_scopes.size() - num_scopes; scope & s = m_scopes[new_lvl]; @@ -443,7 +443,7 @@ namespace smt { next = null_bool_var; } - virtual void next_case_split(bool_var & next, lbool & phase) { + void next_case_split(bool_var & next, lbool & phase) override { next_case_split_core(m_queue, m_head, next, phase); if (next == null_bool_var) next_case_split_core(m_queue2, m_head2, next, phase); @@ -471,7 +471,7 @@ namespace smt { out << "\n"; } - virtual void display(std::ostream & out) { + void display(std::ostream & out) override { if (m_queue.empty() && m_queue2.empty()) return; out << "case-splits:\n"; @@ -507,9 +507,9 @@ namespace smt { m_delayed_queue(1024, bool_var_act_lt(ctx.get_activity_vector())) { } - virtual void activity_increased_eh(bool_var v) {} + void activity_increased_eh(bool_var v) override {} - virtual void mk_var_eh(bool_var v) { + void mk_var_eh(bool_var v) override { if (m_context.is_searching()) { SASSERT(v >= m_bs_num_bool_vars); m_delayed_queue.reserve(v+1); @@ -517,19 +517,19 @@ namespace smt { } } - virtual void del_var_eh(bool_var v) { + void del_var_eh(bool_var v) override { if (v >= m_bs_num_bool_vars && m_delayed_queue.contains(v)) m_delayed_queue.erase(v); } - virtual void unassign_var_eh(bool_var v) { + void unassign_var_eh(bool_var v) override { if (v < m_bs_num_bool_vars) return; if (!m_delayed_queue.contains(v)) m_delayed_queue.insert(v); } - virtual void relevant_eh(expr * n) { + void relevant_eh(expr * n) override { if (!m_manager.is_bool(n)) return; bool is_or = m_manager.is_or(n); @@ -558,22 +558,22 @@ namespace smt { m_queue.push_back(n); } - virtual void init_search_eh() { + void init_search_eh() override { m_bs_num_bool_vars = m_context.get_num_bool_vars(); } - virtual void end_search_eh() { + void end_search_eh() override { m_bs_num_bool_vars = UINT_MAX; } - virtual void reset() { + void reset() override { m_queue.reset(); m_head = 0; m_delayed_queue.reset(); m_scopes.reset(); } - virtual void push_scope() { + void push_scope() override { m_scopes.push_back(scope()); scope & s = m_scopes.back(); s.m_queue_trail = m_queue.size(); @@ -581,7 +581,7 @@ namespace smt { TRACE("case_split", tout << "head: " << m_head << "\n";); } - virtual void pop_scope(unsigned num_scopes) { + void pop_scope(unsigned num_scopes) override { SASSERT(num_scopes <= m_scopes.size()); unsigned new_lvl = m_scopes.size() - num_scopes; scope & s = m_scopes[new_lvl]; @@ -632,7 +632,7 @@ namespace smt { next = null_bool_var; } - virtual void next_case_split(bool_var & next, lbool & phase) { + void next_case_split(bool_var & next, lbool & phase) override { if (m_context.get_random_value() < static_cast(0.02 * random_gen::max_value())) { next = m_context.get_random_value() % m_context.get_num_b_internalized(); TRACE("random_split", tout << "next: " << next << " get_assignment(next): " << m_context.get_assignment(next) << "\n";); @@ -664,7 +664,7 @@ namespace smt { out << "\n"; } - virtual void display(std::ostream & out) { + void display(std::ostream & out) override { if (m_queue.empty()) return; out << "case-splits:\n"; @@ -751,15 +751,15 @@ namespace smt { set_global_generation(); } - virtual void activity_increased_eh(bool_var v) {} + void activity_increased_eh(bool_var v) override {} - virtual void mk_var_eh(bool_var v) {} + void mk_var_eh(bool_var v) override {} - virtual void del_var_eh(bool_var v) {} + void del_var_eh(bool_var v) override {} - virtual void unassign_var_eh(bool_var v) {} + void unassign_var_eh(bool_var v) override {} - virtual void relevant_eh(expr * n) { + void relevant_eh(expr * n) override { if (get_generation(n) == 0 && m_current_generation != 0) set_generation_rec(n, m_current_generation); @@ -793,21 +793,21 @@ namespace smt { add_to_queue2(n); } - virtual void internalize_instance_eh(expr * e, unsigned gen) + void internalize_instance_eh(expr * e, unsigned gen) override { //lower_generation(e, gen); } - virtual void init_search_eh() { + void init_search_eh() override { m_bs_num_bool_vars = m_context.get_num_bool_vars(); set_global_generation(); } - virtual void end_search_eh() { + void end_search_eh() override { m_bs_num_bool_vars = UINT_MAX; } - virtual void reset() { + void reset() override { m_queue.reset(); m_head = 0; m_queue2.reset(); @@ -816,7 +816,7 @@ namespace smt { set_global_generation(); } - virtual void push_scope() { + void push_scope() override { m_scopes.push_back(scope()); scope & s = m_scopes.back(); s.m_queue_trail = m_queue.size(); @@ -827,7 +827,7 @@ namespace smt { TRACE("case_split", tout << "head: " << m_head << "\n";); } - virtual void pop_scope(unsigned num_scopes) { + void pop_scope(unsigned num_scopes) override { SASSERT(num_scopes <= m_scopes.size()); unsigned new_lvl = m_scopes.size() - num_scopes; scope & s = m_scopes[new_lvl]; @@ -898,7 +898,7 @@ namespace smt { next = null_bool_var; } - virtual void next_case_split(bool_var & next, lbool & phase) { + void next_case_split(bool_var & next, lbool & phase) override { phase = l_undef; next = null_bool_var; @@ -943,7 +943,7 @@ namespace smt { out << "\n"; } - virtual void display(std::ostream & out) { + void display(std::ostream & out) override { if (m_queue.empty() && m_queue2.empty()) return; out << "case-splits:\n"; @@ -951,7 +951,7 @@ namespace smt { //display_core(out, m_queue2, m_head2, 2); } - virtual void assign_lit_eh(literal l) { + void assign_lit_eh(literal l) override { // if (m_current_generation > stop_gen) // m_current_generation--; @@ -1128,41 +1128,41 @@ namespace smt { m_queue(1024, theory_aware_act_lt(ctx.get_activity_vector(), m_theory_var_priority)) { } - virtual void activity_increased_eh(bool_var v) { + void activity_increased_eh(bool_var v) override { if (m_queue.contains(v)) m_queue.decreased(v); } - virtual void mk_var_eh(bool_var v) { + void mk_var_eh(bool_var v) override { m_queue.reserve(v+1); m_queue.insert(v); } - virtual void del_var_eh(bool_var v) { + void del_var_eh(bool_var v) override { if (m_queue.contains(v)) m_queue.erase(v); } - virtual void unassign_var_eh(bool_var v) { + void unassign_var_eh(bool_var v) override { if (!m_queue.contains(v)) m_queue.insert(v); } - virtual void relevant_eh(expr * n) {} + void relevant_eh(expr * n) override {} - virtual void init_search_eh() {} + void init_search_eh() override {} - virtual void end_search_eh() {} + void end_search_eh() override {} - virtual void reset() { + void reset() override { m_queue.reset(); } - virtual void push_scope() {} + void push_scope() override {} - virtual void pop_scope(unsigned num_scopes) {} + void pop_scope(unsigned num_scopes) override {} - virtual void next_case_split(bool_var & next, lbool & phase) { + void next_case_split(bool_var & next, lbool & phase) override { int threshold = static_cast(m_params.m_random_var_freq * random_gen::max_value()); SASSERT(threshold >= 0); if (m_context.get_random_value() < threshold) { @@ -1187,7 +1187,7 @@ namespace smt { } } - virtual void add_theory_aware_branching_info(bool_var v, double priority, lbool phase) { + void add_theory_aware_branching_info(bool_var v, double priority, lbool phase) override { TRACE("theory_aware_branching", tout << "Add theory-aware branching information for l#" << v << ": priority=" << priority << std::endl;); m_theory_vars.insert(v); m_theory_var_phase.insert(v, phase); @@ -1203,7 +1203,7 @@ namespace smt { // m_theory_queue.insert(v); } - virtual void display(std::ostream & out) { + void display(std::ostream & out) override { bool first = true; bool_var_act_queue::const_iterator it = m_queue.begin(); bool_var_act_queue::const_iterator end = m_queue.end(); @@ -1222,7 +1222,7 @@ namespace smt { } - virtual ~theory_aware_branching_queue() {}; + ~theory_aware_branching_queue() override {}; }; diff --git a/src/smt/smt_context.cpp b/src/smt/smt_context.cpp index 375ff7e6f..0f09f1f59 100644 --- a/src/smt/smt_context.cpp +++ b/src/smt/smt_context.cpp @@ -476,7 +476,7 @@ namespace smt { m_r2_num_parents(r2_num_parents) { } - virtual void undo(context & ctx) { + void undo(context & ctx) override { ctx.undo_add_eq(m_r1, m_n1, m_r2_num_parents); } }; @@ -1451,7 +1451,7 @@ namespace smt { bool_var m_var; public: set_var_theory_trail(bool_var v):m_var(v) {} - virtual void undo(context & ctx) { + void undo(context & ctx) override { bool_var_data & d = ctx.m_bdata[m_var]; d.reset_notify_theory(); } @@ -2951,7 +2951,7 @@ namespace smt { case_split_insert_trail(literal l): l(l) { } - virtual void undo(context & ctx) { + void undo(context & ctx) override { ctx.undo_th_case_split(l); } }; @@ -4131,7 +4131,7 @@ namespace smt { bool_var m_var; public: set_true_first_trail(bool_var v):m_var(v) {} - virtual void undo(context & ctx) { + void undo(context & ctx) override { ctx.m_bdata[m_var].reset_true_first_flag(); } }; diff --git a/src/smt/smt_context.h b/src/smt/smt_context.h index 55d8f03f2..3cd93fbe5 100644 --- a/src/smt/smt_context.h +++ b/src/smt/smt_context.h @@ -746,7 +746,7 @@ namespace smt { friend class mk_bool_var_trail; class mk_bool_var_trail : public trail { public: - virtual void undo(context & ctx) { ctx.undo_mk_bool_var(); } + void undo(context & ctx) override { ctx.undo_mk_bool_var(); } }; mk_bool_var_trail m_mk_bool_var_trail; @@ -755,7 +755,7 @@ namespace smt { friend class mk_enode_trail; class mk_enode_trail : public trail { public: - virtual void undo(context & ctx) { ctx.undo_mk_enode(); } + void undo(context & ctx) override { ctx.undo_mk_enode(); } }; mk_enode_trail m_mk_enode_trail; diff --git a/src/smt/smt_for_each_relevant_expr.h b/src/smt/smt_for_each_relevant_expr.h index b81023349..3626e37c7 100644 --- a/src/smt/smt_for_each_relevant_expr.h +++ b/src/smt/smt_for_each_relevant_expr.h @@ -93,8 +93,8 @@ namespace smt { for_each_relevant_expr(ctx), m_buffer(b) { } - virtual ~collect_relevant_label_lits() {} - virtual void operator()(expr * n); + ~collect_relevant_label_lits() override {} + void operator()(expr * n) override; }; class collect_relevant_labels : public for_each_relevant_expr { @@ -104,8 +104,8 @@ namespace smt { for_each_relevant_expr(ctx), m_buffer(b) { } - virtual ~collect_relevant_labels() {} - virtual void operator()(expr * n); + ~collect_relevant_labels() override {} + void operator()(expr * n) override; }; }; diff --git a/src/smt/smt_internalizer.cpp b/src/smt/smt_internalizer.cpp index c38ef4e4a..3c92b8318 100644 --- a/src/smt/smt_internalizer.cpp +++ b/src/smt/smt_internalizer.cpp @@ -631,7 +631,7 @@ namespace smt { set_merge_tf_trail(enode * n): m_node(n) { } - virtual void undo(context & ctx) { + void undo(context & ctx) override { m_node->m_merge_tf = false; } }; @@ -667,7 +667,7 @@ namespace smt { set_enode_flag_trail(bool_var v): m_var(v) { } - virtual void undo(context & ctx) { + void undo(context & ctx) override { bool_var_data & data = ctx.m_bdata[m_var]; data.reset_enode_flag(); } @@ -1612,7 +1612,7 @@ namespace smt { SASSERT(m_th_var != null_theory_var); } - virtual void undo(context & ctx) { + void undo(context & ctx) override { theory_var v = m_enode->get_th_var(m_th_id); SASSERT(v != null_theory_var); SASSERT(m_th_var == v); @@ -1637,7 +1637,7 @@ namespace smt { m_old_th_var(old_var) { } - virtual void undo(context & ctx) { + void undo(context & ctx) override { SASSERT(m_enode->get_th_var(m_th_id) != null_theory_var); m_enode->replace_th_var(m_old_th_var, m_th_id); } diff --git a/src/smt/smt_justification.h b/src/smt/smt_justification.h index 0af8e61ff..1b5aecfe5 100644 --- a/src/smt/smt_justification.h +++ b/src/smt/smt_justification.h @@ -102,15 +102,15 @@ namespace smt { public: justification_proof_wrapper(context & ctx, proof * pr, bool in_region = true); - virtual bool has_del_eh() const { + bool has_del_eh() const override { return true; } - virtual void del_eh(ast_manager & m); + void del_eh(ast_manager & m) override; - virtual proof * mk_proof(conflict_resolution & cr); + proof * mk_proof(conflict_resolution & cr) override; - virtual char const * get_name() const { return "proof-wrapper"; } + char const * get_name() const override { return "proof-wrapper"; } }; class unit_resolution_justification : public justification { @@ -122,21 +122,21 @@ namespace smt { unit_resolution_justification(justification * js, unsigned num_lits, literal const * lits); - ~unit_resolution_justification(); + ~unit_resolution_justification() override; - virtual bool has_del_eh() const { + bool has_del_eh() const override { return !in_region() && m_antecedent && m_antecedent->has_del_eh(); } - virtual void del_eh(ast_manager & m) { + void del_eh(ast_manager & m) override { if (!in_region() && m_antecedent) m_antecedent->del_eh(m); } - virtual void get_antecedents(conflict_resolution & cr); + void get_antecedents(conflict_resolution & cr) override; - virtual proof * mk_proof(conflict_resolution & cr); + proof * mk_proof(conflict_resolution & cr) override; - virtual char const * get_name() const { return "unit-resolution"; } + char const * get_name() const override { return "unit-resolution"; } }; class eq_conflict_justification : public justification { @@ -150,11 +150,11 @@ namespace smt { m_js(js) { } - virtual void get_antecedents(conflict_resolution & cr); + void get_antecedents(conflict_resolution & cr) override; - virtual proof * mk_proof(conflict_resolution & cr); + proof * mk_proof(conflict_resolution & cr) override; - virtual char const * get_name() const { return "eq-conflict"; } + char const * get_name() const override { return "eq-conflict"; } }; /** @@ -166,11 +166,11 @@ namespace smt { eq_root_propagation_justification(enode * n):m_node(n) { } - virtual void get_antecedents(conflict_resolution & cr); + void get_antecedents(conflict_resolution & cr) override; - virtual proof * mk_proof(conflict_resolution & cr); + proof * mk_proof(conflict_resolution & cr) override; - virtual char const * get_name() const { return "eq-root"; } + char const * get_name() const override { return "eq-root"; } }; /** @@ -184,11 +184,11 @@ namespace smt { SASSERT(n1 != n2); } - virtual void get_antecedents(conflict_resolution & cr); + void get_antecedents(conflict_resolution & cr) override; - virtual proof * mk_proof(conflict_resolution & cr); + proof * mk_proof(conflict_resolution & cr) override; - virtual char const * get_name() const { return "eq-propagation"; } + char const * get_name() const override { return "eq-propagation"; } }; /** @@ -201,11 +201,11 @@ namespace smt { mp_iff_justification(enode * n1, enode * n2):m_node1(n1), m_node2(n2) { } - virtual void get_antecedents(conflict_resolution & cr); + void get_antecedents(conflict_resolution & cr) override; - virtual proof * mk_proof(conflict_resolution & cr); + proof * mk_proof(conflict_resolution & cr) override; - virtual char const * get_name() const { return "mp-iff"; } + char const * get_name() const override { return "mp-iff"; } }; /** @@ -221,11 +221,11 @@ namespace smt { public: simple_justification(region & r, unsigned num_lits, literal const * lits); - virtual void get_antecedents(conflict_resolution & cr); + void get_antecedents(conflict_resolution & cr) override; - virtual proof * mk_proof(conflict_resolution & cr) = 0; + proof * mk_proof(conflict_resolution & cr) override = 0; - virtual char const * get_name() const { return "simple"; } + char const * get_name() const override { return "simple"; } }; @@ -240,13 +240,13 @@ namespace smt { unsigned num_params, parameter* params): simple_justification(r, num_lits, lits), m_th_id(fid), m_params(num_params, params) {} - virtual ~simple_theory_justification() {} + ~simple_theory_justification() override {} - virtual bool has_del_eh() const { return !m_params.empty(); } + bool has_del_eh() const override { return !m_params.empty(); } - virtual void del_eh(ast_manager & m) { m_params.reset(); } + void del_eh(ast_manager & m) override { m_params.reset(); } - virtual theory_id get_from_theory() const { return m_th_id; } + theory_id get_from_theory() const override { return m_th_id; } }; @@ -258,11 +258,11 @@ namespace smt { unsigned num_params = 0, parameter* params = 0): simple_theory_justification(fid, r, num_lits, lits, num_params, params) {} - virtual void get_antecedents(conflict_resolution & cr) {} + void get_antecedents(conflict_resolution & cr) override {} - virtual proof * mk_proof(conflict_resolution & cr); + proof * mk_proof(conflict_resolution & cr) override; - virtual char const * get_name() const { return "theory-axiom"; } + char const * get_name() const override { return "theory-axiom"; } }; class theory_propagation_justification : public simple_theory_justification { @@ -272,10 +272,10 @@ namespace smt { unsigned num_params = 0, parameter* params = 0): simple_theory_justification(fid, r, num_lits, lits, num_params, params), m_consequent(consequent) {} - virtual proof * mk_proof(conflict_resolution & cr); + proof * mk_proof(conflict_resolution & cr) override; - virtual char const * get_name() const { return "theory-propagation"; } + char const * get_name() const override { return "theory-propagation"; } }; @@ -285,9 +285,9 @@ namespace smt { unsigned num_params = 0, parameter* params = 0): simple_theory_justification(fid, r, num_lits, lits, num_params, params) {} - virtual proof * mk_proof(conflict_resolution & cr); + proof * mk_proof(conflict_resolution & cr) override; - virtual char const * get_name() const { return "theory-conflict"; } + char const * get_name() const override { return "theory-conflict"; } }; /** @@ -304,11 +304,11 @@ namespace smt { ext_simple_justification(region & r, unsigned num_lits, literal const * lits, unsigned num_eqs, enode_pair const * eqs); - virtual void get_antecedents(conflict_resolution & cr); + void get_antecedents(conflict_resolution & cr) override; - virtual proof * mk_proof(conflict_resolution & cr) = 0; + proof * mk_proof(conflict_resolution & cr) override = 0; - virtual char const * get_name() const { return "ext-simple"; } + char const * get_name() const override { return "ext-simple"; } }; /** @@ -325,13 +325,13 @@ namespace smt { unsigned num_params = 0, parameter* params = 0): ext_simple_justification(r, num_lits, lits, num_eqs, eqs), m_th_id(fid), m_params(num_params, params) {} - virtual ~ext_theory_simple_justification() {} + ~ext_theory_simple_justification() override {} - virtual bool has_del_eh() const { return !m_params.empty(); } + bool has_del_eh() const override { return !m_params.empty(); } - virtual void del_eh(ast_manager & m) { m_params.reset(); } + void del_eh(ast_manager & m) override { m_params.reset(); } - virtual theory_id get_from_theory() const { return m_th_id; } + theory_id get_from_theory() const override { return m_th_id; } }; class ext_theory_propagation_justification : public ext_theory_simple_justification { @@ -345,9 +345,9 @@ namespace smt { ext_theory_simple_justification(fid, r, num_lits, lits, num_eqs, eqs, num_params, params), m_consequent(consequent) {} - virtual proof * mk_proof(conflict_resolution & cr); + proof * mk_proof(conflict_resolution & cr) override; - virtual char const * get_name() const { return "ext-theory-propagation"; } + char const * get_name() const override { return "ext-theory-propagation"; } }; class ext_theory_conflict_justification : public ext_theory_simple_justification { @@ -357,9 +357,9 @@ namespace smt { unsigned num_params = 0, parameter* params = 0): ext_theory_simple_justification(fid, r, num_lits, lits, num_eqs, eqs, num_params, params) {} - virtual proof * mk_proof(conflict_resolution & cr); + proof * mk_proof(conflict_resolution & cr) override; - virtual char const * get_name() const { return "ext-theory-conflict"; } + char const * get_name() const override { return "ext-theory-conflict"; } }; class ext_theory_eq_propagation_justification : public ext_theory_simple_justification { @@ -374,9 +374,9 @@ namespace smt { unsigned num_params = 0, parameter* params = 0): ext_theory_simple_justification(fid, r, num_lits, lits, num_eqs, eqs, num_params, params), m_lhs(lhs), m_rhs(rhs) {} - virtual proof * mk_proof(conflict_resolution & cr); + proof * mk_proof(conflict_resolution & cr) override; - virtual char const * get_name() const { return "ext-theory-eq-propagation"; } + char const * get_name() const override { return "ext-theory-eq-propagation"; } }; /** @@ -394,19 +394,19 @@ namespace smt { theory_lemma_justification(family_id fid, context & ctx, unsigned num_lits, literal const * lits, unsigned num_params = 0, parameter* params = 0); - virtual ~theory_lemma_justification(); + ~theory_lemma_justification() override; - virtual bool has_del_eh() const { + bool has_del_eh() const override { return true; } - virtual void del_eh(ast_manager & m); + void del_eh(ast_manager & m) override; - virtual void get_antecedents(conflict_resolution & cr) {} + void get_antecedents(conflict_resolution & cr) override {} - virtual proof * mk_proof(conflict_resolution & cr); + proof * mk_proof(conflict_resolution & cr) override; - virtual char const * get_name() const { return "theory-lemma"; } + char const * get_name() const override { return "theory-lemma"; } }; }; diff --git a/src/smt/smt_model_finder.cpp b/src/smt/smt_model_finder.cpp index f443d671b..447705572 100644 --- a/src/smt/smt_model_finder.cpp +++ b/src/smt/smt_model_finder.cpp @@ -566,7 +566,7 @@ namespace smt { } } - virtual expr * eval(expr * n, bool model_completion) { + expr * eval(expr * n, bool model_completion) override { expr * r = 0; if (m_eval_cache[model_completion].find(n, r)) { return r; @@ -1134,24 +1134,24 @@ namespace smt { unsigned m_var_j; public: f_var(func_decl * f, unsigned i, unsigned j):m_f(f), m_arg_i(i), m_var_j(j) {} - virtual ~f_var() {} + ~f_var() override {} - virtual char const * get_kind() const { + char const * get_kind() const override { return "f_var"; } - virtual bool is_equal(qinfo const * qi) const { + bool is_equal(qinfo const * qi) const override { if (qi->get_kind() != get_kind()) return false; f_var const * other = static_cast(qi); return m_f == other->m_f && m_arg_i == other->m_arg_i && m_var_j == other->m_var_j; } - virtual void display(std::ostream & out) const { + void display(std::ostream & out) const override { out << "(" << m_f->get_name() << ":" << m_arg_i << " -> v!" << m_var_j << ")"; } - virtual void process_auf(quantifier * q, auf_solver & s, context * ctx) { + void process_auf(quantifier * q, auf_solver & s, context * ctx) override { node * n1 = s.get_A_f_i(m_f, m_arg_i); node * n2 = s.get_uvar(q, m_var_j); CTRACE("model_finder", n1->get_sort() != n2->get_sort(), @@ -1170,7 +1170,7 @@ namespace smt { n1->merge(n2); } - virtual void populate_inst_sets(quantifier * q, auf_solver & s, context * ctx) { + void populate_inst_sets(quantifier * q, auf_solver & s, context * ctx) override { node * A_f_i = s.get_A_f_i(m_f, m_arg_i); enode_vector::const_iterator it = ctx->begin_enodes_of(m_f); enode_vector::const_iterator end = ctx->end_enodes_of(m_f); @@ -1193,7 +1193,7 @@ namespace smt { } } - virtual void populate_inst_sets(quantifier * q, func_decl * mhead, ptr_vector & uvar_inst_sets, context * ctx) { + void populate_inst_sets(quantifier * q, func_decl * mhead, ptr_vector & uvar_inst_sets, context * ctx) override { if (m_f != mhead) return; uvar_inst_sets.reserve(m_var_j+1, 0); @@ -1222,31 +1222,31 @@ namespace smt { f_var(f, i, j), m_offset(offset, m) { } - virtual ~f_var_plus_offset() {} + ~f_var_plus_offset() override {} - virtual char const * get_kind() const { + char const * get_kind() const override { return "f_var_plus_offset"; } - virtual bool is_equal(qinfo const * qi) const { + bool is_equal(qinfo const * qi) const override { if (qi->get_kind() != get_kind()) return false; f_var_plus_offset const * other = static_cast(qi); return m_f == other->m_f && m_arg_i == other->m_arg_i && m_var_j == other->m_var_j && m_offset.get() == other->m_offset.get(); } - virtual void display(std::ostream & out) const { + void display(std::ostream & out) const override { out << "(" << m_f->get_name() << ":" << m_arg_i << " - " << mk_bounded_pp(m_offset.get(), m_offset.get_manager()) << " -> v!" << m_var_j << ")"; } - virtual void process_auf(quantifier * q, auf_solver & s, context * ctx) { + void process_auf(quantifier * q, auf_solver & s, context * ctx) override { // just create the nodes /* node * A_f_i = */ s.get_A_f_i(m_f, m_arg_i); /* node * S_j = */ s.get_uvar(q, m_var_j); } - virtual void populate_inst_sets(quantifier * q, auf_solver & s, context * ctx) { + void populate_inst_sets(quantifier * q, auf_solver & s, context * ctx) override { // S_j is not necessary equal to A_f_i. node * A_f_i = s.get_A_f_i(m_f, m_arg_i)->get_root(); node * S_j = s.get_uvar(q, m_var_j)->get_root(); @@ -1318,7 +1318,7 @@ namespace smt { } } - virtual void populate_inst_sets2(quantifier * q, auf_solver & s, context * ctx) { + void populate_inst_sets2(quantifier * q, auf_solver & s, context * ctx) override { node * A_f_i = s.get_A_f_i(m_f, m_arg_i)->get_root(); node * S_j = s.get_uvar(q, m_var_j)->get_root(); // If A_f_i == S_j, then there is no finite fixpoint, so we do nothing here. @@ -1331,7 +1331,7 @@ namespace smt { } } - virtual void populate_inst_sets(quantifier * q, func_decl * mhead, ptr_vector & uvar_inst_sets, context * ctx) { + void populate_inst_sets(quantifier * q, func_decl * mhead, ptr_vector & uvar_inst_sets, context * ctx) override { // ignored when in macro } @@ -1391,24 +1391,24 @@ namespace smt { public: select_var(ast_manager & m, app * s, unsigned i, unsigned j):m_manager(m), m_array(m), m_select(s), m_arg_i(i), m_var_j(j) {} - virtual ~select_var() {} + ~select_var() override {} - virtual char const * get_kind() const { + char const * get_kind() const override { return "select_var"; } - virtual bool is_equal(qinfo const * qi) const { + bool is_equal(qinfo const * qi) const override { if (qi->get_kind() != get_kind()) return false; select_var const * other = static_cast(qi); return m_select == other->m_select && m_arg_i == other->m_arg_i && m_var_j == other->m_var_j; } - virtual void display(std::ostream & out) const { + void display(std::ostream & out) const override { out << "(" << mk_bounded_pp(m_select, m_manager) << ":" << m_arg_i << " -> v!" << m_var_j << ")"; } - virtual void process_auf(quantifier * q, auf_solver & s, context * ctx) { + void process_auf(quantifier * q, auf_solver & s, context * ctx) override { ptr_buffer arrays; get_auf_arrays(get_array(), ctx, arrays); TRACE("select_var", @@ -1428,7 +1428,7 @@ namespace smt { } } - virtual void populate_inst_sets(quantifier * q, auf_solver & s, context * ctx) { + void populate_inst_sets(quantifier * q, auf_solver & s, context * ctx) override { ptr_buffer arrays; get_auf_arrays(get_array(), ctx, arrays); for (enode * curr : arrays) { @@ -1461,20 +1461,20 @@ namespace smt { std::swap(m_var_i, m_var_j); } - virtual ~var_pair() {} + ~var_pair() override {} - virtual bool is_equal(qinfo const * qi) const { + bool is_equal(qinfo const * qi) const override { if (qi->get_kind() != get_kind()) return false; var_pair const * other = static_cast(qi); return m_var_i == other->m_var_i && m_var_j == other->m_var_j; } - virtual void display(std::ostream & out) const { + void display(std::ostream & out) const override { out << "(" << get_kind() << ":v!" << m_var_i << ":v!" << m_var_j << ")"; } - virtual void populate_inst_sets(quantifier * q, auf_solver & s, context * ctx) { + void populate_inst_sets(quantifier * q, auf_solver & s, context * ctx) override { // do nothing } }; @@ -1482,9 +1482,9 @@ namespace smt { class x_eq_y : public var_pair { public: x_eq_y(unsigned i, unsigned j):var_pair(i, j) {} - virtual char const * get_kind() const { return "x_eq_y"; } + char const * get_kind() const override { return "x_eq_y"; } - virtual void process_auf(quantifier * q, auf_solver & s, context * ctx) { + void process_auf(quantifier * q, auf_solver & s, context * ctx) override { node * n1 = s.get_uvar(q, m_var_i); node * n2 = s.get_uvar(q, m_var_j); n1->insert_avoid(n2); @@ -1496,9 +1496,9 @@ namespace smt { class x_neq_y : public var_pair { public: x_neq_y(unsigned i, unsigned j):var_pair(i, j) {} - virtual char const * get_kind() const { return "x_neq_y"; } + char const * get_kind() const override { return "x_neq_y"; } - virtual void process_auf(quantifier * q, auf_solver & s, context * ctx) { + void process_auf(quantifier * q, auf_solver & s, context * ctx) override { node * n1 = s.get_uvar(q, m_var_i); node * n2 = s.get_uvar(q, m_var_j); n1->merge(n2); @@ -1508,9 +1508,9 @@ namespace smt { class x_leq_y : public var_pair { public: x_leq_y(unsigned i, unsigned j):var_pair(i, j) {} - virtual char const * get_kind() const { return "x_leq_y"; } + char const * get_kind() const override { return "x_leq_y"; } - virtual void process_auf(quantifier * q, auf_solver & s, context * ctx) { + void process_auf(quantifier * q, auf_solver & s, context * ctx) override { node * n1 = s.get_uvar(q, m_var_i); node * n2 = s.get_uvar(q, m_var_j); n1->merge(n2); @@ -1522,9 +1522,9 @@ namespace smt { class x_sleq_y : public x_leq_y { public: x_sleq_y(unsigned i, unsigned j):x_leq_y(i, j) {} - virtual char const * get_kind() const { return "x_sleq_y"; } + char const * get_kind() const override { return "x_sleq_y"; } - virtual void process_auf(quantifier * q, auf_solver & s, context * ctx) { + void process_auf(quantifier * q, auf_solver & s, context * ctx) override { node * n1 = s.get_uvar(q, m_var_i); node * n2 = s.get_uvar(q, m_var_j); n1->merge(n2); @@ -1540,16 +1540,16 @@ namespace smt { public: var_expr_pair(ast_manager & m, unsigned i, expr * t): m_var_i(i), m_t(t, m) {} - ~var_expr_pair() {} + ~var_expr_pair() override {} - virtual bool is_equal(qinfo const * qi) const { + bool is_equal(qinfo const * qi) const override { if (qi->get_kind() != get_kind()) return false; var_expr_pair const * other = static_cast(qi); return m_var_i == other->m_var_i && m_t.get() == other->m_t.get(); } - virtual void display(std::ostream & out) const { + void display(std::ostream & out) const override { out << "(" << get_kind() << ":v!" << m_var_i << ":" << mk_bounded_pp(m_t.get(), m_t.get_manager()) << ")"; } }; @@ -1558,14 +1558,14 @@ namespace smt { public: x_eq_t(ast_manager & m, unsigned i, expr * t): var_expr_pair(m, i, t) {} - virtual char const * get_kind() const { return "x_eq_t"; } + char const * get_kind() const override { return "x_eq_t"; } - virtual void process_auf(quantifier * q, auf_solver & s, context * ctx) { + void process_auf(quantifier * q, auf_solver & s, context * ctx) override { node * n1 = s.get_uvar(q, m_var_i); n1->insert_exception(m_t); } - virtual void populate_inst_sets(quantifier * q, auf_solver & slv, context * ctx) { + void populate_inst_sets(quantifier * q, auf_solver & slv, context * ctx) override { unsigned num_vars = q->get_num_decls(); ast_manager & m = ctx->get_manager(); sort * s = q->get_decl_sort(num_vars - m_var_i - 1); @@ -1589,14 +1589,14 @@ namespace smt { public: x_neq_t(ast_manager & m, unsigned i, expr * t): var_expr_pair(m, i, t) {} - virtual char const * get_kind() const { return "x_neq_t"; } + char const * get_kind() const override { return "x_neq_t"; } - virtual void process_auf(quantifier * q, auf_solver & s, context * ctx) { + void process_auf(quantifier * q, auf_solver & s, context * ctx) override { // make sure that S_q_i is create. s.get_uvar(q, m_var_i); } - virtual void populate_inst_sets(quantifier * q, auf_solver & s, context * ctx) { + void populate_inst_sets(quantifier * q, auf_solver & s, context * ctx) override { node * S_q_i = s.get_uvar(q, m_var_i); S_q_i->insert(m_t, 0); } @@ -1606,15 +1606,15 @@ namespace smt { public: x_gle_t(ast_manager & m, unsigned i, expr * t): var_expr_pair(m, i, t) {} - virtual char const * get_kind() const { return "x_gle_t"; } + char const * get_kind() const override { return "x_gle_t"; } - virtual void process_auf(quantifier * q, auf_solver & s, context * ctx) { + void process_auf(quantifier * q, auf_solver & s, context * ctx) override { // make sure that S_q_i is create. node * n1 = s.get_uvar(q, m_var_i); n1->set_mono_proj(); } - virtual void populate_inst_sets(quantifier * q, auf_solver & s, context * ctx) { + void populate_inst_sets(quantifier * q, auf_solver & s, context * ctx) override { node * S_q_i = s.get_uvar(q, m_var_i); S_q_i->insert(m_t, 0); } @@ -2524,7 +2524,7 @@ namespace smt { return false; } - virtual bool process(ptr_vector const & qs, ptr_vector & new_qs, ptr_vector & residue) { + bool process(ptr_vector const & qs, ptr_vector & new_qs, ptr_vector & residue) override { bool removed = false; for (quantifier* q : qs) { if (process(q, qs)) @@ -2957,7 +2957,7 @@ namespace smt { m_fs.reset(); } - virtual bool process(ptr_vector const & qs, ptr_vector & new_qs, ptr_vector & residue) { + bool process(ptr_vector const & qs, ptr_vector & new_qs, ptr_vector & residue) override { reset(); ptr_vector qcandidates; preprocess(qs, qcandidates, new_qs); @@ -2988,7 +2988,7 @@ namespace smt { m_satisfied(ev_handler(this)) { } - virtual ~hint_solver() { + ~hint_solver() override { reset(); } @@ -3115,7 +3115,7 @@ namespace smt { } } - virtual bool process(ptr_vector const & qs, ptr_vector & new_qs, ptr_vector & residue) { + bool process(ptr_vector const & qs, ptr_vector & new_qs, ptr_vector & residue) override { obj_map full_macros; func_decl_set cond_macros; obj_hashtable removed; diff --git a/src/smt/smt_model_generator.h b/src/smt/smt_model_generator.h index ee133482d..2c86ff9ce 100644 --- a/src/smt/smt_model_generator.h +++ b/src/smt/smt_model_generator.h @@ -159,16 +159,16 @@ namespace smt { app * m_value; public: expr_wrapper_proc(app * v):m_value(v) {} - virtual app * mk_value(model_generator & m, ptr_vector & values) { return m_value; } + app * mk_value(model_generator & m, ptr_vector & values) override { return m_value; } }; class fresh_value_proc : public model_value_proc { extra_fresh_value * m_value; public: fresh_value_proc(extra_fresh_value * v):m_value(v) {} - virtual void get_dependencies(buffer & result) { result.push_back(m_value); } - virtual app * mk_value(model_generator & m, ptr_vector & values) { return to_app(values[0]); } - virtual bool is_fresh() const { return true; } + void get_dependencies(buffer & result) override { result.push_back(m_value); } + app * mk_value(model_generator & m, ptr_vector & values) override { return to_app(values[0]); } + bool is_fresh() const override { return true; } }; /** diff --git a/src/smt/smt_quantifier.cpp b/src/smt/smt_quantifier.cpp index c6f83c611..108ebfaf2 100644 --- a/src/smt/smt_quantifier.cpp +++ b/src/smt/smt_quantifier.cpp @@ -415,10 +415,10 @@ namespace smt { m_active(false) { } - virtual ~default_qm_plugin() { + ~default_qm_plugin() override { } - virtual void set_manager(quantifier_manager & qm) { + void set_manager(quantifier_manager & qm) override { SASSERT(m_qm == 0); m_qm = &qm; m_context = &(qm.get_context()); @@ -434,11 +434,11 @@ namespace smt { m_model_checker->set_qm(qm); } - virtual quantifier_manager_plugin * mk_fresh() { return alloc(default_qm_plugin); } + quantifier_manager_plugin * mk_fresh() override { return alloc(default_qm_plugin); } - virtual bool model_based() const { return m_fparams->m_mbqi; } + bool model_based() const override { return m_fparams->m_mbqi; } - virtual bool mbqi_enabled(quantifier *q) const { + bool mbqi_enabled(quantifier *q) const override { if (!m_fparams->m_mbqi_id) return true; const symbol &s = q->get_qid(); size_t len = strlen(m_fparams->m_mbqi_id); @@ -450,16 +450,16 @@ namespace smt { /* Quantifier id's must begin with the prefix specified by parameter mbqi.id to be instantiated with MBQI. The default value is the empty string, so all quantifiers are instantiated. */ - virtual void add(quantifier * q) { + void add(quantifier * q) override { if (m_fparams->m_mbqi && mbqi_enabled(q)) { m_active = true; m_model_finder->register_quantifier(q); } } - virtual void del(quantifier * q) { } + void del(quantifier * q) override { } - virtual void push() { + void push() override { m_mam->push_scope(); m_lazy_mam->push_scope(); if (m_fparams->m_mbqi) { @@ -467,7 +467,7 @@ namespace smt { } } - virtual void pop(unsigned num_scopes) { + void pop(unsigned num_scopes) override { m_mam->pop_scope(num_scopes); m_lazy_mam->pop_scope(num_scopes); if (m_fparams->m_mbqi) { @@ -475,7 +475,7 @@ namespace smt { } } - virtual void init_search_eh() { + void init_search_eh() override { m_lazy_matching_idx = 0; if (m_fparams->m_mbqi) { m_model_finder->init_search_eh(); @@ -483,7 +483,7 @@ namespace smt { } } - virtual void assign_eh(quantifier * q) { + void assign_eh(quantifier * q) override { m_active = true; ast_manager& m = m_context->get_manager(); if (!m_fparams->m_ematching) { @@ -531,23 +531,23 @@ namespace smt { return m_fparams->m_ematching && !m_qm->empty(); } - virtual void add_eq_eh(enode * e1, enode * e2) { + void add_eq_eh(enode * e1, enode * e2) override { if (use_ematching()) m_mam->add_eq_eh(e1, e2); } - virtual void relevant_eh(enode * e) { + void relevant_eh(enode * e) override { if (use_ematching()) { m_mam->relevant_eh(e, false); m_lazy_mam->relevant_eh(e, true); } } - virtual bool can_propagate() const { + bool can_propagate() const override { return m_mam->has_work(); } - virtual void restart_eh() { + void restart_eh() override { if (m_fparams->m_mbqi) { m_model_finder->restart_eh(); m_model_checker->restart_eh(); @@ -555,17 +555,17 @@ namespace smt { TRACE("mam_stats", m_mam->display(tout);); } - virtual bool is_shared(enode * n) const { + bool is_shared(enode * n) const override { return m_active && (m_mam->is_shared(n) || m_lazy_mam->is_shared(n)); } - virtual void adjust_model(proto_model * m) { + void adjust_model(proto_model * m) override { if (m_fparams->m_mbqi) { m_model_finder->fix_model(m); } } - virtual void propagate() { + void propagate() override { m_mam->match(); if (!m_context->relevancy() && use_ematching()) { ptr_vector::const_iterator it = m_context->begin_enodes(); @@ -585,8 +585,8 @@ namespace smt { } } - virtual quantifier_manager::check_model_result - check_model(proto_model * m, obj_map const & root2value) { + quantifier_manager::check_model_result + check_model(proto_model * m, obj_map const & root2value) override { if (m_fparams->m_mbqi) { IF_VERBOSE(10, verbose_stream() << "(smt.mbqi)\n";); if (m_model_checker->check(m, root2value)) { @@ -599,7 +599,7 @@ namespace smt { return quantifier_manager::UNKNOWN; } - virtual final_check_status final_check_eh(bool full) { + final_check_status final_check_eh(bool full) override { if (!full) { if (m_fparams->m_qi_lazy_instantiation) return final_check_quant(); diff --git a/src/smt/smt_relevancy.cpp b/src/smt/smt_relevancy.cpp index 00457c643..7a2d4167f 100644 --- a/src/smt/smt_relevancy.cpp +++ b/src/smt/smt_relevancy.cpp @@ -52,24 +52,24 @@ namespace smt { app * m_parent; public: and_relevancy_eh(app * p):m_parent(p) {} - virtual ~and_relevancy_eh() {} - virtual void operator()(relevancy_propagator & rp); + ~and_relevancy_eh() override {} + void operator()(relevancy_propagator & rp) override; }; class or_relevancy_eh : public relevancy_eh { app * m_parent; public: or_relevancy_eh(app * p):m_parent(p) {} - virtual ~or_relevancy_eh() {} - virtual void operator()(relevancy_propagator & rp); + ~or_relevancy_eh() override {} + void operator()(relevancy_propagator & rp) override; }; class ite_relevancy_eh : public relevancy_eh { app * m_parent; public: ite_relevancy_eh(app * p):m_parent(p) {} - virtual ~ite_relevancy_eh() {} - virtual void operator()(relevancy_propagator & rp); + ~ite_relevancy_eh() override {} + void operator()(relevancy_propagator & rp) override; }; class ite_term_relevancy_eh : public relevancy_eh { @@ -78,8 +78,8 @@ namespace smt { app * m_else_eq; public: ite_term_relevancy_eh(app * p, app * then_eq, app * else_eq):m_parent(p), m_then_eq(then_eq), m_else_eq(else_eq) {} - virtual ~ite_term_relevancy_eh() {} - virtual void operator()(relevancy_propagator & rp); + ~ite_term_relevancy_eh() override {} + void operator()(relevancy_propagator & rp) override; }; relevancy_propagator::relevancy_propagator(context & ctx): @@ -154,7 +154,7 @@ namespace smt { relevancy_propagator(ctx), m_qhead(0), m_relevant_exprs(ctx.get_manager()), m_propagating(false) {} - virtual ~relevancy_propagator_imp() { + ~relevancy_propagator_imp() override { undo_trail(0); } @@ -191,7 +191,7 @@ namespace smt { m_trail.push_back(t); } - virtual void add_handler(expr * source, relevancy_eh * eh) { + void add_handler(expr * source, relevancy_eh * eh) override { if (!enabled()) return; if (is_relevant_core(source)) { @@ -204,7 +204,7 @@ namespace smt { } } - virtual void add_watch(expr * n, bool val, relevancy_eh * eh) { + void add_watch(expr * n, bool val, relevancy_eh * eh) override { if (!enabled()) return; lbool lval = m_context.find_assignment(n); @@ -224,7 +224,7 @@ namespace smt { } } - virtual void add_watch(expr * n, bool val, expr * target) { + void add_watch(expr * n, bool val, expr * target) override { if (!enabled()) return; lbool lval = m_context.find_assignment(n); @@ -244,18 +244,18 @@ namespace smt { bool is_relevant_core(expr * n) const { return m_is_relevant.contains(n); } - virtual bool is_relevant(expr * n) const { + bool is_relevant(expr * n) const override { return !enabled() || is_relevant_core(n); } - virtual void push() { + void push() override { m_scopes.push_back(scope()); scope & s = m_scopes.back(); s.m_relevant_exprs_lim = m_relevant_exprs.size(); s.m_trail_lim = m_trail.size(); } - virtual void pop(unsigned num_scopes) { + void pop(unsigned num_scopes) override { SASSERT(m_context.get_scope_level() == m_scopes.size()); unsigned lvl = m_scopes.size(); SASSERT(num_scopes <= lvl); @@ -325,7 +325,7 @@ namespace smt { \brief Mark the given expression as relevant if it is not already marked. */ - virtual void mark_as_relevant(expr * n) { + void mark_as_relevant(expr * n) override { if (!enabled()) return; if (!is_relevant_core(n)) { @@ -450,7 +450,7 @@ namespace smt { [m_qhead, m_relevant_exprs.size()) in the stack of relevant expressions. */ - virtual void propagate() { + void propagate() override { if (m_propagating) { return; } @@ -494,11 +494,11 @@ namespace smt { } } - virtual bool can_propagate() const { + bool can_propagate() const override { return m_qhead < m_relevant_exprs.size(); } - virtual void assign_eh(expr * n, bool val) { + void assign_eh(expr * n, bool val) override { if (!enabled()) return; ast_manager & m = get_manager(); @@ -516,7 +516,7 @@ namespace smt { } } - virtual void display(std::ostream & out) const { + void display(std::ostream & out) const override { if (enabled() && !m_relevant_exprs.empty()) { out << "relevant exprs:\n"; for (unsigned i = 0; i < m_relevant_exprs.size(); i++) { diff --git a/src/smt/smt_relevancy.h b/src/smt/smt_relevancy.h index 75019b110..edaa237b8 100644 --- a/src/smt/smt_relevancy.h +++ b/src/smt/smt_relevancy.h @@ -50,8 +50,8 @@ namespace smt { expr * m_target; public: simple_relevancy_eh(expr * t):m_target(t) {} - virtual ~simple_relevancy_eh() {} - virtual void operator()(relevancy_propagator & rp); + ~simple_relevancy_eh() override {} + void operator()(relevancy_propagator & rp) override; }; /** @@ -63,8 +63,8 @@ namespace smt { expr * m_target; public: pair_relevancy_eh(expr * s1, expr * s2, expr * t):m_source1(s1), m_source2(s2), m_target(t) {} - virtual ~pair_relevancy_eh() {} - virtual void operator()(relevancy_propagator & rp); + ~pair_relevancy_eh() override {} + void operator()(relevancy_propagator & rp) override; }; /** diff --git a/src/smt/smt_solver.cpp b/src/smt/smt_solver.cpp index 1f9ad3ef7..b805253d8 100644 --- a/src/smt/smt_solver.cpp +++ b/src/smt/smt_solver.cpp @@ -55,7 +55,7 @@ namespace smt { updt_params(p); } - virtual solver * translate(ast_manager & m, params_ref const & p) { + solver * translate(ast_manager & m, params_ref const & p) override { ast_translation translator(get_manager(), m); smt_solver * result = alloc(smt_solver, m, p, m_logic); @@ -68,11 +68,11 @@ namespace smt { return result; } - virtual ~smt_solver() { + ~smt_solver() override { dec_ref_values(get_manager(), m_name2assertion); } - virtual void updt_params(params_ref const & p) { + void updt_params(params_ref const & p) override { solver::updt_params(p); m_smt_params.updt_params(p); m_context.updt_params(p); @@ -82,28 +82,28 @@ namespace smt { m_core_extend_nonlocal_patterns = smth.core_extend_nonlocal_patterns(); } - virtual void collect_param_descrs(param_descrs & r) { + void collect_param_descrs(param_descrs & r) override { m_context.collect_param_descrs(r); } - virtual void collect_statistics(statistics & st) const { + void collect_statistics(statistics & st) const override { m_context.collect_statistics(st); } - virtual lbool get_consequences_core(expr_ref_vector const& assumptions, expr_ref_vector const& vars, expr_ref_vector& conseq) { + lbool get_consequences_core(expr_ref_vector const& assumptions, expr_ref_vector const& vars, expr_ref_vector& conseq) override { expr_ref_vector unfixed(m_context.m()); return m_context.get_consequences(assumptions, vars, conseq, unfixed); } - virtual lbool find_mutexes(expr_ref_vector const& vars, vector& mutexes) { + lbool find_mutexes(expr_ref_vector const& vars, vector& mutexes) override { return m_context.find_mutexes(vars, mutexes); } - virtual void assert_expr(expr * t) { + void assert_expr(expr * t) override { m_context.assert_expr(t); } - virtual void assert_expr(expr * t, expr * a) { + void assert_expr(expr * t, expr * a) override { if (m_name2assertion.contains(a)) { throw default_exception("named assertion defined twice"); } @@ -112,11 +112,11 @@ namespace smt { m_name2assertion.insert(a, t); } - virtual void push_core() { + void push_core() override { m_context.push(); } - virtual void pop_core(unsigned n) { + void pop_core(unsigned n) override { unsigned cur_sz = m_assumptions.size(); if (n > 0 && cur_sz > 0) { unsigned lvl = m_scopes.size(); @@ -135,7 +135,7 @@ namespace smt { m_context.pop(n); } - virtual lbool check_sat_core(unsigned num_assumptions, expr * const * assumptions) { + lbool check_sat_core(unsigned num_assumptions, expr * const * assumptions) override { TRACE("solver_na2as", tout << "smt_solver::check_sat_core: " << num_assumptions << "\n";); return m_context.check(num_assumptions, assumptions); } @@ -154,7 +154,7 @@ namespace smt { } }; - virtual void get_unsat_core(ptr_vector & r) { + void get_unsat_core(ptr_vector & r) override { unsigned sz = m_context.get_unsat_core_size(); for (unsigned i = 0; i < sz; i++) { r.push_back(m_context.get_unsat_core_expr(i)); @@ -177,40 +177,40 @@ namespace smt { add_nonlocal_pattern_literals_to_core(r); } - virtual void get_model(model_ref & m) { + void get_model(model_ref & m) override { m_context.get_model(m); } - virtual proof * get_proof() { + proof * get_proof() override { return m_context.get_proof(); } - virtual std::string reason_unknown() const { + std::string reason_unknown() const override { return m_context.last_failure_as_string(); } - virtual void set_reason_unknown(char const* msg) { + void set_reason_unknown(char const* msg) override { m_context.set_reason_unknown(msg); } - virtual void get_labels(svector & r) { + void get_labels(svector & r) override { buffer tmp; m_context.get_relevant_labels(0, tmp); r.append(tmp.size(), tmp.c_ptr()); } - virtual ast_manager & get_manager() const { return m_context.m(); } + ast_manager & get_manager() const override { return m_context.m(); } - virtual void set_progress_callback(progress_callback * callback) { + void set_progress_callback(progress_callback * callback) override { m_callback = callback; m_context.set_progress_callback(callback); } - virtual unsigned get_num_assertions() const { + unsigned get_num_assertions() const override { return m_context.size(); } - virtual expr * get_assertion(unsigned idx) const { + expr * get_assertion(unsigned idx) const override { SASSERT(idx < get_num_assertions()); return m_context.get_formula(idx); } @@ -368,7 +368,7 @@ solver * mk_smt_solver(ast_manager & m, params_ref const & p, symbol const & log class smt_solver_factory : public solver_factory { public: - virtual solver * operator()(ast_manager & m, params_ref const & p, bool proofs_enabled, bool models_enabled, bool unsat_core_enabled, symbol const & logic) { + solver * operator()(ast_manager & m, params_ref const & p, bool proofs_enabled, bool models_enabled, bool unsat_core_enabled, symbol const & logic) override { return mk_smt_solver(m, p, logic); } }; diff --git a/src/smt/tactic/ctx_solver_simplify_tactic.cpp b/src/smt/tactic/ctx_solver_simplify_tactic.cpp index edc4b4ff5..98de6a79b 100644 --- a/src/smt/tactic/ctx_solver_simplify_tactic.cpp +++ b/src/smt/tactic/ctx_solver_simplify_tactic.cpp @@ -43,11 +43,11 @@ public: m_fn = m.mk_func_decl(symbol(0xbeef101), i_sort, m.mk_bool_sort()); } - virtual tactic * translate(ast_manager & m) { + tactic * translate(ast_manager & m) override { return alloc(ctx_solver_simplify_tactic, m, m_params); } - virtual ~ctx_solver_simplify_tactic() { + ~ctx_solver_simplify_tactic() override { obj_map::iterator it = m_fns.begin(), end = m_fns.end(); for (; it != end; ++it) { m.dec_ref(it->m_value); @@ -55,33 +55,32 @@ public: m_fns.reset(); } - virtual void updt_params(params_ref const & p) { + void updt_params(params_ref const & p) override { m_solver.updt_params(p); } - virtual void collect_param_descrs(param_descrs & r) { + void collect_param_descrs(param_descrs & r) override { m_solver.collect_param_descrs(r); } - virtual void collect_statistics(statistics & st) const { + void collect_statistics(statistics & st) const override { st.update("solver-simplify-steps", m_num_steps); } - virtual void reset_statistics() { m_num_steps = 0; } + void reset_statistics() override { m_num_steps = 0; } - 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 { mc = 0; pc = 0; core = 0; reduce(*(in.get())); in->inc_depth(); result.push_back(in.get()); } - virtual void cleanup() { + void cleanup() override { reset_statistics(); m_solver.reset(); } diff --git a/src/smt/tactic/smt_tactic.cpp b/src/smt/tactic/smt_tactic.cpp index 57ac7b34b..af717c807 100644 --- a/src/smt/tactic/smt_tactic.cpp +++ b/src/smt/tactic/smt_tactic.cpp @@ -53,11 +53,11 @@ public: TRACE("smt_tactic", tout << "p: " << p << "\n";); } - virtual tactic * translate(ast_manager & m) { + tactic * translate(ast_manager & m) override { return alloc(smt_tactic, m_params_ref); } - virtual ~smt_tactic() { + ~smt_tactic() override { SASSERT(m_ctx == 0); } @@ -74,7 +74,7 @@ public: m_fail_if_inconclusive = p.get_bool("fail_if_inconclusive", true); } - virtual void updt_params(params_ref const & p) { + void updt_params(params_ref const & p) override { TRACE("smt_tactic", tout << "updt_params: " << p << "\n";); updt_params_core(p); fparams().updt_params(p); @@ -86,7 +86,7 @@ public: SASSERT(p.get_bool("auto_config", fparams().m_auto_config) == fparams().m_auto_config); } - virtual void collect_param_descrs(param_descrs & r) { + void collect_param_descrs(param_descrs & r) override { r.insert("candidate_models", CPK_BOOL, "(default: false) create candidate models even when quantifier or theory reasoning is incomplete."); r.insert("fail_if_inconclusive", CPK_BOOL, "(default: true) fail if found unsat (sat) for under (over) approximated goal."); smt_params_helper::collect_param_descrs(r); @@ -94,25 +94,25 @@ public: } - virtual void collect_statistics(statistics & st) const { + void collect_statistics(statistics & st) const override { if (m_ctx) m_ctx->collect_statistics(st); // ctx is still running... else st.copy(m_stats); } - virtual void cleanup() { + void cleanup() override { } - virtual void reset_statistics() { + void reset_statistics() override { m_stats.reset(); } - virtual void set_logic(symbol const & l) { + void set_logic(symbol const & l) override { m_logic = l; } - virtual void set_progress_callback(progress_callback * callback) { + void set_progress_callback(progress_callback * callback) override { m_callback = callback; } @@ -144,11 +144,11 @@ public: }; - 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 { try { IF_VERBOSE(10, verbose_stream() << "(smt.tactic start)\n";); mc = 0; pc = 0; core = 0; diff --git a/src/smt/tactic/unit_subsumption_tactic.cpp b/src/smt/tactic/unit_subsumption_tactic.cpp index 68a34cea8..3adf1cb51 100644 --- a/src/smt/tactic/unit_subsumption_tactic.cpp +++ b/src/smt/tactic/unit_subsumption_tactic.cpp @@ -37,22 +37,22 @@ struct unit_subsumption_tactic : public tactic { m_clauses(m) { } - void cleanup() {} + void cleanup() override {} - virtual void operator()(/* in */ goal_ref const & in, - /* out */ goal_ref_buffer & result, - /* out */ model_converter_ref & mc, - /* out */ proof_converter_ref & pc, - /* out */ expr_dependency_ref & core) { + void operator()(/* in */ goal_ref const & in, + /* out */ goal_ref_buffer & result, + /* out */ model_converter_ref & mc, + /* out */ proof_converter_ref & pc, + /* out */ expr_dependency_ref & core) override { reduce_core(in, result); } - virtual void updt_params(params_ref const& p) { + void updt_params(params_ref const& p) override { m_params = p; // m_context.updt_params(p); does not exist. } - virtual tactic* translate(ast_manager& m) { + tactic* translate(ast_manager& m) override { return alloc(unit_subsumption_tactic, m, m_params); } diff --git a/src/smt/theory_arith.h b/src/smt/theory_arith.h index 6794ca3ac..98bbefd42 100644 --- a/src/smt/theory_arith.h +++ b/src/smt/theory_arith.h @@ -306,16 +306,16 @@ namespace smt { public: atom(bool_var bv, theory_var v, inf_numeral const & k, atom_kind kind); atom_kind get_atom_kind() const { return static_cast(m_atom_kind); } - virtual ~atom() {} + ~atom() override {} inline inf_numeral const & get_k() const { return m_k; } bool_var get_bool_var() const { return m_bvar; } bool is_true() const { return m_is_true; } void assign_eh(bool is_true, inf_numeral const & epsilon); - virtual bool has_justification() const { return true; } - virtual void push_justification(antecedents& a, numeral const& coeff, bool proofs_enabled) { + bool has_justification() const override { return true; } + void push_justification(antecedents& a, numeral const& coeff, bool proofs_enabled) override { a.push_lit(literal(get_bool_var(), !m_is_true), coeff, proofs_enabled); } - virtual void display(theory_arith const& th, std::ostream& out) const; + void display(theory_arith const& th, std::ostream& out) const override; }; class eq_bound : public bound { @@ -328,13 +328,13 @@ namespace smt { m_rhs(rhs) { SASSERT(m_lhs->get_root() == m_rhs->get_root()); } - virtual ~eq_bound() {} - virtual bool has_justification() const { return true; } - virtual void push_justification(antecedents& a, numeral const& coeff, bool proofs_enabled) { + ~eq_bound() override {} + bool has_justification() const override { return true; } + void push_justification(antecedents& a, numeral const& coeff, bool proofs_enabled) override { SASSERT(m_lhs->get_root() == m_rhs->get_root()); a.push_eq(enode_pair(m_lhs, m_rhs), coeff, proofs_enabled); } - virtual void display(theory_arith const& th, std::ostream& out) const; + void display(theory_arith const& th, std::ostream& out) const override; }; class derived_bound : public bound { @@ -344,14 +344,14 @@ namespace smt { friend class theory_arith; public: derived_bound(theory_var v, inf_numeral const & val, bound_kind k):bound(v, val, k, false) {} - virtual ~derived_bound() {} + ~derived_bound() override {} literal_vector const& lits() const { return m_lits; } eq_vector const& eqs() const { return m_eqs; } - virtual bool has_justification() const { return true; } - virtual void push_justification(antecedents& a, numeral const& coeff, bool proofs_enabled); + bool has_justification() const override { return true; } + void push_justification(antecedents& a, numeral const& coeff, bool proofs_enabled) override; virtual void push_lit(literal l, numeral const&) { m_lits.push_back(l); } virtual void push_eq(enode_pair const& p, numeral const&) { m_eqs.push_back(p); } - virtual void display(theory_arith const& th, std::ostream& out) const; + void display(theory_arith const& th, std::ostream& out) const override; }; @@ -361,12 +361,12 @@ namespace smt { friend class theory_arith; public: justified_derived_bound(theory_var v, inf_numeral const & val, bound_kind k):derived_bound(v, val, k) {} - virtual ~justified_derived_bound() {} - virtual bool has_justification() const { return true; } - virtual void push_justification(antecedents& a, numeral const& coeff, bool proofs_enabled); - virtual void push_lit(literal l, numeral const& coeff); + ~justified_derived_bound() override {} + bool has_justification() const override { return true; } + void push_justification(antecedents& a, numeral const& coeff, bool proofs_enabled) override; + void push_lit(literal l, numeral const& coeff) override; - virtual void push_eq(enode_pair const& p, numeral const& coeff); + void push_eq(enode_pair const& p, numeral const& coeff) override; }; typedef int_hashtable > literal_idx_set; @@ -510,7 +510,7 @@ namespace smt { typedef int_hashtable var_value_table; var_value_table m_var_value_table; - virtual theory_var mk_var(enode * n); + theory_var mk_var(enode * n) override; void found_unsupported_op(app * n); void found_underspecified_op(app * n); @@ -635,24 +635,24 @@ namespace smt { struct compare_atoms { bool operator()(atom* a1, atom* a2) const { return a1->get_k() < a2->get_k(); } }; - virtual bool default_internalizer() const { return false; } - virtual bool internalize_atom(app * n, bool gate_ctx); - virtual bool internalize_term(app * term); - virtual void internalize_eq_eh(app * atom, bool_var v); - virtual void apply_sort_cnstr(enode * n, sort * s); + bool default_internalizer() const override { return false; } + bool internalize_atom(app * n, bool gate_ctx) override; + bool internalize_term(app * term) override; + void internalize_eq_eh(app * atom, bool_var v) override; + void apply_sort_cnstr(enode * n, sort * s) override; - virtual void assign_eh(bool_var v, bool is_true); - virtual void new_eq_eh(theory_var v1, theory_var v2); - virtual bool use_diseqs() const; - virtual void new_diseq_eh(theory_var v1, theory_var v2); + void assign_eh(bool_var v, bool is_true) override; + void new_eq_eh(theory_var v1, theory_var v2) override; + bool use_diseqs() const override; + void new_diseq_eh(theory_var v1, theory_var v2) override; - virtual void push_scope_eh(); - virtual void pop_scope_eh(unsigned num_scopes); + void push_scope_eh() override; + void pop_scope_eh(unsigned num_scopes) override; - virtual void relevant_eh(app * n); + void relevant_eh(app * n) override; - virtual void restart_eh(); - virtual void init_search_eh(); + void restart_eh() override; + void init_search_eh() override; /** \brief True if the assignment may be changed during final check. assume_eqs, check_int_feasibility, @@ -669,18 +669,18 @@ namespace smt { */ bool m_liberal_final_check; final_check_status final_check_core(); - virtual final_check_status final_check_eh(); + final_check_status final_check_eh() override; - virtual bool can_propagate(); - virtual void propagate(); + bool can_propagate() override; + void propagate() override; bool propagate_core(); void failed(); - virtual void flush_eh(); - virtual void reset_eh(); + void flush_eh() override; + void reset_eh() override; - virtual bool validate_eq_in_model(theory_var v1, theory_var v2, bool is_true) const; + bool validate_eq_in_model(theory_var v1, theory_var v2, bool is_true) const override; // ----------------------------------- // @@ -867,7 +867,7 @@ namespace smt { void propagate_cheap_eq(unsigned rid); void propagate_eq_to_core(theory_var x, theory_var y, antecedents& antecedents); - virtual bool is_shared(theory_var v) const; + bool is_shared(theory_var v) const override; // ----------------------------------- // @@ -909,7 +909,7 @@ namespace smt { /** \brief See comment in theory::mk_eq_atom */ - virtual app * mk_eq_atom(expr * lhs, expr * rhs) { return m_util.mk_eq(lhs, rhs); } + app * mk_eq_atom(expr * lhs, expr * rhs) override { return m_util.mk_eq(lhs, rhs); } // ----------------------------------- // @@ -1039,13 +1039,13 @@ namespace smt { // ----------------------------------- public: theory_arith(ast_manager & m, theory_arith_params & params); - virtual ~theory_arith(); + ~theory_arith() override; - virtual theory * mk_fresh(context * new_ctx); + theory * mk_fresh(context * new_ctx) override; - virtual void setup(); + void setup() override; - virtual char const * get_name() const { return "arithmetic"; } + char const * get_name() const override { return "arithmetic"; } // ----------------------------------- // @@ -1058,15 +1058,15 @@ namespace smt { void compute_epsilon(); void refine_epsilon(); - virtual void init_model(model_generator & m); - virtual model_value_proc * mk_value(enode * n, model_generator & mg); + void init_model(model_generator & m) override; + model_value_proc * mk_value(enode * n, model_generator & mg) override; // ----------------------------------- // // Model checker // // ----------------------------------- - virtual bool get_value(enode * n, expr_ref & r); + bool get_value(enode * n, expr_ref & r) override; bool get_lower(enode* n, expr_ref& r); bool get_upper(enode* n, expr_ref& r); @@ -1078,9 +1078,9 @@ namespace smt { // Optimization // // ----------------------------------- - virtual inf_eps_rational maximize(theory_var v, expr_ref& blocker, bool& has_shared); - virtual inf_eps_rational value(theory_var v); - virtual theory_var add_objective(app* term); + inf_eps_rational maximize(theory_var v, expr_ref& blocker, bool& has_shared) override; + inf_eps_rational value(theory_var v) override; + theory_var add_objective(app* term) override; expr_ref mk_ge(filter_model_converter& fm, theory_var v, inf_numeral const& val); void enable_record_conflict(expr* bound); void record_conflict(unsigned num_lits, literal const * lits, @@ -1102,8 +1102,8 @@ namespace smt { // // ----------------------------------- public: - virtual void collect_statistics(::statistics & st) const; - virtual void display(std::ostream & out) const; + void collect_statistics(::statistics & st) const override; + void display(std::ostream & out) const override; protected: void display_row(std::ostream & out, unsigned r_id, bool compact = true) const; void display_row(std::ostream & out, row const & r, bool compact = true) const; diff --git a/src/smt/theory_arith_int.h b/src/smt/theory_arith_int.h index 4f15a6156..593b9c56b 100644 --- a/src/smt/theory_arith_int.h +++ b/src/smt/theory_arith_int.h @@ -472,7 +472,7 @@ namespace smt { bounds.num_params(), bounds.params("gomory-cut")) { } // Remark: the assignment must be propagated back to arith - virtual theory_id get_from_theory() const { return null_theory_id; } + theory_id get_from_theory() const override { return null_theory_id; } }; /** diff --git a/src/smt/theory_array.h b/src/smt/theory_array.h index 3a013cf73..26d59c7bf 100644 --- a/src/smt/theory_array.h +++ b/src/smt/theory_array.h @@ -55,19 +55,19 @@ namespace smt { th_trail_stack m_trail_stack; unsigned m_final_check_idx; - virtual void init(context * ctx); - virtual theory_var mk_var(enode * n); - virtual bool internalize_atom(app * atom, bool gate_ctx); - virtual bool internalize_term(app * term); - virtual void apply_sort_cnstr(enode * n, sort * s); - virtual void new_eq_eh(theory_var v1, theory_var v2); - virtual void new_diseq_eh(theory_var v1, theory_var v2); - virtual void relevant_eh(app * n); - virtual void push_scope_eh(); - virtual void pop_scope_eh(unsigned num_scopes); - virtual final_check_status final_check_eh(); - virtual void reset_eh(); - virtual void init_search_eh() { m_final_check_idx = 0; } + void init(context * ctx) override; + theory_var mk_var(enode * n) override; + bool internalize_atom(app * atom, bool gate_ctx) override; + bool internalize_term(app * term) override; + void apply_sort_cnstr(enode * n, sort * s) override; + void new_eq_eh(theory_var v1, theory_var v2) override; + void new_diseq_eh(theory_var v1, theory_var v2) override; + void relevant_eh(app * n) override; + void push_scope_eh() override; + void pop_scope_eh(unsigned num_scopes) override; + final_check_status final_check_eh() override; + void reset_eh() override; + void init_search_eh() override { m_final_check_idx = 0; } virtual void set_prop_upward(theory_var v); virtual void set_prop_upward(enode* n); @@ -96,15 +96,15 @@ namespace smt { static void display_ids(std::ostream & out, unsigned n, enode * const * v); public: theory_array(ast_manager & m, theory_array_params & params); - virtual ~theory_array(); + ~theory_array() override; - virtual theory * mk_fresh(context * new_ctx) { return alloc(theory_array, new_ctx->get_manager(), new_ctx->get_fparams()); } + theory * mk_fresh(context * new_ctx) override { return alloc(theory_array, new_ctx->get_manager(), new_ctx->get_fparams()); } - virtual char const * get_name() const { return "array"; } + char const * get_name() const override { return "array"; } virtual void display_var(std::ostream & out, theory_var v) const; - virtual void display(std::ostream & out) const; - virtual void collect_statistics(::statistics & st) const; + void display(std::ostream & out) const override; + void collect_statistics(::statistics & st) const override; th_trail_stack & get_trail_stack() { return m_trail_stack; } virtual void merge_eh(theory_var v1, theory_var v2, theory_var, theory_var); static void after_merge_eh(theory_var r1, theory_var r2, theory_var v1, theory_var v2) {} diff --git a/src/smt/theory_array_base.cpp b/src/smt/theory_array_base.cpp index 472053fdc..0aba7c2f2 100644 --- a/src/smt/theory_array_base.cpp +++ b/src/smt/theory_array_base.cpp @@ -828,7 +828,7 @@ namespace smt { m_unspecified_else(true) { } - virtual ~array_value_proc() {} + ~array_value_proc() override {} void add_entry(unsigned num_args, enode * const * args, enode * value) { SASSERT(num_args > 0); @@ -840,11 +840,11 @@ namespace smt { m_dependencies.push_back(model_value_dependency(value)); } - virtual void get_dependencies(buffer & result) { + void get_dependencies(buffer & result) override { result.append(m_dependencies.size(), m_dependencies.c_ptr()); } - virtual app * mk_value(model_generator & mg, ptr_vector & values) { + app * mk_value(model_generator & mg, ptr_vector & values) override { // values must have size = m_num_entries * (m_dim + 1) + ((m_else || m_unspecified_else) ? 0 : 1) // an array value is a lookup table + else_value // each entry has m_dim indexes that map to a value. diff --git a/src/smt/theory_array_base.h b/src/smt/theory_array_base.h index 197ad9d2f..730c02f94 100644 --- a/src/smt/theory_array_base.h +++ b/src/smt/theory_array_base.h @@ -123,15 +123,15 @@ namespace smt { // // // -------------------------------------------------- - virtual bool is_shared(theory_var v) const; + bool is_shared(theory_var v) const override; void collect_shared_vars(sbuffer & result); unsigned mk_interface_eqs(); - virtual bool can_propagate(); - virtual void propagate(); - virtual void push_scope_eh(); - virtual void pop_scope_eh(unsigned num_scopes); - virtual void reset_eh(); + bool can_propagate() override; + void propagate() override; + void push_scope_eh() override; + void pop_scope_eh(unsigned num_scopes) override; + void reset_eh() override; void reset_queues(); // ----------------------------------- @@ -177,7 +177,7 @@ namespace smt { void set_default(theory_var v, enode* n); enode* get_default(theory_var v); - virtual void init_model(model_generator & m); + void init_model(model_generator & m) override; bool is_unspecified_default_ok() const; void collect_defaults(); void collect_selects(); @@ -185,12 +185,12 @@ namespace smt { void propagate_selects_to_store_parents(enode * r, enode_pair_vector & todo); void propagate_selects(); select_set * get_select_set(enode * n); - virtual void finalize_model(model_generator & m); - virtual model_value_proc * mk_value(enode * n, model_generator & m); + void finalize_model(model_generator & m) override; + model_value_proc * mk_value(enode * n, model_generator & m) override; public: theory_array_base(ast_manager & m); - virtual ~theory_array_base() { restore_sorts(0); } + ~theory_array_base() override { restore_sorts(0); } }; }; diff --git a/src/smt/theory_array_full.h b/src/smt/theory_array_full.h index 2cad3acbd..3216b4286 100644 --- a/src/smt/theory_array_full.h +++ b/src/smt/theory_array_full.h @@ -42,29 +42,29 @@ namespace smt { protected: //virtual final_check_status final_check_eh(); - virtual void reset_eh(); + void reset_eh() override; - virtual void set_prop_upward(theory_var v); - virtual void set_prop_upward(enode* n); - virtual void set_prop_upward(theory_var v, var_data* d); - virtual unsigned get_lambda_equiv_size(theory_var v, var_data* d); + void set_prop_upward(theory_var v) override; + void set_prop_upward(enode* n) override; + void set_prop_upward(theory_var v, var_data* d) override; + unsigned get_lambda_equiv_size(theory_var v, var_data* d) override; - virtual bool internalize_term(app * term); - virtual bool internalize_atom(app * atom, bool gate_ctx); - virtual void pop_scope_eh(unsigned num_scopes); - virtual theory_var mk_var(enode * n); - virtual void relevant_eh(app * n); + bool internalize_term(app * term) override; + bool internalize_atom(app * atom, bool gate_ctx) override; + void pop_scope_eh(unsigned num_scopes) override; + theory_var mk_var(enode * n) override; + void relevant_eh(app * n) override; void add_const(theory_var v, enode* c); void add_map(theory_var v, enode* s); void add_parent_map(theory_var v, enode* s); void add_as_array(theory_var v, enode* arr); - virtual void add_parent_select(theory_var v, enode * s); + void add_parent_select(theory_var v, enode * s) override; void add_parent_default(theory_var v); - virtual final_check_status assert_delayed_axioms(); + final_check_status assert_delayed_axioms() override; bool instantiate_default_const_axiom(enode* cnst); bool instantiate_default_store_axiom(enode* store); @@ -87,14 +87,14 @@ namespace smt { public: theory_array_full(ast_manager & m, theory_array_params & params); - virtual ~theory_array_full(); + ~theory_array_full() override; - virtual theory * mk_fresh(context * new_ctx); + theory * mk_fresh(context * new_ctx) override; - virtual void merge_eh(theory_var v1, theory_var v2, theory_var, theory_var); - virtual void display_var(std::ostream & out, theory_var v) const; - virtual void collect_statistics(::statistics & st) const; - virtual void init(context* ctx) { + void merge_eh(theory_var v1, theory_var v2, theory_var, theory_var) override; + void display_var(std::ostream & out, theory_var v) const override; + void collect_statistics(::statistics & st) const override; + void init(context* ctx) override { // the parent class is theory_array. // theory::init(ctx); theory_array::init(ctx); diff --git a/src/smt/theory_bv.cpp b/src/smt/theory_bv.cpp index ec3913415..0f5c235f3 100644 --- a/src/smt/theory_bv.cpp +++ b/src/smt/theory_bv.cpp @@ -65,7 +65,7 @@ namespace smt { bool_var m_var; public: mk_atom_trail(bool_var v):m_var(v) {} - virtual void undo(theory_bv & th) { + void undo(theory_bv & th) override { theory_bv::atom * a = th.get_bv2a(m_var); a->~atom(); th.erase_bv2a(m_var); @@ -213,7 +213,7 @@ namespace smt { theory_bv::bit_atom * m_atom; public: add_var_pos_trail(theory_bv::bit_atom * a):m_atom(a) {} - virtual void undo(theory_bv & th) { + void undo(theory_bv & th) override { SASSERT(m_atom->m_occs); m_atom->m_occs = m_atom->m_occs->m_next; } @@ -389,12 +389,12 @@ namespace smt { m_th(th), m_var1(v1), m_var2(v2) { } - virtual void get_antecedents(conflict_resolution & cr) { + void get_antecedents(conflict_resolution & cr) override { mark_bits(cr, m_th.m_bits[m_var1]); mark_bits(cr, m_th.m_bits[m_var2]); } - virtual proof * mk_proof(conflict_resolution & cr) { + proof * mk_proof(conflict_resolution & cr) override { ptr_buffer prs; context & ctx = cr.get_context(); bool visited = true; @@ -414,11 +414,11 @@ namespace smt { return m.mk_th_lemma(get_from_theory(), fact, prs.size(), prs.c_ptr()); } - virtual theory_id get_from_theory() const { + theory_id get_from_theory() const override { return m_th.get_id(); } - virtual char const * get_name() const { return "bv-fixed-eq"; } + char const * get_name() const override { return "bv-fixed-eq"; } }; @@ -1510,13 +1510,13 @@ namespace smt { bit_eq_justification(theory_id th_id, enode * v1, enode * v2, literal c, literal a): m_v1(v1), m_v2(v2), m_th_id(th_id), m_consequent(c), m_antecedent(a) {} - virtual void get_antecedents(conflict_resolution & cr) { + void get_antecedents(conflict_resolution & cr) override { cr.mark_eq(m_v1, m_v2); if (m_antecedent.var() != true_bool_var) cr.mark_literal(m_antecedent); } - virtual proof * mk_proof(conflict_resolution & cr) { + proof * mk_proof(conflict_resolution & cr) override { bool visited = true; ptr_buffer prs; proof * pr = cr.get_proof(m_v1, m_v2); @@ -1540,11 +1540,11 @@ namespace smt { return m.mk_th_lemma(get_from_theory(), fact, prs.size(), prs.c_ptr()); } - virtual theory_id get_from_theory() const { + theory_id get_from_theory() const override { return m_th_id; } - virtual char const * get_name() const { return "bv-bit-eq"; } + char const * get_name() const override { return "bv-bit-eq"; } }; inline justification * theory_bv::mk_bit_eq_justification(theory_var v1, theory_var v2, literal consequent, literal antecedent) { diff --git a/src/smt/theory_bv.h b/src/smt/theory_bv.h index c35078ace..ca3338cb7 100644 --- a/src/smt/theory_bv.h +++ b/src/smt/theory_bv.h @@ -58,16 +58,16 @@ namespace smt { struct bit_atom : public atom { var_pos_occ * m_occs; bit_atom():m_occs(0) {} - virtual ~bit_atom() {} - virtual bool is_bit() const { return true; } + ~bit_atom() override {} + bool is_bit() const override { return true; } }; struct le_atom : public atom { literal m_var; literal m_def; le_atom(literal v, literal d):m_var(v), m_def(d) {} - virtual ~le_atom() {} - virtual bool is_bit() const { return false; } + ~le_atom() override {} + bool is_bit() const override { return false; } }; /** @@ -216,21 +216,21 @@ namespace smt { void assert_bv2int_axiom(app* n); protected: - virtual void init(context * ctx); - virtual theory_var mk_var(enode * n); - virtual bool internalize_atom(app * atom, bool gate_ctx); - virtual bool internalize_term(app * term); - virtual void apply_sort_cnstr(enode * n, sort * s); - virtual void new_eq_eh(theory_var v1, theory_var v2); - virtual void new_diseq_eh(theory_var v1, theory_var v2); + void init(context * ctx) override; + theory_var mk_var(enode * n) override; + bool internalize_atom(app * atom, bool gate_ctx) override; + bool internalize_term(app * term) override; + void apply_sort_cnstr(enode * n, sort * s) override; + void new_eq_eh(theory_var v1, theory_var v2) override; + void new_diseq_eh(theory_var v1, theory_var v2) override; virtual void expand_diseq(theory_var v1, theory_var v2); - virtual void assign_eh(bool_var v, bool is_true); - virtual void relevant_eh(app * n); - virtual void push_scope_eh(); - virtual void pop_scope_eh(unsigned num_scopes); - virtual final_check_status final_check_eh(); - virtual void reset_eh(); - virtual bool include_func_interp(func_decl* f); + void assign_eh(bool_var v, bool is_true) override; + void relevant_eh(app * n) override; + void push_scope_eh() override; + void pop_scope_eh(unsigned num_scopes) override; + final_check_status final_check_eh() override; + void reset_eh() override; + bool include_func_interp(func_decl* f) override; svector m_merge_aux[2]; //!< auxiliary vector used in merge_zero_one_bits bool merge_zero_one_bits(theory_var r1, theory_var r2); @@ -240,16 +240,16 @@ namespace smt { // // ----------------------------------- bv_factory * m_factory; - virtual void init_model(model_generator & m); - virtual model_value_proc * mk_value(enode * n, model_generator & mg); + void init_model(model_generator & m) override; + model_value_proc * mk_value(enode * n, model_generator & mg) override; public: theory_bv(ast_manager & m, theory_bv_params const & params, bit_blaster_params const & bb_params); - virtual ~theory_bv(); + ~theory_bv() override; - virtual theory * mk_fresh(context * new_ctx); + theory * mk_fresh(context * new_ctx) override; - virtual char const * get_name() const { return "bit-vector"; } + char const * get_name() const override { return "bit-vector"; } th_trail_stack & get_trail_stack() { return m_trail_stack; } void merge_eh(theory_var, theory_var, theory_var v1, theory_var v2); @@ -259,8 +259,8 @@ namespace smt { void display_var(std::ostream & out, theory_var v) const; void display_bit_atom(std::ostream & out, bool_var v, bit_atom const * a) const; void display_atoms(std::ostream & out) const; - virtual void display(std::ostream & out) const; - virtual void collect_statistics(::statistics & st) const; + void display(std::ostream & out) const override; + void collect_statistics(::statistics & st) const override; bool get_fixed_value(app* x, numeral & result) const; diff --git a/src/smt/theory_datatype.cpp b/src/smt/theory_datatype.cpp index bbed6840d..f9422ee8a 100644 --- a/src/smt/theory_datatype.cpp +++ b/src/smt/theory_datatype.cpp @@ -33,7 +33,7 @@ namespace smt { ext_theory_eq_propagation_justification(fid, r, 1, &antecedent, 0, 0, lhs, rhs) { } // Remark: the assignment must be propagated back to the datatype theory. - virtual theory_id get_from_theory() const { return null_theory_id; } + theory_id get_from_theory() const override { return null_theory_id; } }; @@ -551,11 +551,11 @@ namespace smt { public: datatype_value_proc(func_decl * d):m_constructor(d) {} void add_dependency(enode * n) { m_dependencies.push_back(model_value_dependency(n)); } - virtual ~datatype_value_proc() {} - virtual void get_dependencies(buffer & result) { + ~datatype_value_proc() override {} + void get_dependencies(buffer & result) override { result.append(m_dependencies.size(), m_dependencies.c_ptr()); } - virtual app * mk_value(model_generator & mg, ptr_vector & values) { + app * mk_value(model_generator & mg, ptr_vector & values) override { SASSERT(values.size() == m_dependencies.size()); return mg.get_manager().mk_app(m_constructor, values.size(), values.c_ptr()); } diff --git a/src/smt/theory_datatype.h b/src/smt/theory_datatype.h index 20fa371fa..3329c71cb 100644 --- a/src/smt/theory_datatype.h +++ b/src/smt/theory_datatype.h @@ -84,35 +84,35 @@ namespace smt { void display_var(std::ostream & out, theory_var v) const; protected: - virtual theory_var mk_var(enode * n); - virtual bool internalize_atom(app * atom, bool gate_ctx); - virtual bool internalize_term(app * term); - virtual void apply_sort_cnstr(enode * n, sort * s); - virtual void new_eq_eh(theory_var v1, theory_var v2); - virtual bool use_diseqs() const; - virtual void new_diseq_eh(theory_var v1, theory_var v2); - virtual void assign_eh(bool_var v, bool is_true); - virtual void relevant_eh(app * n); - virtual void push_scope_eh(); - virtual void pop_scope_eh(unsigned num_scopes); - virtual final_check_status final_check_eh(); - virtual void reset_eh(); - virtual void restart_eh() { m_util.reset(); } - virtual bool is_shared(theory_var v) const; + theory_var mk_var(enode * n) override; + bool internalize_atom(app * atom, bool gate_ctx) override; + bool internalize_term(app * term) override; + void apply_sort_cnstr(enode * n, sort * s) override; + void new_eq_eh(theory_var v1, theory_var v2) override; + bool use_diseqs() const override; + void new_diseq_eh(theory_var v1, theory_var v2) override; + void assign_eh(bool_var v, bool is_true) override; + void relevant_eh(app * n) override; + void push_scope_eh() override; + void pop_scope_eh(unsigned num_scopes) override; + final_check_status final_check_eh() override; + void reset_eh() override; + void restart_eh() override { m_util.reset(); } + bool is_shared(theory_var v) const override; public: theory_datatype(ast_manager & m, theory_datatype_params & p); - virtual ~theory_datatype(); - virtual theory * mk_fresh(context * new_ctx); - virtual void display(std::ostream & out) const; - virtual void collect_statistics(::statistics & st) const; - virtual void init_model(model_generator & m); - virtual model_value_proc * mk_value(enode * n, model_generator & m); + ~theory_datatype() override; + theory * mk_fresh(context * new_ctx) override; + void display(std::ostream & out) const override; + void collect_statistics(::statistics & st) const override; + void init_model(model_generator & m) override; + model_value_proc * mk_value(enode * n, model_generator & m) override; th_trail_stack & get_trail_stack() { return m_trail_stack; } virtual void merge_eh(theory_var v1, theory_var v2, theory_var, theory_var); static void after_merge_eh(theory_var r1, theory_var r2, theory_var v1, theory_var v2) {} void unmerge_eh(theory_var v1, theory_var v2); - virtual char const * get_name() const { return "datatype"; } - virtual bool include_func_interp(func_decl* f); + char const * get_name() const override { return "datatype"; } + bool include_func_interp(func_decl* f) override; }; diff --git a/src/smt/theory_dense_diff_logic.h b/src/smt/theory_dense_diff_logic.h index 980830447..dbf6a13a9 100644 --- a/src/smt/theory_dense_diff_logic.h +++ b/src/smt/theory_dense_diff_logic.h @@ -182,7 +182,7 @@ namespace smt { return false; } app * mk_zero_for(expr * n); - theory_var mk_var(enode * n); + theory_var mk_var(enode * n) override; theory_var internalize_term_core(app * n); void found_non_diff_logic_expr(expr * n); bool is_connected(theory_var source, theory_var target) const { return m_matrix[source][target].m_edge_id != null_edge_id; } @@ -214,38 +214,38 @@ namespace smt { // Internalization // // ----------------------------------- - virtual bool internalize_atom(app * n, bool gate_ctx); - virtual bool internalize_term(app * term); - virtual void internalize_eq_eh(app * atom, bool_var v); - virtual void apply_sort_cnstr(enode * n, sort * s); + bool internalize_atom(app * n, bool gate_ctx) override; + bool internalize_term(app * term) override; + void internalize_eq_eh(app * atom, bool_var v) override; + void apply_sort_cnstr(enode * n, sort * s) override; - virtual void assign_eh(bool_var v, bool is_true); - virtual void new_eq_eh(theory_var v1, theory_var v2); - virtual bool use_diseqs() const; - virtual void new_diseq_eh(theory_var v1, theory_var v2); + void assign_eh(bool_var v, bool is_true) override; + void new_eq_eh(theory_var v1, theory_var v2) override; + bool use_diseqs() const override; + void new_diseq_eh(theory_var v1, theory_var v2) override; - virtual void conflict_resolution_eh(app * atom, bool_var v); + void conflict_resolution_eh(app * atom, bool_var v) override; - virtual void push_scope_eh(); - virtual void pop_scope_eh(unsigned num_scopes); + void push_scope_eh() override; + void pop_scope_eh(unsigned num_scopes) override; - virtual void restart_eh(); - virtual void init_search_eh(); - virtual final_check_status final_check_eh(); + void restart_eh() override; + void init_search_eh() override; + final_check_status final_check_eh() override; - virtual bool can_propagate(); - virtual void propagate(); + bool can_propagate() override; + void propagate() override; - virtual void flush_eh(); - virtual void reset_eh(); + void flush_eh() override; + void reset_eh() override; bool dump_lemmas() const { return m_params.m_arith_dump_lemmas; } - virtual bool validate_eq_in_model(theory_var v1, theory_var v2, bool is_true) const; + bool validate_eq_in_model(theory_var v1, theory_var v2, bool is_true) const override; - virtual void display(std::ostream & out) const; + void display(std::ostream & out) const override; virtual void display_atom(std::ostream & out, atom * a) const; - virtual void collect_statistics(::statistics & st) const; + void collect_statistics(::statistics & st) const override; // ----------------------------------- // @@ -258,8 +258,8 @@ namespace smt { void compute_epsilon(); void fix_zero(); - virtual void init_model(model_generator & m); - virtual model_value_proc * mk_value(enode * n, model_generator & mg); + void init_model(model_generator & m) override; + model_value_proc * mk_value(enode * n, model_generator & mg) override; // ----------------------------------- // @@ -267,9 +267,9 @@ namespace smt { // // ----------------------------------- - virtual inf_eps_rational maximize(theory_var v, expr_ref& blocker, bool& has_shared); - virtual inf_eps_rational value(theory_var v); - virtual theory_var add_objective(app* term); + inf_eps_rational maximize(theory_var v, expr_ref& blocker, bool& has_shared) override; + inf_eps_rational value(theory_var v) override; + theory_var add_objective(app* term) override; virtual expr_ref mk_gt(theory_var v, inf_eps const& val); expr_ref mk_ge(filter_model_converter& fm, theory_var v, inf_eps const& val); @@ -280,16 +280,16 @@ namespace smt { // ----------------------------------- public: theory_dense_diff_logic(ast_manager & m, theory_arith_params & p); - virtual ~theory_dense_diff_logic() { reset_eh(); } + ~theory_dense_diff_logic() override { reset_eh(); } - virtual theory * mk_fresh(context * new_ctx); + theory * mk_fresh(context * new_ctx) override; - virtual char const * get_name() const { return "difference-logic"; } + char const * get_name() const override { return "difference-logic"; } /** \brief See comment in theory::mk_eq_atom */ - virtual app * mk_eq_atom(expr * lhs, expr * rhs) { return m_autil.mk_eq(lhs, rhs); } + app * mk_eq_atom(expr * lhs, expr * rhs) override { return m_autil.mk_eq(lhs, rhs); } }; typedef theory_dense_diff_logic theory_dense_mi; diff --git a/src/smt/theory_diff_logic.h b/src/smt/theory_diff_logic.h index 1ad239e58..ce0814f10 100644 --- a/src/smt/theory_diff_logic.h +++ b/src/smt/theory_diff_logic.h @@ -208,7 +208,7 @@ namespace smt { void new_edge(dl_var src, dl_var dst, unsigned num_edges, edge_id const* edges); // Create a new theory variable. - virtual theory_var mk_var(enode* n); + theory_var mk_var(enode* n) override; virtual theory_var mk_var(app* n); @@ -240,79 +240,79 @@ namespace smt { m_num_simplex_edges(0) { } - virtual ~theory_diff_logic() { + ~theory_diff_logic() override { reset_eh(); } - virtual theory * mk_fresh(context * new_ctx); + theory * mk_fresh(context * new_ctx) override; - virtual char const * get_name() const { return "difference-logic"; } + char const * get_name() const override { return "difference-logic"; } /** \brief See comment in theory::mk_eq_atom */ - virtual app * mk_eq_atom(expr * lhs, expr * rhs) { return m_util.mk_eq(lhs, rhs); } + app * mk_eq_atom(expr * lhs, expr * rhs) override { return m_util.mk_eq(lhs, rhs); } - virtual void init(context * ctx); + void init(context * ctx) override; - virtual bool internalize_atom(app * atom, bool gate_ctx); + bool internalize_atom(app * atom, bool gate_ctx) override; - virtual bool internalize_term(app * term); + bool internalize_term(app * term) override; - virtual void internalize_eq_eh(app * atom, bool_var v); + void internalize_eq_eh(app * atom, bool_var v) override; - virtual void assign_eh(bool_var v, bool is_true); + void assign_eh(bool_var v, bool is_true) override; - virtual void new_eq_eh(theory_var v1, theory_var v2); + void new_eq_eh(theory_var v1, theory_var v2) override; - virtual bool use_diseqs() const { return true; } + bool use_diseqs() const override { return true; } - virtual void new_diseq_eh(theory_var v1, theory_var v2); + void new_diseq_eh(theory_var v1, theory_var v2) override; - virtual void push_scope_eh(); + void push_scope_eh() override; - virtual void pop_scope_eh(unsigned num_scopes); + void pop_scope_eh(unsigned num_scopes) override; - virtual void restart_eh() { + void restart_eh() override { m_arith_eq_adapter.restart_eh(); } - virtual void relevant_eh(app* e) {} + void relevant_eh(app* e) override {} - virtual void init_search_eh() { + void init_search_eh() override { m_arith_eq_adapter.init_search_eh(); } - virtual final_check_status final_check_eh(); + final_check_status final_check_eh() override; - virtual bool is_shared(theory_var v) const { + bool is_shared(theory_var v) const override { return false; } - virtual bool can_propagate() { + bool can_propagate() override { return m_asserted_qhead != m_asserted_atoms.size(); } - virtual void propagate(); + void propagate() override; - virtual justification * why_is_diseq(theory_var v1, theory_var v2) { + justification * why_is_diseq(theory_var v1, theory_var v2) override { NOT_IMPLEMENTED_YET(); return 0; } // virtual void flush_eh(); - virtual void reset_eh(); + void reset_eh() override; - virtual void init_model(model_generator & m); + void init_model(model_generator & m) override; - virtual model_value_proc * mk_value(enode * n, model_generator & mg); + model_value_proc * mk_value(enode * n, model_generator & mg) override; - virtual bool validate_eq_in_model(theory_var v1, theory_var v2, bool is_true) const; + bool validate_eq_in_model(theory_var v1, theory_var v2, bool is_true) const override; - virtual void display(std::ostream & out) const; + void display(std::ostream & out) const override; - virtual void collect_statistics(::statistics & st) const; + void collect_statistics(::statistics & st) const override; // ----------------------------------- @@ -321,9 +321,9 @@ namespace smt { // // ----------------------------------- - virtual inf_eps maximize(theory_var v, expr_ref& blocker, bool& has_shared); - virtual inf_eps value(theory_var v); - virtual theory_var add_objective(app* term); + inf_eps maximize(theory_var v, expr_ref& blocker, bool& has_shared) override; + inf_eps value(theory_var v) override; + theory_var add_objective(app* term) override; expr_ref mk_ge(filter_model_converter& fm, theory_var v, inf_eps const& val); bool internalize_objective(expr * n, rational const& m, rational& r, objective_term & objective); diff --git a/src/smt/theory_dl.cpp b/src/smt/theory_dl.cpp index ea02121d9..1e9df2973 100644 --- a/src/smt/theory_dl.cpp +++ b/src/smt/theory_dl.cpp @@ -51,7 +51,7 @@ namespace smt { m_util(u) {} - virtual app * mk_value_core(unsigned const & val, sort * s) { + app * mk_value_core(unsigned const & val, sort * s) override { return m_util.mk_numeral(val, s); } }; @@ -74,9 +74,9 @@ namespace smt { dl_value_proc(theory_dl& th, smt::enode* n) : m_th(th), m_node(n) {} - virtual void get_dependencies(buffer & result) {} + void get_dependencies(buffer & result) override {} - virtual app * mk_value(smt::model_generator & mg, ptr_vector & ) { + app * mk_value(smt::model_generator & mg, ptr_vector & ) override { smt::context& ctx = m_th.get_context(); app* result = 0; expr* n = m_node->get_owner(); @@ -111,9 +111,9 @@ namespace smt { } - virtual char const * get_name() const { return "datalog"; } + char const * get_name() const override { return "datalog"; } - virtual bool internalize_atom(app * atom, bool gate_ctx) { + bool internalize_atom(app * atom, bool gate_ctx) override { TRACE("theory_dl", tout << mk_pp(atom, m()) << "\n";); context& ctx = get_context(); if (ctx.b_internalized(atom)) { @@ -136,7 +136,7 @@ namespace smt { return false; } - virtual bool internalize_term(app * term) { + bool internalize_term(app * term) override { TRACE("theory_dl", tout << mk_pp(term, m()) << "\n";); if (u().is_finite_sort(term)) { return mk_rep(term); @@ -146,27 +146,27 @@ namespace smt { } } - virtual void new_eq_eh(theory_var v1, theory_var v2) { + void new_eq_eh(theory_var v1, theory_var v2) override { } - virtual void new_diseq_eh(theory_var v1, theory_var v2) { + void new_diseq_eh(theory_var v1, theory_var v2) override { } - virtual theory * mk_fresh(context * new_ctx) { + theory * mk_fresh(context * new_ctx) override { return alloc(theory_dl, new_ctx->get_manager()); } - virtual void init_model(smt::model_generator & m) { + void init_model(smt::model_generator & m) override { m.register_factory(alloc(dl_factory, m_util, m.get_model())); } - virtual smt::model_value_proc * mk_value(smt::enode * n, smt::model_generator&) { + smt::model_value_proc * mk_value(smt::enode * n, smt::model_generator&) override { return alloc(dl_value_proc, *this, n); } - virtual void apply_sort_cnstr(enode * n, sort * s) { + void apply_sort_cnstr(enode * n, sort * s) override { app* term = n->get_owner(); if (u().is_finite_sort(term)) { mk_rep(term); @@ -174,7 +174,7 @@ namespace smt { } - virtual void relevant_eh(app * n) { + void relevant_eh(app * n) override { if (u().is_finite_sort(n)) { sort* s = m().get_sort(n); func_decl* r, *v; @@ -194,7 +194,7 @@ namespace smt { } } - virtual void display(std::ostream & out) const { + void display(std::ostream & out) const override { } diff --git a/src/smt/theory_dummy.h b/src/smt/theory_dummy.h index b20d86270..c58695aac 100644 --- a/src/smt/theory_dummy.h +++ b/src/smt/theory_dummy.h @@ -33,25 +33,25 @@ namespace smt { void found_theory_expr(); protected: - virtual bool internalize_atom(app * atom, bool gate_ctx); - virtual bool internalize_term(app * term); - virtual void new_eq_eh(theory_var v1, theory_var v2); - virtual bool use_diseqs() const; - virtual void new_diseq_eh(theory_var v1, theory_var v2); - virtual void reset_eh(); - virtual final_check_status final_check_eh(); - virtual bool build_models() const { + bool internalize_atom(app * atom, bool gate_ctx) override; + bool internalize_term(app * term) override; + void new_eq_eh(theory_var v1, theory_var v2) override; + bool use_diseqs() const override; + void new_diseq_eh(theory_var v1, theory_var v2) override; + void reset_eh() override; + final_check_status final_check_eh() override; + bool build_models() const override { return false; } - virtual void display(std::ostream& out) const {} + void display(std::ostream& out) const override {} public: theory_dummy(family_id fid, char const * name); - virtual ~theory_dummy() {} + ~theory_dummy() override {} - virtual theory * mk_fresh(context * new_ctx) { return alloc(theory_dummy, get_family_id(), m_name); } + theory * mk_fresh(context * new_ctx) override { return alloc(theory_dummy, get_family_id(), m_name); } - virtual char const * get_name() const; + char const * get_name() const override; }; }; diff --git a/src/smt/theory_fpa.cpp b/src/smt/theory_fpa.cpp index cc9b0017d..36ee5c15a 100644 --- a/src/smt/theory_fpa.cpp +++ b/src/smt/theory_fpa.cpp @@ -32,8 +32,8 @@ namespace smt { public: fpa2bv_conversion_trail_elem(ast_manager & m, obj_map & map, expr * e) : m(m), m_map(map), key(e, m) { } - virtual ~fpa2bv_conversion_trail_elem() { } - virtual void undo(theory_fpa & th) { + ~fpa2bv_conversion_trail_elem() override { } + void undo(theory_fpa & th) override { expr * val = m_map.find(key); m_map.remove(key); m.dec_ref(key); diff --git a/src/smt/theory_fpa.h b/src/smt/theory_fpa.h index 9e9801ee0..8cd01d2e9 100644 --- a/src/smt/theory_fpa.h +++ b/src/smt/theory_fpa.h @@ -43,16 +43,16 @@ namespace smt { value_factory(m, fid), m_util(m) {} - virtual ~fpa_value_factory() {} + ~fpa_value_factory() override {} - virtual expr * get_some_value(sort * s) { + expr * get_some_value(sort * s) override { mpf_manager & mpfm = m_util.fm(); scoped_mpf q(mpfm); mpfm.set(q, m_util.get_ebits(s), m_util.get_sbits(s), 0); return m_util.mk_value(q); } - virtual bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2) { + bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2) override { mpf_manager & mpfm = m_util.fm(); scoped_mpf q(mpfm); mpfm.set(q, m_util.get_ebits(s), m_util.get_sbits(s), 0); @@ -62,8 +62,8 @@ namespace smt { return true; } - virtual expr * get_fresh_value(sort * s) { NOT_IMPLEMENTED_YET(); } - virtual void register_value(expr * n) { /* Ignore */ } + expr * get_fresh_value(sort * s) override { NOT_IMPLEMENTED_YET(); } + void register_value(expr * n) override { /* Ignore */ } app * mk_value(mpf const & x) { return m_util.mk_value(x); @@ -81,8 +81,8 @@ namespace smt { fpa2bv_converter(m), m_th(*th) {} virtual ~fpa2bv_converter_wrapped() {} - virtual void mk_const(func_decl * f, expr_ref & result); - virtual void mk_rm_const(func_decl * f, expr_ref & result); + void mk_const(func_decl * f, expr_ref & result) override; + void mk_rm_const(func_decl * f, expr_ref & result) override; }; class fpa_value_proc : public model_value_proc { @@ -100,15 +100,15 @@ namespace smt { m_th(*th), m(th->get_manager()), m_fu(th->m_fpa_util), m_bu(th->m_bv_util), m_ebits(ebits), m_sbits(sbits) {} - virtual ~fpa_value_proc() {} + ~fpa_value_proc() override {} void add_dependency(enode * e) { m_deps.push_back(model_value_dependency(e)); } - virtual void get_dependencies(buffer & result) { + void get_dependencies(buffer & result) override { result.append(m_deps); } - virtual app * mk_value(model_generator & mg, ptr_vector & values); + app * mk_value(model_generator & mg, ptr_vector & values) override; }; class fpa_rm_value_proc : public model_value_proc { @@ -124,12 +124,12 @@ namespace smt { void add_dependency(enode * e) { m_deps.push_back(model_value_dependency(e)); } - virtual void get_dependencies(buffer & result) { + void get_dependencies(buffer & result) override { result.append(m_deps); } - virtual ~fpa_rm_value_proc() {} - virtual app * mk_value(model_generator & mg, ptr_vector & values); + ~fpa_rm_value_proc() override {} + app * mk_value(model_generator & mg, ptr_vector & values) override; }; protected: @@ -145,32 +145,32 @@ namespace smt { bool m_is_initialized; obj_hashtable m_is_added_to_model; - virtual final_check_status final_check_eh(); - virtual bool internalize_atom(app * atom, bool gate_ctx); - virtual bool internalize_term(app * term); - virtual void apply_sort_cnstr(enode * n, sort * s); - virtual void new_eq_eh(theory_var, theory_var); - virtual void new_diseq_eh(theory_var, theory_var); - virtual void push_scope_eh(); - virtual void pop_scope_eh(unsigned num_scopes); - virtual void reset_eh(); - virtual theory* mk_fresh(context* new_ctx); - virtual char const * get_name() const { return "fpa"; } + final_check_status final_check_eh() override; + bool internalize_atom(app * atom, bool gate_ctx) override; + bool internalize_term(app * term) override; + void apply_sort_cnstr(enode * n, sort * s) override; + void new_eq_eh(theory_var, theory_var) override; + void new_diseq_eh(theory_var, theory_var) override; + void push_scope_eh() override; + void pop_scope_eh(unsigned num_scopes) override; + void reset_eh() override; + theory* mk_fresh(context* new_ctx) override; + char const * get_name() const override { return "fpa"; } - virtual model_value_proc * mk_value(enode * n, model_generator & mg); + model_value_proc * mk_value(enode * n, model_generator & mg) override; - void assign_eh(bool_var v, bool is_true); - virtual void relevant_eh(app * n); - virtual void init_model(model_generator & m); - virtual void finalize_model(model_generator & mg); + void assign_eh(bool_var v, bool is_true) override; + void relevant_eh(app * n) override; + void init_model(model_generator & m) override; + void finalize_model(model_generator & mg) override; public: theory_fpa(ast_manager & m); - virtual ~theory_fpa(); + ~theory_fpa() override; - virtual void init(context * ctx); + void init(context * ctx) override; - virtual void display(std::ostream & out) const; + void display(std::ostream & out) const override; protected: expr_ref mk_side_conditions(); diff --git a/src/smt/theory_lra.cpp b/src/smt/theory_lra.cpp index 21b66d3a0..d369ddefa 100644 --- a/src/smt/theory_lra.cpp +++ b/src/smt/theory_lra.cpp @@ -137,7 +137,7 @@ namespace smt { imp& m_imp; public: resource_limit(imp& i): m_imp(i) { } - virtual bool get_cancel_flag() { return m_imp.m.canceled(); } + bool get_cancel_flag() override { return m_imp.m.canceled(); } }; @@ -1358,11 +1358,11 @@ namespace smt { imp & m_imp; local_bound_propagator(imp& i) : lp_bound_propagator(*i.m_solver), m_imp(i) {} - bool bound_is_interesting(unsigned j, lp::lconstraint_kind kind, const rational & v) { + bool bound_is_interesting(unsigned j, lp::lconstraint_kind kind, const rational & v) override { return m_imp.bound_is_interesting(j, kind, v); } - virtual void consume(rational const& v, unsigned j) { + void consume(rational const& v, unsigned j) override { m_imp.set_evidence(j); } }; diff --git a/src/smt/theory_lra.h b/src/smt/theory_lra.h index 774ec15ad..f3ef77495 100644 --- a/src/smt/theory_lra.h +++ b/src/smt/theory_lra.h @@ -29,66 +29,66 @@ namespace smt { public: theory_lra(ast_manager& m, theory_arith_params& ap); - virtual ~theory_lra(); - virtual theory* mk_fresh(context* new_ctx); - virtual char const* get_name() const { return "lra"; } + ~theory_lra() override; + theory* mk_fresh(context* new_ctx) override; + char const* get_name() const override { return "lra"; } - virtual void init(context * ctx); + void init(context * ctx) override; - virtual bool internalize_atom(app * atom, bool gate_ctx); + bool internalize_atom(app * atom, bool gate_ctx) override; - virtual bool internalize_term(app * term); + bool internalize_term(app * term) override; - virtual void internalize_eq_eh(app * atom, bool_var v); + void internalize_eq_eh(app * atom, bool_var v) override; - virtual void assign_eh(bool_var v, bool is_true); + void assign_eh(bool_var v, bool is_true) override; - virtual void new_eq_eh(theory_var v1, theory_var v2); + void new_eq_eh(theory_var v1, theory_var v2) override; - virtual bool use_diseqs() const; + bool use_diseqs() const override; - virtual void new_diseq_eh(theory_var v1, theory_var v2); + void new_diseq_eh(theory_var v1, theory_var v2) override; - virtual void push_scope_eh(); + void push_scope_eh() override; - virtual void pop_scope_eh(unsigned num_scopes); + void pop_scope_eh(unsigned num_scopes) override; - virtual void restart_eh(); + void restart_eh() override; - virtual void relevant_eh(app* e); + void relevant_eh(app* e) override; - virtual void init_search_eh(); + void init_search_eh() override; - virtual final_check_status final_check_eh(); + final_check_status final_check_eh() override; - virtual bool is_shared(theory_var v) const; + bool is_shared(theory_var v) const override; - virtual bool can_propagate(); + bool can_propagate() override; - virtual void propagate(); + void propagate() override; - virtual justification * why_is_diseq(theory_var v1, theory_var v2); + justification * why_is_diseq(theory_var v1, theory_var v2) override; // virtual void flush_eh(); - virtual void reset_eh(); + void reset_eh() override; - virtual void init_model(model_generator & m); + void init_model(model_generator & m) override; - virtual model_value_proc * mk_value(enode * n, model_generator & mg); + model_value_proc * mk_value(enode * n, model_generator & mg) override; - virtual bool get_value(enode* n, expr_ref& r); + bool get_value(enode* n, expr_ref& r) override; - virtual bool validate_eq_in_model(theory_var v1, theory_var v2, bool is_true) const; + bool validate_eq_in_model(theory_var v1, theory_var v2, bool is_true) const override; - virtual void display(std::ostream & out) const; + void display(std::ostream & out) const override; - virtual void collect_statistics(::statistics & st) const; + void collect_statistics(::statistics & st) const override; // optimization - virtual inf_eps value(theory_var); - virtual inf_eps maximize(theory_var v, expr_ref& blocker, bool& has_shared); - virtual theory_var add_objective(app* term); + inf_eps value(theory_var) override; + inf_eps maximize(theory_var v, expr_ref& blocker, bool& has_shared) override; + theory_var add_objective(app* term) override; virtual expr_ref mk_ge(filter_model_converter& fm, theory_var v, inf_rational const& val); diff --git a/src/smt/theory_pb.cpp b/src/smt/theory_pb.cpp index 9d2059f55..cc9b6b9b1 100644 --- a/src/smt/theory_pb.cpp +++ b/src/smt/theory_pb.cpp @@ -254,7 +254,7 @@ namespace smt { unsigned v; public: remove_var(theory_pb& pb, unsigned v): pb(pb), v(v) {} - virtual void undo(context& ctx) { + void undo(context& ctx) override { pb.m_vars.remove(v); pb.m_simplex.unset_lower(v); pb.m_simplex.unset_upper(v); @@ -282,7 +282,7 @@ namespace smt { m_last_bound_valid(last_bound_valid), m_last_explain(last_explain) {} - virtual void undo(context& ctx) { + void undo(context& ctx) override { if (m_is_lower) { if (m_last_bound_valid) { pb.m_simplex.set_lower(m_v, m_last_bound); @@ -889,7 +889,7 @@ namespace smt { ineq& c; public: rewatch_vars(theory_pb& p, ineq& c): pb(p), c(c) {} - virtual void undo(context& ctx) { + void undo(context& ctx) override { for (unsigned i = 0; i < c.size(); ++i) { pb.watch_var(c.lit(i).var(), &c); } @@ -900,7 +900,7 @@ namespace smt { ineq& c; public: negate_ineq(ineq& c): c(c) {} - virtual void undo(context& ctx) { + void undo(context& ctx) override { c.negate(); } }; @@ -1357,7 +1357,7 @@ namespace smt { public: unwatch_ge(theory_pb& p, ineq& c): pb(p), c(c) {} - virtual void undo(context& ctx) { + void undo(context& ctx) override { for (unsigned i = 0; i < c.watch_size(); ++i) { pb.unwatch_literal(c.lit(i), &c); } @@ -2008,11 +2008,11 @@ namespace smt { m_dependencies.push_back(model_value_dependency(n)); } - virtual void get_dependencies(buffer & result) { + void get_dependencies(buffer & result) override { result.append(m_dependencies.size(), m_dependencies.c_ptr()); } - virtual app * mk_value(model_generator & mg, ptr_vector & values) { + app * mk_value(model_generator & mg, ptr_vector & values) override { ast_manager& m = mg.get_manager(); SASSERT(values.size() == m_dependencies.size()); SASSERT(values.size() == m_app->get_num_args()); @@ -2049,18 +2049,18 @@ namespace smt { pb_factory(ast_manager& m, family_id fid): value_factory(m, fid) {} - virtual expr * get_some_value(sort * s) { + expr * get_some_value(sort * s) override { return m_manager.mk_true(); } - virtual bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2) { + bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2) override { v1 = m_manager.mk_true(); v2 = m_manager.mk_false(); return true; } - virtual expr * get_fresh_value(sort * s) { + expr * get_fresh_value(sort * s) override { return 0; } - virtual void register_value(expr * n) { } + void register_value(expr * n) override { } }; void theory_pb::init_model(model_generator & m) { diff --git a/src/smt/theory_pb.h b/src/smt/theory_pb.h index 662378bdf..5eb6e3312 100644 --- a/src/smt/theory_pb.h +++ b/src/smt/theory_pb.h @@ -261,7 +261,7 @@ namespace smt { std::ostream& display(std::ostream& out, ineq const& c, bool values = false) const; std::ostream& display(std::ostream& out, arg_t const& c, bool values = false) const; - virtual void display(std::ostream& out) const; + void display(std::ostream& out) const override; void display_watch(std::ostream& out, bool_var v, bool sign) const; void display_resolved_lemma(std::ostream& out) const; @@ -317,26 +317,26 @@ namespace smt { public: theory_pb(ast_manager& m, theory_pb_params& p); - virtual ~theory_pb(); + ~theory_pb() override; - virtual theory * mk_fresh(context * new_ctx); - virtual bool internalize_atom(app * atom, bool gate_ctx); - virtual bool internalize_term(app * term) { UNREACHABLE(); return false; } - virtual void new_eq_eh(theory_var v1, theory_var v2); - virtual void new_diseq_eh(theory_var v1, theory_var v2) { } - virtual bool use_diseqs() const { return false; } - virtual bool build_models() const { return false; } - virtual final_check_status final_check_eh(); - virtual void reset_eh(); - virtual void assign_eh(bool_var v, bool is_true); - virtual void init_search_eh(); - virtual void push_scope_eh(); - virtual void pop_scope_eh(unsigned num_scopes); - virtual void restart_eh(); - virtual void collect_statistics(::statistics & st) const; - virtual model_value_proc * mk_value(enode * n, model_generator & mg); - virtual void init_model(model_generator & m); - virtual bool include_func_interp(func_decl* f) { return false; } + theory * mk_fresh(context * new_ctx) override; + bool internalize_atom(app * atom, bool gate_ctx) override; + bool internalize_term(app * term) override { UNREACHABLE(); return false; } + void new_eq_eh(theory_var v1, theory_var v2) override; + void new_diseq_eh(theory_var v1, theory_var v2) override { } + bool use_diseqs() const override { return false; } + bool build_models() const override { return false; } + final_check_status final_check_eh() override; + void reset_eh() override; + void assign_eh(bool_var v, bool is_true) override; + void init_search_eh() override; + void push_scope_eh() override; + void pop_scope_eh(unsigned num_scopes) override; + void restart_eh() override; + void collect_statistics(::statistics & st) const override; + model_value_proc * mk_value(enode * n, model_generator & mg) override; + void init_model(model_generator & m) override; + bool include_func_interp(func_decl* f) override { return false; } static literal assert_ge(context& ctx, unsigned k, unsigned n, literal const* xs); }; diff --git a/src/smt/theory_seq.cpp b/src/smt/theory_seq.cpp index 4c1a63a2f..6fabbf865 100644 --- a/src/smt/theory_seq.cpp +++ b/src/smt/theory_seq.cpp @@ -45,7 +45,7 @@ public: m_kernel(m, fp) {} - virtual lbool check_sat(expr* e) { + lbool check_sat(expr* e) override { m_kernel.push(); m_kernel.assert_expr(e); lbool r = m_kernel.check(); @@ -2691,7 +2691,7 @@ class theory_seq::seq_value_proc : public model_value_proc { public: seq_value_proc(theory_seq& th, sort* s): th(th), m_sort(s) { } - virtual ~seq_value_proc() {} + ~seq_value_proc() override {} void add_unit(enode* n) { m_dependencies.push_back(model_value_dependency(n)); m_source.push_back(unit_source); @@ -2704,7 +2704,7 @@ public: m_strings.push_back(n); m_source.push_back(string_source); } - virtual void get_dependencies(buffer & result) { + void get_dependencies(buffer & result) override { result.append(m_dependencies.size(), m_dependencies.c_ptr()); } @@ -2714,7 +2714,7 @@ public: } } - virtual app * mk_value(model_generator & mg, ptr_vector & values) { + app * mk_value(model_generator & mg, ptr_vector & values) override { SASSERT(values.size() == m_dependencies.size()); expr_ref_vector args(th.m); unsigned j = 0, k = 0; diff --git a/src/smt/theory_seq.h b/src/smt/theory_seq.h index 46f803f5b..3cb1f1b4b 100644 --- a/src/smt/theory_seq.h +++ b/src/smt/theory_seq.h @@ -224,8 +224,8 @@ namespace smt { expr_ref m_e; public: replay_length_coherence(ast_manager& m, expr* e) : m_e(e, m) {} - virtual ~replay_length_coherence() {} - virtual void operator()(theory_seq& th) { + ~replay_length_coherence() override {} + void operator()(theory_seq& th) override { th.check_length_coherence(m_e); m_e.reset(); } @@ -235,8 +235,8 @@ namespace smt { expr_ref m_e; public: replay_fixed_length(ast_manager& m, expr* e) : m_e(e, m) {} - virtual ~replay_fixed_length() {} - virtual void operator()(theory_seq& th) { + ~replay_fixed_length() override {} + void operator()(theory_seq& th) override { th.fixed_length(m_e); m_e.reset(); } @@ -246,8 +246,8 @@ namespace smt { expr_ref m_e; public: replay_axiom(ast_manager& m, expr* e) : m_e(e, m) {} - virtual ~replay_axiom() {} - virtual void operator()(theory_seq& th) { + ~replay_axiom() override {} + void operator()(theory_seq& th) override { th.enque_axiom(m_e); m_e.reset(); } @@ -257,7 +257,7 @@ namespace smt { apply* m_apply; public: push_replay(apply* app): m_apply(app) {} - virtual void undo(theory_seq& th) { + void undo(theory_seq& th) override { th.m_replay.push_back(m_apply); } }; @@ -266,7 +266,7 @@ namespace smt { unsigned k; public: pop_branch(unsigned k): k(k) {} - virtual void undo(theory_seq& th) { + void undo(theory_seq& th) override { th.m_branch_start.erase(k); } }; @@ -340,29 +340,29 @@ namespace smt { obj_hashtable m_fixed; // string variables that are fixed length. - virtual void init(context* ctx); - virtual final_check_status final_check_eh(); - virtual bool internalize_atom(app* atom, bool); - virtual bool internalize_term(app*); - virtual void internalize_eq_eh(app * atom, bool_var v); - virtual void new_eq_eh(theory_var, theory_var); - virtual void new_diseq_eh(theory_var, theory_var); - virtual void assign_eh(bool_var v, bool is_true); - virtual bool can_propagate(); - virtual void propagate(); - virtual void push_scope_eh(); - virtual void pop_scope_eh(unsigned num_scopes); - virtual void restart_eh(); - virtual void relevant_eh(app* n); - virtual theory* mk_fresh(context* new_ctx) { return alloc(theory_seq, new_ctx->get_manager()); } - virtual char const * get_name() const { return "seq"; } - virtual theory_var mk_var(enode* n); - virtual void apply_sort_cnstr(enode* n, sort* s); - virtual void display(std::ostream & out) const; - virtual void collect_statistics(::statistics & st) const; - virtual model_value_proc * mk_value(enode * n, model_generator & mg); - virtual void init_model(model_generator & mg); - virtual void init_search_eh(); + void init(context* ctx) override; + final_check_status final_check_eh() override; + bool internalize_atom(app* atom, bool) override; + bool internalize_term(app*) override; + void internalize_eq_eh(app * atom, bool_var v) override; + void new_eq_eh(theory_var, theory_var) override; + void new_diseq_eh(theory_var, theory_var) override; + void assign_eh(bool_var v, bool is_true) override; + bool can_propagate() override; + void propagate() override; + void push_scope_eh() override; + void pop_scope_eh(unsigned num_scopes) override; + void restart_eh() override; + void relevant_eh(app* n) override; + theory* mk_fresh(context* new_ctx) override { return alloc(theory_seq, new_ctx->get_manager()); } + char const * get_name() const override { return "seq"; } + theory_var mk_var(enode* n) override; + void apply_sort_cnstr(enode* n, sort* s) override; + void display(std::ostream & out) const override; + void collect_statistics(::statistics & st) const override; + model_value_proc * mk_value(enode * n, model_generator & mg) override; + void init_model(model_generator & mg) override; + void init_search_eh() override; void init_model(expr_ref_vector const& es); // final check @@ -584,7 +584,7 @@ namespace smt { void display_nc(std::ostream& out, nc const& nc) const; public: theory_seq(ast_manager& m); - virtual ~theory_seq(); + ~theory_seq() override; // model building app* mk_value(app* a); diff --git a/src/smt/theory_seq_empty.h b/src/smt/theory_seq_empty.h index 85408f7e5..647b54320 100644 --- a/src/smt/theory_seq_empty.h +++ b/src/smt/theory_seq_empty.h @@ -63,7 +63,7 @@ namespace smt { m_unique_sequences.insert(m.get_sort(uniq), uniq); } - virtual expr* get_some_value(sort* s) { + expr* get_some_value(sort* s) override { if (u.is_seq(s)) { return u.str.mk_empty(s); } @@ -74,7 +74,7 @@ namespace smt { UNREACHABLE(); return 0; } - virtual bool get_some_values(sort* s, expr_ref& v1, expr_ref& v2) { + bool get_some_values(sort* s, expr_ref& v1, expr_ref& v2) override { if (u.is_string(s)) { v1 = u.str.mk_string(symbol("a")); v2 = u.str.mk_string(symbol("b")); @@ -94,7 +94,7 @@ namespace smt { NOT_IMPLEMENTED_YET(); return false; } - virtual expr* get_fresh_value(sort* s) { + expr* get_fresh_value(sort* s) override { if (u.is_string(s)) { while (true) { std::ostringstream strm; @@ -122,7 +122,7 @@ namespace smt { UNREACHABLE(); return 0; } - virtual void register_value(expr* n) { + void register_value(expr* n) override { symbol sym; if (u.str.is_string(n, sym)) { m_strings.insert(sym); @@ -148,17 +148,17 @@ namespace smt { class theory_seq_empty : public theory { bool m_used; - virtual final_check_status final_check_eh() { return m_used?FC_GIVEUP:FC_DONE; } - virtual bool internalize_atom(app*, bool) { if (!m_used) { get_context().push_trail(value_trail(m_used)); m_used = true; } return false; } - virtual bool internalize_term(app*) { return internalize_atom(0,false); } - virtual void new_eq_eh(theory_var, theory_var) { } - virtual void new_diseq_eh(theory_var, theory_var) {} - virtual theory* mk_fresh(context* new_ctx) { return alloc(theory_seq_empty, new_ctx->get_manager()); } - virtual char const * get_name() const { return "seq-empty"; } - virtual void display(std::ostream& out) const {} + final_check_status final_check_eh() override { return m_used?FC_GIVEUP:FC_DONE; } + bool internalize_atom(app*, bool) override { if (!m_used) { get_context().push_trail(value_trail(m_used)); m_used = true; } return false; } + bool internalize_term(app*) override { return internalize_atom(0,false); } + void new_eq_eh(theory_var, theory_var) override { } + void new_diseq_eh(theory_var, theory_var) override {} + theory* mk_fresh(context* new_ctx) override { return alloc(theory_seq_empty, new_ctx->get_manager()); } + char const * get_name() const override { return "seq-empty"; } + void display(std::ostream& out) const override {} public: theory_seq_empty(ast_manager& m):theory(m.mk_family_id("seq")), m_used(false) {} - virtual void init_model(model_generator & mg) { + void init_model(model_generator & mg) override { mg.register_factory(alloc(seq_factory, get_manager(), get_family_id(), mg.get_model())); } diff --git a/src/smt/theory_str.h b/src/smt/theory_str.h index 03fd31162..52d06efd1 100644 --- a/src/smt/theory_str.h +++ b/src/smt/theory_str.h @@ -46,16 +46,16 @@ public: str_value_factory(ast_manager & m, family_id fid) : value_factory(m, fid), u(m), delim("!"), m_next(0) {} - virtual ~str_value_factory() {} - virtual expr * get_some_value(sort * s) { + ~str_value_factory() override {} + expr * get_some_value(sort * s) override { return u.str.mk_string(symbol("some value")); } - virtual bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2) { + bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2) override { v1 = u.str.mk_string(symbol("value 1")); v2 = u.str.mk_string(symbol("value 2")); return true; } - virtual expr * get_fresh_value(sort * s) { + expr * get_fresh_value(sort * s) override { if (u.is_string(s)) { while (true) { std::ostringstream strm; @@ -74,7 +74,7 @@ public: TRACE("t_str", tout << "unexpected sort in get_fresh_value(): " << mk_pp(s, m_manager) << std::endl;); UNREACHABLE(); return NULL; } - virtual void register_value(expr * n) { /* Ignore */ } + void register_value(expr * n) override { /* Ignore */ } }; // rather than modify obj_pair_map I inherit from it and add my own helper methods @@ -104,8 +104,8 @@ class binary_search_trail : public trail { public: binary_search_trail(obj_map > & target, expr * entry) : target(target), entry(entry) {} - virtual ~binary_search_trail() {} - virtual void undo(Ctx & ctx) { + ~binary_search_trail() override {} + void undo(Ctx & ctx) override { TRACE("t_str_binary_search", tout << "in binary_search_trail::undo()" << std::endl;); if (target.contains(entry)) { if (!target[entry].empty()) { @@ -616,10 +616,10 @@ protected: public: theory_str(ast_manager & m, theory_str_params const & params); - virtual ~theory_str(); + ~theory_str() override; - virtual char const * get_name() const { return "seq"; } - virtual void display(std::ostream & out) const; + char const * get_name() const override { return "seq"; } + void display(std::ostream & out) const override; bool overlapping_variables_detected() const { return loopDetected; } @@ -628,33 +628,33 @@ public: void after_merge_eh(theory_var r1, theory_var r2, theory_var v1, theory_var v2) { } void unmerge_eh(theory_var v1, theory_var v2) {} protected: - virtual bool internalize_atom(app * atom, bool gate_ctx); - virtual bool internalize_term(app * term); + bool internalize_atom(app * atom, bool gate_ctx) override; + bool internalize_term(app * term) override; virtual enode* ensure_enode(expr* e); - virtual theory_var mk_var(enode * n); + theory_var mk_var(enode * n) override; - virtual void new_eq_eh(theory_var, theory_var); - virtual void new_diseq_eh(theory_var, theory_var); + void new_eq_eh(theory_var, theory_var) override; + void new_diseq_eh(theory_var, theory_var) override; - virtual theory* mk_fresh(context*) { return alloc(theory_str, get_manager(), m_params); } - virtual void init_search_eh(); - virtual void add_theory_assumptions(expr_ref_vector & assumptions); - virtual lbool validate_unsat_core(expr_ref_vector & unsat_core); - virtual void relevant_eh(app * n); - virtual void assign_eh(bool_var v, bool is_true); - virtual void push_scope_eh(); - virtual void pop_scope_eh(unsigned num_scopes); - virtual void reset_eh(); + theory* mk_fresh(context*) override { return alloc(theory_str, get_manager(), m_params); } + void init_search_eh() override; + void add_theory_assumptions(expr_ref_vector & assumptions) override; + lbool validate_unsat_core(expr_ref_vector & unsat_core) override; + void relevant_eh(app * n) override; + void assign_eh(bool_var v, bool is_true) override; + void push_scope_eh() override; + void pop_scope_eh(unsigned num_scopes) override; + void reset_eh() override; - virtual bool can_propagate(); - virtual void propagate(); + bool can_propagate() override; + void propagate() override; - virtual final_check_status final_check_eh(); + final_check_status final_check_eh() override; virtual void attach_new_th_var(enode * n); - virtual void init_model(model_generator & m); - virtual model_value_proc * mk_value(enode * n, model_generator & mg); - virtual void finalize_model(model_generator & mg); + void init_model(model_generator & m) override; + model_value_proc * mk_value(enode * n, model_generator & mg) override; + void finalize_model(model_generator & mg) override; }; }; diff --git a/src/smt/theory_utvpi.h b/src/smt/theory_utvpi.h index 55bbb9838..ca4f4737e 100644 --- a/src/smt/theory_utvpi.h +++ b/src/smt/theory_utvpi.h @@ -166,7 +166,7 @@ namespace smt { void new_edge(dl_var src, dl_var dst, unsigned num_edges, edge_id const* edges) {} // Create a new theory variable. - virtual th_var mk_var(enode* n); + th_var mk_var(enode* n) override; virtual th_var mk_var(expr* n); @@ -181,83 +181,83 @@ namespace smt { public: theory_utvpi(ast_manager& m); - virtual ~theory_utvpi(); + ~theory_utvpi() override; - virtual theory * mk_fresh(context * new_ctx); + theory * mk_fresh(context * new_ctx) override; - virtual char const * get_name() const { return "utvpi-logic"; } + char const * get_name() const override { return "utvpi-logic"; } /** \brief See comment in theory::mk_eq_atom */ - virtual app * mk_eq_atom(expr * lhs, expr * rhs) { return a.mk_eq(lhs, rhs); } + app * mk_eq_atom(expr * lhs, expr * rhs) override { return a.mk_eq(lhs, rhs); } - virtual void init(context * ctx); + void init(context * ctx) override; - virtual bool internalize_atom(app * atom, bool gate_ctx); + bool internalize_atom(app * atom, bool gate_ctx) override; - virtual bool internalize_term(app * term); + bool internalize_term(app * term) override; - virtual void internalize_eq_eh(app * atom, bool_var v); + void internalize_eq_eh(app * atom, bool_var v) override; - virtual void assign_eh(bool_var v, bool is_true); + void assign_eh(bool_var v, bool is_true) override; - virtual void new_eq_eh(th_var v1, th_var v2) { + void new_eq_eh(th_var v1, th_var v2) override { m_stats.m_num_core2th_eqs++; m_arith_eq_adapter.new_eq_eh(v1, v2); } - virtual bool use_diseqs() const { return true; } + bool use_diseqs() const override { return true; } - virtual void new_diseq_eh(th_var v1, th_var v2) { + void new_diseq_eh(th_var v1, th_var v2) override { m_arith_eq_adapter.new_diseq_eh(v1, v2); } - virtual void push_scope_eh(); + void push_scope_eh() override; - virtual void pop_scope_eh(unsigned num_scopes); + void pop_scope_eh(unsigned num_scopes) override; - virtual void restart_eh() { + void restart_eh() override { m_arith_eq_adapter.restart_eh(); } - virtual void relevant_eh(app* e) {} + void relevant_eh(app* e) override {} - virtual void init_search_eh() { + void init_search_eh() override { m_arith_eq_adapter.init_search_eh(); } - virtual final_check_status final_check_eh(); + final_check_status final_check_eh() override; - virtual bool is_shared(th_var v) const { + bool is_shared(th_var v) const override { return false; } - virtual bool can_propagate() { + bool can_propagate() override { SASSERT(m_asserted_qhead <= m_asserted_atoms.size()); return m_asserted_qhead != m_asserted_atoms.size(); } - virtual void propagate(); + void propagate() override; - virtual justification * why_is_diseq(th_var v1, th_var v2) { + justification * why_is_diseq(th_var v1, th_var v2) override { UNREACHABLE(); return 0; } - virtual void reset_eh(); + void reset_eh() override; - virtual void init_model(model_generator & m); + void init_model(model_generator & m) override; - virtual model_value_proc * mk_value(enode * n, model_generator & mg); + model_value_proc * mk_value(enode * n, model_generator & mg) override; - virtual bool validate_eq_in_model(th_var v1, th_var v2, bool is_true) const { + bool validate_eq_in_model(th_var v1, th_var v2, bool is_true) const override { return true; } - virtual void display(std::ostream & out) const; + void display(std::ostream & out) const override; - virtual void collect_statistics(::statistics & st) const; + void collect_statistics(::statistics & st) const override; private: diff --git a/src/smt/theory_wmaxsat.h b/src/smt/theory_wmaxsat.h index 739a22c71..16dab488b 100644 --- a/src/smt/theory_wmaxsat.h +++ b/src/smt/theory_wmaxsat.h @@ -57,7 +57,7 @@ namespace smt { stats m_stats; public: theory_wmaxsat(ast_manager& m, filter_model_converter& mc); - virtual ~theory_wmaxsat(); + ~theory_wmaxsat() override; void get_assignment(svector& result); expr* assert_weighted(expr* fml, rational const& w); void disable_var(expr* var); @@ -76,43 +76,43 @@ namespace smt { old.push_back(value); } - virtual ~numeral_trail() { + ~numeral_trail() override { } - virtual void undo(context & ctx) { + void undo(context & ctx) override { m_value = m_old_values.back(); m_old_values.shrink(m_old_values.size() - 1); } }; - virtual void init_search_eh(); - virtual void assign_eh(bool_var v, bool is_true); - virtual final_check_status final_check_eh(); - virtual bool use_diseqs() const { + void init_search_eh() override; + void assign_eh(bool_var v, bool is_true) override; + final_check_status final_check_eh() override; + bool use_diseqs() const override { return false; } - virtual bool build_models() const { + bool build_models() const override { return false; } void reset_local(); - virtual void reset_eh(); - virtual theory * mk_fresh(context * new_ctx) { return 0; } - virtual bool internalize_atom(app * atom, bool gate_ctx) { return false; } - virtual bool internalize_term(app * term) { return false; } - virtual void new_eq_eh(theory_var v1, theory_var v2) { } - virtual void new_diseq_eh(theory_var v1, theory_var v2) { } - virtual void display(std::ostream& out) const {} - virtual void restart_eh(); + void reset_eh() override; + theory * mk_fresh(context * new_ctx) override { return 0; } + bool internalize_atom(app * atom, bool gate_ctx) override { return false; } + bool internalize_term(app * term) override { return false; } + void new_eq_eh(theory_var v1, theory_var v2) override { } + void new_diseq_eh(theory_var v1, theory_var v2) override { } + void display(std::ostream& out) const override {} + void restart_eh() override; - virtual void collect_statistics(::statistics & st) const { + void collect_statistics(::statistics & st) const override { st.update("wmaxsat num blocks", m_stats.m_num_blocks); st.update("wmaxsat num props", m_stats.m_num_propagations); } - virtual bool can_propagate() { + bool can_propagate() override { return m_propagate || m_can_propagate; } - virtual void propagate(); + void propagate() override; bool is_optimal() const; expr_ref mk_block(); diff --git a/src/test/ex.cpp b/src/test/ex.cpp index 591813814..444431475 100644 --- a/src/test/ex.cpp +++ b/src/test/ex.cpp @@ -29,14 +29,14 @@ class ex1 : public ex { char const * m_msg; public: ex1(char const * m):m_msg(m) {} - virtual char const * msg() const { return m_msg; } + char const * msg() const override { return m_msg; } }; class ex2 : public ex { std::string m_msg; public: ex2(char const * m):m_msg(m) {} - virtual char const * msg() const { return m_msg.c_str(); } + char const * msg() const override { return m_msg.c_str(); } }; static void th() { diff --git a/src/util/checked_int64.h b/src/util/checked_int64.h index 8a2eb124d..e5a88fb31 100644 --- a/src/util/checked_int64.h +++ b/src/util/checked_int64.h @@ -41,7 +41,7 @@ public: checked_int64(checked_int64 const& other) { m_value = other.m_value; } class overflow_exception : public z3_exception { - virtual char const * msg() const { return "checked_int64 overflow/underflow";} + char const * msg() const override { return "checked_int64 overflow/underflow";} }; bool is_zero() const { return m_value == 0; } diff --git a/src/util/lp/eta_matrix.h b/src/util/lp/eta_matrix.h index 6c30e2146..7224fa846 100644 --- a/src/util/lp/eta_matrix.h +++ b/src/util/lp/eta_matrix.h @@ -46,7 +46,7 @@ public: #endif m_column_index(column_index) {} - bool is_dense() const { return false; } + bool is_dense() const override { return false; } void print(std::ostream & out) { print_matrix(*this, out); @@ -65,12 +65,12 @@ public: return m_diagonal_element; } - void apply_from_left(vector & w, lp_settings & ); + void apply_from_left(vector & w, lp_settings & ) override; template void apply_from_left_local(indexed_vector & w, lp_settings & settings); - void apply_from_left_to_T(indexed_vector & w, lp_settings & settings) { + void apply_from_left_to_T(indexed_vector & w, lp_settings & settings) override { apply_from_left_local(w, settings); } @@ -80,8 +80,8 @@ public: m_column_vector.push_back(row_index, val); } - void apply_from_right(vector & w); - void apply_from_right(indexed_vector & w); + void apply_from_right(vector & w) override; + void apply_from_right(indexed_vector & w) override; T get_elem(unsigned i, unsigned j) const; #ifdef Z3DEBUG diff --git a/src/util/lp/iterator_on_column.h b/src/util/lp/iterator_on_column.h index 5bb43f4c6..c9112a064 100644 --- a/src/util/lp/iterator_on_column.h +++ b/src/util/lp/iterator_on_column.h @@ -27,14 +27,14 @@ struct iterator_on_column:linear_combination_iterator { const vector& m_column; // the offset in term coeffs const static_matrix & m_A; int m_i; // the initial offset in the column - unsigned size() const { return m_column.size(); } + unsigned size() const override { return m_column.size(); } iterator_on_column(const vector& column, const static_matrix & A) // the offset in term coeffs : m_column(column), m_A(A), m_i(-1) {} - bool next(mpq & a, unsigned & i) { + bool next(mpq & a, unsigned & i) override { if (++m_i >= static_cast(m_column.size())) return false; @@ -44,7 +44,7 @@ struct iterator_on_column:linear_combination_iterator { return true; } - bool next(unsigned & i) { + bool next(unsigned & i) override { if (++m_i >= static_cast(m_column.size())) return false; @@ -53,11 +53,11 @@ struct iterator_on_column:linear_combination_iterator { return true; } - void reset() { + void reset() override { m_i = -1; } - linear_combination_iterator * clone() { + linear_combination_iterator * clone() override { iterator_on_column * r = new iterator_on_column(m_column, m_A); return r; } diff --git a/src/util/lp/iterator_on_indexed_vector.h b/src/util/lp/iterator_on_indexed_vector.h index 2c8daf83b..6cb98b8f2 100644 --- a/src/util/lp/iterator_on_indexed_vector.h +++ b/src/util/lp/iterator_on_indexed_vector.h @@ -28,8 +28,8 @@ struct iterator_on_indexed_vector:linear_combination_iterator { m_v(v), m_offset(0) {} - unsigned size() const { return m_v.m_index.size(); } - bool next(T & a, unsigned & i) { + unsigned size() const override { return m_v.m_index.size(); } + bool next(T & a, unsigned & i) override { if (m_offset >= m_v.m_index.size()) return false; i = m_v.m_index[m_offset++]; @@ -37,16 +37,16 @@ struct iterator_on_indexed_vector:linear_combination_iterator { return true; } - bool next(unsigned & i) { + bool next(unsigned & i) override { if (m_offset >= m_v.m_index.size()) return false; i = m_v.m_index[m_offset++]; return true; } - void reset() { + void reset() override { m_offset = 0; } - linear_combination_iterator* clone() { + linear_combination_iterator* clone() override { return new iterator_on_indexed_vector(m_v); } }; diff --git a/src/util/lp/iterator_on_pivot_row.h b/src/util/lp/iterator_on_pivot_row.h index 8aa498477..721502bc2 100644 --- a/src/util/lp/iterator_on_pivot_row.h +++ b/src/util/lp/iterator_on_pivot_row.h @@ -26,11 +26,11 @@ struct iterator_on_pivot_row:linear_combination_iterator { const indexed_vector & m_v; unsigned m_basis_j; iterator_on_indexed_vector m_it; - unsigned size() const { return m_it.size(); } + unsigned size() const override { return m_it.size(); } iterator_on_pivot_row(const indexed_vector & v, unsigned basis_j) : m_basis_returned(false), m_v(v), m_basis_j(basis_j), m_it(v) {} - bool next(T & a, unsigned & i) { + bool next(T & a, unsigned & i) override { if (m_basis_returned == false) { m_basis_returned = true; a = one_of_type(); @@ -39,7 +39,7 @@ struct iterator_on_pivot_row:linear_combination_iterator { } return m_it.next(a, i); } - bool next(unsigned & i) { + bool next(unsigned & i) override { if (m_basis_returned == false) { m_basis_returned = true; i = m_basis_j; @@ -47,11 +47,11 @@ struct iterator_on_pivot_row:linear_combination_iterator { } return m_it.next(i); } - void reset() { + void reset() override { m_basis_returned = false; m_it.reset(); } - linear_combination_iterator * clone() { + linear_combination_iterator * clone() override { iterator_on_pivot_row * r = new iterator_on_pivot_row(m_v, m_basis_j); return r; } diff --git a/src/util/lp/iterator_on_row.h b/src/util/lp/iterator_on_row.h index 1ac5b66bc..55fbda907 100644 --- a/src/util/lp/iterator_on_row.h +++ b/src/util/lp/iterator_on_row.h @@ -26,8 +26,8 @@ struct iterator_on_row:linear_combination_iterator { unsigned m_i; // offset iterator_on_row(const vector> & row) : m_row(row), m_i(0) {} - unsigned size() const { return m_row.size(); } - bool next(T & a, unsigned & i) { + unsigned size() const override { return m_row.size(); } + bool next(T & a, unsigned & i) override { if (m_i == m_row.size()) return false; auto &c = m_row[m_i++]; @@ -35,17 +35,17 @@ struct iterator_on_row:linear_combination_iterator { a = c.get_val(); return true; } - bool next(unsigned & i) { + bool next(unsigned & i) override { if (m_i == m_row.size()) return false; auto &c = m_row[m_i++]; i = c.m_j; return true; } - void reset() { + void reset() override { m_i = 0; } - linear_combination_iterator* clone() { + linear_combination_iterator* clone() override { return new iterator_on_row(m_row); } }; diff --git a/src/util/lp/iterator_on_term_with_basis_var.h b/src/util/lp/iterator_on_term_with_basis_var.h index e566b92b5..85d11cf36 100644 --- a/src/util/lp/iterator_on_term_with_basis_var.h +++ b/src/util/lp/iterator_on_term_with_basis_var.h @@ -27,14 +27,14 @@ struct iterator_on_term_with_basis_var:linear_combination_iterator { std::unordered_map::const_iterator m_i; // the offset in term coeffs bool m_term_j_returned; unsigned m_term_j; - unsigned size() const {return static_cast(m_term.m_coeffs.size() + 1);} + unsigned size() const override {return static_cast(m_term.m_coeffs.size() + 1);} iterator_on_term_with_basis_var(const lar_term & t, unsigned term_j) : m_term(t), m_i(t.m_coeffs.begin()), m_term_j_returned(false), m_term_j(term_j) {} - bool next(mpq & a, unsigned & i) { + bool next(mpq & a, unsigned & i) override { if (m_term_j_returned == false) { m_term_j_returned = true; a = - one_of_type(); @@ -48,7 +48,7 @@ struct iterator_on_term_with_basis_var:linear_combination_iterator { m_i++; return true; } - bool next(unsigned & i) { + bool next(unsigned & i) override { if (m_term_j_returned == false) { m_term_j_returned = true; i = m_term_j; @@ -60,11 +60,11 @@ struct iterator_on_term_with_basis_var:linear_combination_iterator { m_i++; return true; } - void reset() { + void reset() override { m_term_j_returned = false; m_i = m_term.m_coeffs.begin(); } - linear_combination_iterator * clone() { + linear_combination_iterator * clone() override { iterator_on_term_with_basis_var * r = new iterator_on_term_with_basis_var(m_term, m_term_j); return r; } diff --git a/src/util/lp/lar_constraints.h b/src/util/lp/lar_constraints.h index 7b573bab7..9d3a0e0aa 100644 --- a/src/util/lp/lar_constraints.h +++ b/src/util/lp/lar_constraints.h @@ -59,24 +59,24 @@ public: struct lar_var_constraint: public lar_base_constraint { unsigned m_j; - vector> get_left_side_coefficients() const { + vector> get_left_side_coefficients() const override { vector> ret; ret.push_back(std::make_pair(one_of_type(), m_j)); return ret; } - unsigned size() const { return 1;} + unsigned size() const override { return 1;} lar_var_constraint(unsigned j, lconstraint_kind kind, const mpq& right_side) : lar_base_constraint(kind, right_side), m_j(j) { } }; struct lar_term_constraint: public lar_base_constraint { const lar_term * m_term; - vector> get_left_side_coefficients() const { + vector> get_left_side_coefficients() const override { return m_term->coeffs_as_vector(); } - unsigned size() const { return m_term->size();} + unsigned size() const override { return m_term->size();} lar_term_constraint(const lar_term *t, lconstraint_kind kind, const mpq& right_side) : lar_base_constraint(kind, right_side), m_term(t) { } - virtual mpq get_free_coeff_of_left_side() const { return m_term->m_v;} + mpq get_free_coeff_of_left_side() const override { return m_term->m_v;} }; @@ -92,10 +92,10 @@ public: SASSERT(false); // should not be called : todo! } - unsigned size() const { + unsigned size() const override { return static_cast(m_coeffs.size()); } - vector> get_left_side_coefficients() const { return m_coeffs; } + vector> get_left_side_coefficients() const override { return m_coeffs; } }; } diff --git a/src/util/lp/lar_solver.h b/src/util/lp/lar_solver.h index 1f1054bb6..c26333edb 100644 --- a/src/util/lp/lar_solver.h +++ b/src/util/lp/lar_solver.h @@ -1011,7 +1011,7 @@ public: return ret; } - std::string get_column_name(unsigned j) const { + std::string get_column_name(unsigned j) const override { if (j >= m_terms_start_index) return std::string("_t") + T_to_string(j); if (j >= m_columns_to_ext_vars_or_term_indices.size()) diff --git a/src/util/lp/lp_dual_core_solver.h b/src/util/lp/lp_dual_core_solver.h index ba4be494f..7aa572171 100644 --- a/src/util/lp/lp_dual_core_solver.h +++ b/src/util/lp/lp_dual_core_solver.h @@ -207,6 +207,6 @@ public: void solve(); - bool low_bounds_are_set() const { return true; } + bool low_bounds_are_set() const override { return true; } }; } diff --git a/src/util/lp/lp_dual_simplex.h b/src/util/lp/lp_dual_simplex.h index c17a9e99e..15463fc34 100644 --- a/src/util/lp/lp_dual_simplex.h +++ b/src/util/lp/lp_dual_simplex.h @@ -33,7 +33,7 @@ class lp_dual_simplex: public lp_solver { vector m_column_types_of_logicals; vector m_can_enter_basis; public: - ~lp_dual_simplex() { + ~lp_dual_simplex() override { if (m_core_solver != nullptr) { delete m_core_solver; } @@ -84,12 +84,12 @@ public: void copy_m_b_aside_and_set_it_to_zeros(); - void find_maximal_solution(); + void find_maximal_solution() override; - virtual T get_column_value(unsigned column) const { + T get_column_value(unsigned column) const override { return this->get_column_value_with_core_solver(column, m_core_solver); } - T get_current_cost() const; + T get_current_cost() const override; }; } diff --git a/src/util/lp/lp_primal_core_solver.h b/src/util/lp/lp_primal_core_solver.h index a7614862b..139cf3ad5 100644 --- a/src/util/lp/lp_primal_core_solver.h +++ b/src/util/lp/lp_primal_core_solver.h @@ -770,7 +770,7 @@ public: void init_reduced_costs(); - bool low_bounds_are_set() const { return true; } + bool low_bounds_are_set() const override { return true; } int advance_on_sorted_breakpoints(unsigned entering, X & t); diff --git a/src/util/lp/lp_primal_simplex.h b/src/util/lp/lp_primal_simplex.h index d8fd114e4..06ea26f8f 100644 --- a/src/util/lp/lp_primal_simplex.h +++ b/src/util/lp/lp_primal_simplex.h @@ -70,7 +70,7 @@ public: void set_core_solver_bounds(); - void find_maximal_solution(); + void find_maximal_solution() override; void fill_A_x_and_basis_for_stage_one_total_inf(); @@ -79,7 +79,7 @@ public: void solve_with_total_inf(); - ~lp_primal_simplex(); + ~lp_primal_simplex() override; bool bounds_hold(std::unordered_map const & solution); @@ -96,11 +96,11 @@ public: return bounds_hold(solution) && row_constraints_hold(solution); } - virtual T get_column_value(unsigned column) const { + T get_column_value(unsigned column) const override { return this->get_column_value_with_core_solver(column, m_core_solver); } - T get_current_cost() const; + T get_current_cost() const override; }; diff --git a/src/util/lp/lp_settings.h b/src/util/lp/lp_settings.h index a7e6e2665..cd9e78321 100644 --- a/src/util/lp/lp_settings.h +++ b/src/util/lp/lp_settings.h @@ -109,7 +109,7 @@ private: default_lp_resource_limit(lp_settings& s): m_settings(s) { m_sw.start(); } - virtual bool get_cancel_flag() { + bool get_cancel_flag() override { return (m_sw.get_current_seconds() > m_settings.time_limit); } }; diff --git a/src/util/lp/lu.h b/src/util/lp/lu.h index 5498a1849..f9432c323 100644 --- a/src/util/lp/lu.h +++ b/src/util/lp/lu.h @@ -67,7 +67,7 @@ public: #endif } - bool is_dense() const { return false; } + bool is_dense() const override { return false; } one_elem_on_diag(const one_elem_on_diag & o); @@ -83,15 +83,15 @@ public: unsigned row_count() const { return m_m; } // not defined } unsigned column_count() const { return m_m; } // not defined } #endif - void apply_from_left(vector & w, lp_settings &) { + void apply_from_left(vector & w, lp_settings &) override { w[m_i] /= m_val; } - void apply_from_right(vector & w) { + void apply_from_right(vector & w) override { w[m_i] /= m_val; } - void apply_from_right(indexed_vector & w) { + void apply_from_right(indexed_vector & w) override { if (is_zero(w.m_data[m_i])) return; auto & v = w.m_data[m_i] /= m_val; @@ -102,7 +102,7 @@ public: } - void apply_from_left_to_T(indexed_vector & w, lp_settings & settings); + void apply_from_left_to_T(indexed_vector & w, lp_settings & settings) override; void conjugate_by_permutation(permutation_matrix & p) { // this = p * this * p(-1) diff --git a/src/util/lp/permutation_matrix.h b/src/util/lp/permutation_matrix.h index 7cf64a5c7..f080d45b9 100644 --- a/src/util/lp/permutation_matrix.h +++ b/src/util/lp/permutation_matrix.h @@ -64,7 +64,7 @@ class permutation_matrix : public tail_matrix { // create a unit permutation of the given length void init(unsigned length); unsigned get_rev(unsigned i) { return m_rev[i]; } - bool is_dense() const { return false; } + bool is_dense() const override { return false; } #ifdef Z3DEBUG permutation_matrix get_inverse() const { return permutation_matrix(size(), m_rev); @@ -76,13 +76,13 @@ class permutation_matrix : public tail_matrix { unsigned operator[](unsigned i) const { return m_permutation[i]; } - void apply_from_left(vector & w, lp_settings &); + void apply_from_left(vector & w, lp_settings &) override; - void apply_from_left_to_T(indexed_vector & w, lp_settings & settings); + void apply_from_left_to_T(indexed_vector & w, lp_settings & settings) override; - void apply_from_right(vector & w); + void apply_from_right(vector & w) override; - void apply_from_right(indexed_vector & w); + void apply_from_right(indexed_vector & w) override; template void copy_aside(vector & t, vector & tmp_index, indexed_vector & w); diff --git a/src/util/lp/row_eta_matrix.h b/src/util/lp/row_eta_matrix.h index c287e263a..f6fb4537d 100644 --- a/src/util/lp/row_eta_matrix.h +++ b/src/util/lp/row_eta_matrix.h @@ -50,7 +50,7 @@ public: m_row_start(row_start), m_row(row) { } - bool is_dense() const { return false; } + bool is_dense() const override { return false; } void print(std::ostream & out) { print_matrix(*this, out); @@ -60,12 +60,12 @@ public: return m_row_vector.m_data[m_row]; } - void apply_from_left(vector & w, lp_settings &); + void apply_from_left(vector & w, lp_settings &) override; void apply_from_left_local_to_T(indexed_vector & w, lp_settings & settings); void apply_from_left_local_to_X(indexed_vector & w, lp_settings & settings); - void apply_from_left_to_T(indexed_vector & w, lp_settings & settings) { + void apply_from_left_to_T(indexed_vector & w, lp_settings & settings) override { apply_from_left_local_to_T(w, settings); } @@ -74,8 +74,8 @@ public: m_row_vector.push_back(row_index, val); } - void apply_from_right(vector & w); - void apply_from_right(indexed_vector & w); + void apply_from_right(vector & w) override; + void apply_from_right(indexed_vector & w) override; void conjugate_by_permutation(permutation_matrix & p); #ifdef Z3DEBUG diff --git a/src/util/lp/square_dense_submatrix.h b/src/util/lp/square_dense_submatrix.h index 3e88e8114..a2cade85a 100644 --- a/src/util/lp/square_dense_submatrix.h +++ b/src/util/lp/square_dense_submatrix.h @@ -70,7 +70,7 @@ public: void init(sparse_matrix *parent_matrix, unsigned index_start); - bool is_dense() const { return true; } + bool is_dense() const override { return true; } ref operator[] (unsigned i) { SASSERT(i >= m_index_start); @@ -137,13 +137,13 @@ public: bool is_L_matrix() const; - void apply_from_left_to_T(indexed_vector & w, lp_settings & settings) { + void apply_from_left_to_T(indexed_vector & w, lp_settings & settings) override { apply_from_left_local(w, settings); } - void apply_from_right(indexed_vector & w) { + void apply_from_right(indexed_vector & w) override { #if 1==0 indexed_vector wcopy = w; apply_from_right(wcopy.m_data); @@ -207,11 +207,11 @@ public: w = m_work_vector; #endif } - void apply_from_left(vector & w, lp_settings & /*settings*/) { + void apply_from_left(vector & w, lp_settings & /*settings*/) override { apply_from_left_to_vector(w);// , settings); } - void apply_from_right(vector & w); + void apply_from_right(vector & w) override; #ifdef Z3DEBUG T get_elem (unsigned i, unsigned j) const; diff --git a/src/util/mpff.h b/src/util/mpff.h index 4fdd0baef..e34f2cb41 100644 --- a/src/util/mpff.h +++ b/src/util/mpff.h @@ -178,15 +178,15 @@ public: static bool field() { return true; } class exception : public z3_exception { - virtual char const * msg() const { return "multi-precision floating point (mpff) exception"; } + char const * msg() const override { return "multi-precision floating point (mpff) exception"; } }; class overflow_exception : public exception { - virtual char const * msg() const { return "multi-precision floating point (mpff) overflow"; } + char const * msg() const override { return "multi-precision floating point (mpff) overflow"; } }; class div0_exception : public exception { - virtual char const * msg() const { return "multi-precision floating point (mpff) division by zero"; } + char const * msg() const override { return "multi-precision floating point (mpff) division by zero"; } }; mpff_manager(unsigned prec = 2, unsigned initial_capacity = 1024); diff --git a/src/util/mpfx.h b/src/util/mpfx.h index 98f9bb322..03a805f69 100644 --- a/src/util/mpfx.h +++ b/src/util/mpfx.h @@ -125,15 +125,15 @@ public: static bool field() { return true; } class exception : public z3_exception { - virtual char const * msg() const { return "multi-precision fixed point (mpfx) exception"; } + char const * msg() const override { return "multi-precision fixed point (mpfx) exception"; } }; class overflow_exception : public exception { - virtual char const * msg() const { return "multi-precision fixed point (mpfx) overflow"; } + char const * msg() const override { return "multi-precision fixed point (mpfx) overflow"; } }; class div0_exception : public exception { - virtual char const * msg() const { return "multi-precision fixed point (mpfx) division by zero"; } + char const * msg() const override { return "multi-precision fixed point (mpfx) division by zero"; } }; mpfx_manager(unsigned int_sz = 2, unsigned frac_sz = 1, unsigned initial_capacity = 1024); diff --git a/src/util/timeout.cpp b/src/util/timeout.cpp index 67995c2aa..496c5c859 100644 --- a/src/util/timeout.cpp +++ b/src/util/timeout.cpp @@ -32,7 +32,7 @@ void (* g_on_timeout)() = 0; class g_timeout_eh : public event_handler { public: - void operator()(event_handler_caller_t caller_id) { + void operator()(event_handler_caller_t caller_id) override { #pragma omp critical (g_timeout_cs) { std::cout << "timeout\n"; diff --git a/src/util/trail.h b/src/util/trail.h index bba71fb00..adcd57860 100644 --- a/src/util/trail.h +++ b/src/util/trail.h @@ -43,10 +43,10 @@ public: m_old_value(value) { } - virtual ~value_trail() { + ~value_trail() override { } - virtual void undo(Ctx & ctx) { + void undo(Ctx & ctx) override { m_value = m_old_value; } }; @@ -59,10 +59,10 @@ public: m_value(value) { } - virtual ~reset_flag_trail() { + ~reset_flag_trail() override { } - virtual void undo(Ctx & ctx) { + void undo(Ctx & ctx) override { m_value = false; } }; @@ -76,7 +76,7 @@ public: SASSERT(m_ptr == 0); } - virtual void undo(Ctx & ctx) { + void undo(Ctx & ctx) override { m_ptr = 0; } }; @@ -94,9 +94,9 @@ public: m_vector(v), m_old_size(v.size()) { } - virtual ~restore_size_trail() { + ~restore_size_trail() override { } - virtual void undo(Ctx & ctx) { + void undo(Ctx & ctx) override { m_vector.shrink(m_old_size); } }; @@ -113,10 +113,10 @@ public: m_old_value(v[idx]) { } - virtual ~vector_value_trail() { + ~vector_value_trail() override { } - virtual void undo(Ctx & ctx) { + void undo(Ctx & ctx) override { m_vector[m_idx] = m_old_value; } }; @@ -128,8 +128,8 @@ class insert_obj_map : public trail { D* m_obj; public: insert_obj_map(obj_map& t, D* o) : m_map(t), m_obj(o) {} - virtual ~insert_obj_map() {} - virtual void undo(Ctx & ctx) { m_map.remove(m_obj); } + ~insert_obj_map() override {} + void undo(Ctx & ctx) override { m_map.remove(m_obj); } }; template @@ -138,8 +138,8 @@ class insert_map : public trail { D m_obj; public: insert_map(M& t, D o) : m_map(t), m_obj(o) {} - virtual ~insert_map() {} - virtual void undo(Ctx & ctx) { m_map.remove(m_obj); } + ~insert_map() override {} + void undo(Ctx & ctx) override { m_map.remove(m_obj); } }; @@ -152,7 +152,7 @@ public: m_vector(v) { } - virtual void undo(Ctx & ctx) { + void undo(Ctx & ctx) override { m_vector.pop_back(); } }; @@ -167,10 +167,10 @@ public: m_idx(idx) { } - virtual ~set_vector_idx_trail() { + ~set_vector_idx_trail() override { } - virtual void undo(Ctx & ctx) { + void undo(Ctx & ctx) override { m_vector[m_idx] = 0; } }; @@ -218,7 +218,7 @@ public: m_vector(v) { } - virtual void undo(Ctx & ctx) { + void undo(Ctx & ctx) override { m_vector.pop_back(); } }; @@ -251,7 +251,7 @@ public: m_vector[m_idx] = true; } - virtual void undo(Ctx & ctx) { + void undo(Ctx & ctx) override { m_vector[m_idx] = false; } }; @@ -264,7 +264,7 @@ public: m_obj(obj) { } - virtual void undo(Ctx & ctx) { + void undo(Ctx & ctx) override { dealloc(m_obj); } }; @@ -288,8 +288,8 @@ class insert_obj_trail : public trail { T* m_obj; public: insert_obj_trail(obj_hashtable& t, T* o) : m_table(t), m_obj(o) {} - virtual ~insert_obj_trail() {} - virtual void undo(Ctx & ctx) { m_table.remove(m_obj); } + ~insert_obj_trail() override {} + void undo(Ctx & ctx) override { m_table.remove(m_obj); } }; diff --git a/src/util/union_find.h b/src/util/union_find.h index 416b653af..9dd0b6fbd 100644 --- a/src/util/union_find.h +++ b/src/util/union_find.h @@ -52,8 +52,8 @@ class union_find { union_find & m_owner; public: mk_var_trail(union_find & o):m_owner(o) {} - virtual ~mk_var_trail() {} - virtual void undo(Ctx & ctx) { + ~mk_var_trail() override {} + void undo(Ctx & ctx) override { m_owner.m_find.pop_back(); m_owner.m_size.pop_back(); m_owner.m_next.pop_back(); @@ -70,8 +70,8 @@ class union_find { unsigned m_r1; public: merge_trail(union_find & o, unsigned r1):m_owner(o), m_r1(r1) {} - virtual ~merge_trail() {} - virtual void undo(Ctx & ctx) { m_owner.unmerge(m_r1); } + ~merge_trail() override {} + void undo(Ctx & ctx) override { m_owner.unmerge(m_r1); } }; void unmerge(unsigned r1) {