3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-12 12:08:18 +00:00

Use override rather than virtual.

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

View file

@ -27,13 +27,13 @@ public:
: m(m), m_p(p) : 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, goal_ref_buffer & result,
model_converter_ref & mc, model_converter_ref & mc,
proof_converter_ref & pc, proof_converter_ref & pc,
expr_dependency_ref & core) { expr_dependency_ref & core) override {
mc = 0; mc = 0;
tactic_report report("ackermannize", *g); tactic_report report("ackermannize", *g);
fail_if_unsat_core_generation("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); ackermannize_bv_tactic_params p(_p);
m_lemma_limit = p.div0_ackermann_limit(); 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); 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); 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); return alloc(ackermannize_bv_tactic, m, m_p);
} }
private: private:

View file

@ -57,7 +57,7 @@ class ackr_bound_probe : public probe {
public: public:
ackr_bound_probe() {} ackr_bound_probe() {}
virtual result operator()(goal const & g) { result operator()(goal const & g) override {
proc p(g.m()); proc p(g.m());
unsigned sz = g.size(); unsigned sz = g.size();
expr_fast_mark1 visited; expr_fast_mark1 visited;

View file

@ -37,9 +37,9 @@ public:
, fixed_model(false) , 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(goal_idx == 0);
SASSERT(!fixed_model || md.get() == 0 || (!md->get_num_constants() && !md->get_num_functions())); SASSERT(!fixed_model || md.get() == 0 || (!md->get_num_constants() && !md->get_num_functions()));
model_ref& old_model = fixed_model ? abstr_model : md; model_ref& old_model = fixed_model ? abstr_model : md;
@ -49,9 +49,9 @@ public:
md = new_model; 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); ackr_info_ref retv_info = info->translate(translator);
if (fixed_model) { if (fixed_model) {
model_ref retv_mod_ref = abstr_model->translate(translator); model_ref retv_mod_ref = abstr_model->translate(translator);

View file

@ -28,9 +28,9 @@ public:
, model_constructor(lmc) , 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(goal_idx == 0);
SASSERT(md.get() == 0 || (!md->get_num_constants() && !md->get_num_functions())); SASSERT(md.get() == 0 || (!md->get_num_constants() && !md->get_num_functions()));
SASSERT(model_constructor.get()); SASSERT(model_constructor.get());
@ -39,13 +39,13 @@ public:
model_constructor->make_model(md); model_constructor->make_model(md);
} }
virtual void operator()(model_ref & md) { void operator()(model_ref & md) override {
operator()(md, 0); operator()(md, 0);
} }
//void display(std::ostream & out); //void display(std::ostream & out);
virtual model_converter * translate(ast_translation & translator) { model_converter * translate(ast_translation & translator) override {
NOT_IMPLEMENTED_YET(); NOT_IMPLEMENTED_YET();
} }
protected: protected:

View file

@ -345,9 +345,9 @@ extern "C" {
public: public:
vector_var2anum(scoped_anum_vector & as):m_as(as) {} vector_var2anum(scoped_anum_vector & as):m_as(as) {}
virtual ~vector_var2anum() {} virtual ~vector_var2anum() {}
virtual algebraic_numbers::manager & m() const { return m_as.m(); } algebraic_numbers::manager & m() const override { return m_as.m(); }
virtual bool contains(polynomial::var x) const { return static_cast<unsigned>(x) < m_as.size(); } bool contains(polynomial::var x) const override { return static_cast<unsigned>(x) < m_as.size(); }
virtual algebraic_numbers::anum const & operator()(polynomial::var x) const { return m_as.get(x); } 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[]) { Z3_ast_vector Z3_API Z3_algebraic_roots(Z3_context c, Z3_ast p, unsigned n, Z3_ast a[]) {

View file

@ -25,7 +25,7 @@ struct Z3_ast_map_ref : public api::object {
ast_manager & m; ast_manager & m;
obj_map<ast, ast*> m_map; obj_map<ast, ast*> m_map;
Z3_ast_map_ref(api::context& c, ast_manager & _m): api::object(c), m(_m) {} 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<Z3_ast_map_ref *>(v); } inline Z3_ast_map_ref * to_ast_map(Z3_ast_map v) { return reinterpret_cast<Z3_ast_map_ref *>(v); }

View file

@ -27,7 +27,7 @@ namespace api {
struct Z3_ast_vector_ref : public api::object { struct Z3_ast_vector_ref : public api::object {
ast_ref_vector m_ast_vector; ast_ref_vector m_ast_vector;
Z3_ast_vector_ref(api::context& c, ast_manager & m): api::object(c), m_ast_vector(m) {} 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<Z3_ast_vector_ref *>(v); } inline Z3_ast_vector_ref * to_ast_vector(Z3_ast_vector v) { return reinterpret_cast<Z3_ast_vector_ref *>(v); }

View file

@ -51,8 +51,8 @@ namespace api {
m_context(m, m_register_engine, p), m_context(m, m_register_engine, p),
m_trail(m) {} m_trail(m) {}
virtual ~fixedpoint_context() {} ~fixedpoint_context() override {}
family_id get_family_id() const { return const_cast<datalog::context&>(m_context).get_decl_util().get_family_id(); } family_id get_family_id() const override { return const_cast<datalog::context&>(m_context).get_decl_util().get_family_id(); }
void set_state(void* state) { void set_state(void* state) {
SASSERT(!m_state); SASSERT(!m_state);
m_state = state; m_state = state;
@ -73,7 +73,7 @@ namespace api {
void set_reduce_assign(reduce_assign_callback_fptr f) { void set_reduce_assign(reduce_assign_callback_fptr f) {
m_reduce_assign = 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; expr* r = 0;
if (m_reduce_app) { if (m_reduce_app) {
m_reduce_app(m_state, f, num_args, args, &r); m_reduce_app(m_state, f, num_args, args, &r);
@ -90,7 +90,7 @@ namespace api {
result = m.mk_app(f, num_args, args); 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) { if (m_reduce_assign) {
m_trail.push_back(f); m_trail.push_back(f);
for (unsigned i = 0; i < num_args; ++i) { for (unsigned i = 0; i < num_args; ++i) {

View file

@ -38,7 +38,7 @@ struct Z3_fixedpoint_ref : public api::object {
api::fixedpoint_context * m_datalog; api::fixedpoint_context * m_datalog;
params_ref m_params; params_ref m_params;
Z3_fixedpoint_ref(api::context& c): api::object(c), m_datalog(0) {} 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<Z3_fixedpoint_ref *>(s); } inline Z3_fixedpoint_ref * to_fixedpoint(Z3_fixedpoint s) { return reinterpret_cast<Z3_fixedpoint_ref *>(s); }

View file

@ -24,7 +24,7 @@ Revision History:
struct Z3_goal_ref : public api::object { struct Z3_goal_ref : public api::object {
goal_ref m_goal; goal_ref m_goal;
Z3_goal_ref(api::context& c) : api::object(c) {} 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<Z3_goal_ref *>(g); } inline Z3_goal_ref * to_goal(Z3_goal g) { return reinterpret_cast<Z3_goal_ref *>(g); }

View file

@ -24,7 +24,7 @@ Revision History:
struct Z3_model_ref : public api::object { struct Z3_model_ref : public api::object {
model_ref m_model; model_ref m_model;
Z3_model_ref(api::context& c): api::object(c) {} 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<Z3_model_ref *>(s); } inline Z3_model_ref * to_model(Z3_model s) { return reinterpret_cast<Z3_model_ref *>(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. model_ref m_model; // must have it to prevent reference to m_func_interp to be killed.
func_interp * m_func_interp; func_interp * m_func_interp;
Z3_func_interp_ref(api::context& c, model * m): api::object(c), m_model(m), m_func_interp(0) {} 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<Z3_func_interp_ref *>(s); } inline Z3_func_interp_ref * to_func_interp(Z3_func_interp s) { return reinterpret_cast<Z3_func_interp_ref *>(s); }
@ -47,7 +47,7 @@ struct Z3_func_entry_ref : public api::object {
func_interp * m_func_interp; func_interp * m_func_interp;
func_entry const * m_func_entry; 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) {} 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<Z3_func_entry_ref *>(s); } inline Z3_func_entry_ref * to_func_entry(Z3_func_entry s) { return reinterpret_cast<Z3_func_entry_ref *>(s); }

View file

@ -36,7 +36,7 @@ extern "C" {
struct Z3_optimize_ref : public api::object { struct Z3_optimize_ref : public api::object {
opt::context* m_opt; opt::context* m_opt;
Z3_optimize_ref(api::context& c): api::object(c), m_opt(0) {} 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<Z3_optimize_ref *>(o); } inline Z3_optimize_ref * to_optimize(Z3_optimize o) { return reinterpret_cast<Z3_optimize_ref *>(o); }
inline Z3_optimize of_optimize(Z3_optimize_ref * o) { return reinterpret_cast<Z3_optimize>(o); } inline Z3_optimize of_optimize(Z3_optimize_ref * o) { return reinterpret_cast<Z3_optimize>(o); }

View file

@ -27,7 +27,7 @@ struct Z3_solver_ref : public api::object {
params_ref m_params; params_ref m_params;
symbol m_logic; 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) {} 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<Z3_solver_ref *>(s); } inline Z3_solver_ref * to_solver(Z3_solver s) { return reinterpret_cast<Z3_solver_ref *>(s); }

View file

@ -24,7 +24,7 @@ Revision History:
struct Z3_stats_ref : public api::object { struct Z3_stats_ref : public api::object {
statistics m_stats; statistics m_stats;
Z3_stats_ref(api::context& c): api::object(c) {} 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<Z3_stats_ref *>(s); } inline Z3_stats_ref * to_stats(Z3_stats s) { return reinterpret_cast<Z3_stats_ref *>(s); }

View file

@ -29,13 +29,13 @@ namespace api {
struct Z3_tactic_ref : public api::object { struct Z3_tactic_ref : public api::object {
tactic_ref m_tactic; tactic_ref m_tactic;
Z3_tactic_ref(api::context& c): api::object(c) {} Z3_tactic_ref(api::context& c): api::object(c) {}
virtual ~Z3_tactic_ref() {} ~Z3_tactic_ref() override {}
}; };
struct Z3_probe_ref : public api::object { struct Z3_probe_ref : public api::object {
probe_ref m_probe; probe_ref m_probe;
Z3_probe_ref(api::context& c):api::object(c) {} 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<Z3_tactic_ref *>(g); } inline Z3_tactic_ref * to_tactic(Z3_tactic g) { return reinterpret_cast<Z3_tactic_ref *>(g); }
@ -52,7 +52,7 @@ struct Z3_apply_result_ref : public api::object {
proof_converter_ref m_pc; proof_converter_ref m_pc;
expr_dependency_ref m_core; expr_dependency_ref m_core;
Z3_apply_result_ref(api::context& c, ast_manager & m); 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<Z3_apply_result_ref *>(g); } inline Z3_apply_result_ref * to_apply_result(Z3_apply_result g) { return reinterpret_cast<Z3_apply_result_ref *>(g); }

View file

@ -88,7 +88,7 @@ inline lbool to_lbool(Z3_lbool b) { return static_cast<lbool>(b); }
struct Z3_params_ref : public api::object { struct Z3_params_ref : public api::object {
params_ref m_params; params_ref m_params;
Z3_params_ref(api::context& c): api::object(c) {} 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<Z3_params_ref *>(p); } inline Z3_params_ref * to_params(Z3_params p) { return reinterpret_cast<Z3_params_ref *>(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 { struct Z3_param_descrs_ref : public api::object {
param_descrs m_descrs; param_descrs m_descrs;
Z3_param_descrs_ref(api::context& c): api::object(c) {} 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<Z3_param_descrs_ref *>(p); } inline Z3_param_descrs_ref * to_param_descrs(Z3_param_descrs p) { return reinterpret_cast<Z3_param_descrs_ref *>(p); }

View file

@ -66,7 +66,7 @@ public:
m.insert(s,t); m.insert(s,t);
} }
virtual void undo(Ctx& ctx) { void undo(Ctx& ctx) override {
m_map.pop(); m_map.pop();
} }
}; };

View file

@ -211,7 +211,7 @@ class iz3proof_itp_impl : public iz3proof_itp {
pivot literal, while the conclusion of premise2 should contain the pivot literal, while the conclusion of premise2 should contain the
pivot literal. pivot literal.
*/ */
node make_resolution(ast pivot, const std::vector<ast> &conc, node premise1, node premise2) { node make_resolution(ast pivot, const std::vector<ast> &conc, node premise1, node premise2) override {
LitType lt = get_term_type(pivot); LitType lt = get_term_type(pivot);
if(lt == LitA) if(lt == LitA)
return my_or(premise1,premise2); 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. */ /** Make an assumption node. The given clause is assumed in the given frame. */
virtual node make_assumption(int frame, const std::vector<ast> &assumption){ node make_assumption(int frame, const std::vector<ast> &assumption) override {
if(!weak){ if(!weak){
if(pv->in_range(frame,rng)){ if(pv->in_range(frame,rng)){
std::vector<ast> itp_clause; std::vector<ast> itp_clause;
@ -2219,7 +2219,7 @@ class iz3proof_itp_impl : public iz3proof_itp {
/** Make a modus-ponens node. This takes derivations of |- x /** Make a modus-ponens node. This takes derivations of |- x
and |- x = y and produces |- y */ 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 */ /* Interpolate the axiom p, p=q -> q */
ast p = arg(p_eq_q,0); 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. */ /** Make an axiom node. The conclusion must be an instance of an axiom. */
virtual node make_axiom(const std::vector<ast> &conclusion, prover::range frng){ node make_axiom(const std::vector<ast> &conclusion, prover::range frng) override {
int nargs = conclusion.size(); int nargs = conclusion.size();
std::vector<ast> largs(nargs); std::vector<ast> largs(nargs);
std::vector<ast> eqs; std::vector<ast> eqs;
@ -2306,20 +2306,20 @@ class iz3proof_itp_impl : public iz3proof_itp {
return capture_localization(itp); return capture_localization(itp);
} }
virtual node make_axiom(const std::vector<ast> &conclusion){ node make_axiom(const std::vector<ast> &conclusion) override {
return make_axiom(conclusion,pv->range_full()); return make_axiom(conclusion,pv->range_full());
} }
/** Make a Contra node. This rule takes a derivation of the form /** Make a Contra node. This rule takes a derivation of the form
Gamma |- False and produces |- \/~Gamma. */ Gamma |- False and produces |- \/~Gamma. */
virtual node make_contra(node prem, const std::vector<ast> &conclusion){ node make_contra(node prem, const std::vector<ast> &conclusion) override {
return prem; return prem;
} }
/** Make hypothesis. Creates a node of the form P |- P. */ /** 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)) if(is_not(P))
return make_hypothesis(arg(P,0)); return make_hypothesis(arg(P,0));
switch(get_term_type(P)){ 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 */ /** 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) if(get_term_type(con) == LitA)
return mk_false(); return mk_false();
if(get_term_type(con) == LitB) 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 /** Make a Symmetry node. This takes a derivation of |- x = y and
produces | y = x. Ditto for ~(x=y) */ 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 #if 0
ast x = arg(con,0); ast x = arg(con,0);
ast y = arg(con,1); 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 /** Make a transitivity node. This takes derivations of |- x = y
and |- y = z produces | x = z */ 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 */ /* Interpolate the axiom x=y,y=z,-> x=z */
ast p = make_equiv_rel(x,y); 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 /** Make a congruence node. This takes derivations of |- x_i = y_i
and produces |- f(x_1,...,x_n) = f(y_1,...,y_n) */ 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 x = arg(p,0), y = arg(p,1);
ast itp; ast itp;
LitType con_t = get_term_type(con); 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,... /** 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...) */ and produces |- f(...x_i1...x_i2...) = f(...y_i1...y_i2...) */
node make_congruence(const std::vector<ast> &p, const ast &con, const std::vector<ast> &prems){ node make_congruence(const std::vector<ast> &p, const ast &con, const std::vector<ast> &prems) override {
if(p.size() == 0) if(p.size() == 0)
throw proof_error(); throw proof_error();
if(p.size() == 1) if(p.size() == 1)
@ -2516,8 +2516,8 @@ class iz3proof_itp_impl : public iz3proof_itp {
/** Make a farkas proof node. */ /** Make a farkas proof node. */
virtual node make_farkas(ast con, const std::vector<node> &prems, const std::vector<ast> &prem_cons, node make_farkas(ast con, const std::vector<node> &prems, const std::vector<ast> &prem_cons,
const std::vector<ast> &coeffs){ const std::vector<ast> &coeffs) override {
/* Compute the interpolant for the clause */ /* 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 */ /* 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 con = make(Equal,x,y);
ast itp; ast itp;
switch(get_term_type(con)){ 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 */ /* 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; ast itp;
switch(get_term_type(xleqy)){ switch(get_term_type(xleqy)){
case LitA: 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 /* 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 */ 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(); ast itp = mk_false();
switch(get_term_type(con)){ switch(get_term_type(con)){
case LitA: case LitA:
@ -2965,7 +2965,7 @@ class iz3proof_itp_impl : public iz3proof_itp {
} }
/* Return an interpolant from a proof of false */ /* 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 // proof of false must be a formula, with quantified symbols
#ifndef BOGUS_QUANTS #ifndef BOGUS_QUANTS
return close_universally(add_quants(z3_simplify(pf))); return close_universally(add_quants(z3_simplify(pf)));
@ -3089,7 +3089,7 @@ public:
m().inc_ref(sexists); m().inc_ref(sexists);
} }
~iz3proof_itp_impl(){ ~iz3proof_itp_impl() override {
m().dec_ref(contra); m().dec_ref(contra);
m().dec_ref(sum); m().dec_ref(sum);
m().dec_ref(rotate_sum); m().dec_ref(rotate_sum);

View file

@ -2068,7 +2068,7 @@ public:
// We actually compute the interpolant here and then produce a proof consisting of just a lemma // 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<ast> itps; std::vector<ast> itps;
scan_skolems(proof); scan_skolems(proof);
for(int i = 0; i < frames -1; i++){ for(int i = 0; i < frames -1; i++){
@ -2114,7 +2114,7 @@ public:
m().inc_ref(commute); m().inc_ref(commute);
} }
~iz3translation_full(){ ~iz3translation_full() override {
m().dec_ref(commute); m().dec_ref(commute);
} }
}; };

View file

@ -1611,7 +1611,7 @@ public:
// 1) Translate ast proof term to Zproof // 1) Translate ast proof term to Zproof
// 2) Translate Zproof to Iproof // 2) Translate Zproof to Iproof
Iproof::node translate(ast proof, Iproof &dst){ Iproof::node translate(ast proof, Iproof &dst) override {
iproof = &dst; iproof = &dst;
Iproof::node Ipf = translate_main(proof,0); // builds result in dst Iproof::node Ipf = translate_main(proof,0); // builds result in dst
return Ipf; return Ipf;
@ -1629,7 +1629,7 @@ public:
traced_lit = ast(); traced_lit = ast();
} }
~iz3translation_direct(){ ~iz3translation_direct() override {
for(hash_map<non_local_lits, non_local_lits *>::iterator for(hash_map<non_local_lits, non_local_lits *>::iterator
it = non_local_lits_unique.begin(), it = non_local_lits_unique.begin(),
en = non_local_lits_unique.end(); en = non_local_lits_unique.end();

View file

@ -81,14 +81,14 @@ class heap_trie {
Value m_value; Value m_value;
public: public:
leaf(): node(leaf_t) {} leaf(): node(leaf_t) {}
virtual ~leaf() {} ~leaf() override {}
Value const& get_value() const { return m_value; } Value const& get_value() const { return m_value; }
void set_value(Value const& v) { m_value = v; } 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; out << " value: " << m_value;
} }
virtual unsigned num_nodes() const { return 1; } unsigned num_nodes() const override { return 1; }
virtual unsigned num_leaves() const { return this->ref_count()>0?1:0; } unsigned num_leaves() const override { return this->ref_count()>0?1:0; }
}; };
typedef buffer<std::pair<Key,node*>, true, 2> children_t; typedef buffer<std::pair<Key,node*>, true, 2> children_t;
@ -99,7 +99,7 @@ class heap_trie {
public: public:
trie(): node(trie_t) {} trie(): node(trie_t) {}
virtual ~trie() { ~trie() override {
} }
node* find_or_insert(Key k, node* n) { 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 const& nodes() const { return m_nodes; }
children_t & nodes() { 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) { for (unsigned j = 0; j < m_nodes.size(); ++j) {
if (j != 0 || indent > 0) { if (j != 0 || indent > 0) {
out << "\n"; out << "\n";
@ -151,7 +151,7 @@ class heap_trie {
} }
} }
virtual unsigned num_nodes() const { unsigned num_nodes() const override {
unsigned sz = 1; unsigned sz = 1;
for (unsigned j = 0; j < m_nodes.size(); ++j) { for (unsigned j = 0; j < m_nodes.size(); ++j) {
sz += m_nodes[j].second->num_nodes(); sz += m_nodes[j].second->num_nodes();
@ -159,7 +159,7 @@ class heap_trie {
return sz; return sz;
} }
virtual unsigned num_leaves() const { unsigned num_leaves() const override {
unsigned sz = 0; unsigned sz = 0;
for (unsigned j = 0; j < m_nodes.size(); ++j) { for (unsigned j = 0; j < m_nodes.size(); ++j) {
sz += m_nodes[j].second->num_leaves(); sz += m_nodes[j].second->num_leaves();

View file

@ -175,7 +175,7 @@ class hilbert_basis::value_index2 {
hilbert_basis* hb; hilbert_basis* hb;
offset_t m_value; offset_t m_value;
checker(): hb(0) {} 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))) { if (m_value.m_offset != v) { // && hb->is_subsumed(m_value, offset_t(v))) {
return true; return true;
} }

View file

@ -1932,9 +1932,9 @@ namespace algebraic_numbers {
imp & m_imp; imp & m_imp;
polynomial::var2anum const & m_x2v; polynomial::var2anum const & m_x2v;
opt_var2basic(imp & i, polynomial::var2anum const & x2v):m_imp(i), m_x2v(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(); } unsynch_mpq_manager & m() const override { return m_imp.qm(); }
virtual bool contains(polynomial::var x) const { return m_x2v.contains(x); } bool contains(polynomial::var x) const override { return m_x2v.contains(x); }
virtual mpq const & operator()(polynomial::var x) const { mpq const & operator()(polynomial::var x) const override {
anum const & v = m_x2v(x); anum const & v = m_x2v(x);
if (!v.is_basic()) if (!v.is_basic())
throw failed(); throw failed();
@ -1949,9 +1949,9 @@ namespace algebraic_numbers {
imp & m_imp; imp & m_imp;
polynomial::var2anum const & m_x2v; polynomial::var2anum const & m_x2v;
var2basic(imp & i, polynomial::var2anum const & x2v):m_imp(i), m_x2v(x2v) {} var2basic(imp & i, polynomial::var2anum const & x2v):m_imp(i), m_x2v(x2v) {}
virtual unsynch_mpq_manager & m() const { return m_imp.qm(); } unsynch_mpq_manager & m() const override { return m_imp.qm(); }
virtual bool contains(polynomial::var x) const { return m_x2v.contains(x) && m_x2v(x).is_basic(); } bool contains(polynomial::var x) const override { return m_x2v.contains(x) && m_x2v(x).is_basic(); }
virtual mpq const & operator()(polynomial::var x) const { mpq const & operator()(polynomial::var x) const override {
anum const & v = m_x2v(x); anum const & v = m_x2v(x);
SASSERT(v.is_basic()); SASSERT(v.is_basic());
TRACE("var2basic", tout << "getting value of x" << x << " -> " << m().to_string(m_imp.basic_value(v)) << "\n";); 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; imp & m_imp;
polynomial::var2anum const & m_x2v; polynomial::var2anum const & m_x2v;
var2interval(imp & i, polynomial::var2anum const & x2v):m_imp(i), m_x2v(x2v) {} var2interval(imp & i, polynomial::var2anum const & x2v):m_imp(i), m_x2v(x2v) {}
virtual mpbqi_manager & m() const { return m_imp.bqim(); } mpbqi_manager & m() const override { return m_imp.bqim(); }
virtual bool contains(polynomial::var x) const { return m_x2v.contains(x) && !m_x2v(x).is_basic(); } bool contains(polynomial::var x) const override { return m_x2v.contains(x) && !m_x2v(x).is_basic(); }
virtual mpbqi const & operator()(polynomial::var x) const { mpbqi const & operator()(polynomial::var x) const override {
anum const & v = m_x2v(x); anum const & v = m_x2v(x);
SASSERT(!v.is_basic()); SASSERT(!v.is_basic());
return v.to_algebraic()->m_interval; return v.to_algebraic()->m_interval;
@ -2220,9 +2220,9 @@ namespace algebraic_numbers {
m_x(x), m_x(x),
m_v(v) { m_v(v) {
} }
virtual manager & m() const { return m_am; } manager & m() const override { return m_am; }
virtual bool contains(polynomial::var x) const { return x == m_x || m_x2v.contains(x); } bool contains(polynomial::var x) const override { return x == m_x || m_x2v.contains(x); }
virtual anum const & operator()(polynomial::var x) const { anum const & operator()(polynomial::var x) const override {
if (x == m_x) if (x == m_x)
return m_v; return m_v;
else else
@ -2553,9 +2553,9 @@ namespace algebraic_numbers {
m_x2v(x2v), m_x2v(x2v),
m_v(v) { m_v(v) {
} }
virtual manager & m() const { return m_am; } manager & m() const override { return m_am; }
virtual bool contains(polynomial::var x) const { return true; } bool contains(polynomial::var x) const override { return true; }
virtual anum const & operator()(polynomial::var x) const { anum const & operator()(polynomial::var x) const override {
if (m_x2v.contains(x)) if (m_x2v.contains(x))
return m_x2v(x); return m_x2v(x);
else else

View file

@ -6350,9 +6350,9 @@ namespace polynomial {
m_var_pos(buffer, xs_sz, xs), m_var_pos(buffer, xs_sz, xs),
m_vs(vs) { m_vs(vs) {
} }
virtual unsynch_mpq_manager & m() const { UNREACHABLE(); static unsynch_mpq_manager m; return m; } unsynch_mpq_manager & m() const override { UNREACHABLE(); static unsynch_mpq_manager m; return m; }
virtual bool contains(var x) const { return m_var_pos(x) != UINT_MAX; } bool contains(var x) const override { return m_var_pos(x) != UINT_MAX; }
virtual mpq const & operator()(var x) const { return m_vs[m_var_pos(x)]; } 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) { polynomial * substitute(polynomial const * p, unsigned xs_sz, var const * xs, mpq const * vs) {
@ -6527,9 +6527,9 @@ namespace polynomial {
numeral const & m_val; numeral const & m_val;
public: public:
single_var2value(numeral_manager & m, var x, numeral const & val):m_manager(m), m_x(x), m_val(val) {} 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; } numeral_manager & m() const override { return m_manager; }
virtual bool contains(var x) const { return m_x == x; } bool contains(var x) const override { return m_x == x; }
virtual numeral const & operator()(var x) const { SASSERT(m_x == x); return m_val; } 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) { void univ_eval(polynomial const * p, var x, numeral const & val, numeral & r) {

View file

@ -322,7 +322,7 @@ namespace upolynomial {
/** /**
\brief Filter the ones not in the degree set. \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 // select only the ones that have degrees in the degree set
if (!m_degree_set.in_set(current_degree())) { if (!m_degree_set.in_set(current_degree())) {

View file

@ -344,13 +344,13 @@ namespace realclosure {
// --------------------------------- // ---------------------------------
struct mk_pi_interval : public mk_interval { 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); im.pi(k, r);
} }
}; };
struct mk_e_interval : public mk_interval { 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); im.e(k, r);
} }
}; };

View file

@ -38,22 +38,22 @@ namespace subpaving {
CTX m_ctx; CTX m_ctx;
public: public:
context_wrapper(reslimit& lim, typename CTX::numeral_manager & m, params_ref const & p, small_object_allocator * a):m_ctx(lim, m, p, a) {} 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() {} ~context_wrapper() override {}
virtual unsigned num_vars() const { return m_ctx.num_vars(); } unsigned num_vars() const override { return m_ctx.num_vars(); }
virtual var mk_var(bool is_int) { return m_ctx.mk_var(is_int); } var mk_var(bool is_int) override { return m_ctx.mk_var(is_int); }
virtual bool is_int(var x) const { return m_ctx.is_int(x); } bool is_int(var x) const override { return m_ctx.is_int(x); }
virtual var mk_monomial(unsigned sz, power const * pws) { return m_ctx.mk_monomial(sz, pws); } var mk_monomial(unsigned sz, power const * pws) override { return m_ctx.mk_monomial(sz, pws); }
virtual void inc_ref(ineq * a) { m_ctx.inc_ref(reinterpret_cast<typename CTX::ineq*>(a)); } void inc_ref(ineq * a) override { m_ctx.inc_ref(reinterpret_cast<typename CTX::ineq*>(a)); }
virtual void dec_ref(ineq * a) { m_ctx.dec_ref(reinterpret_cast<typename CTX::ineq*>(a)); } void dec_ref(ineq * a) override { m_ctx.dec_ref(reinterpret_cast<typename CTX::ineq*>(a)); }
virtual void add_clause(unsigned sz, ineq * const * atoms) { m_ctx.add_clause(sz, reinterpret_cast<typename CTX::ineq * const *>(atoms)); } void add_clause(unsigned sz, ineq * const * atoms) override { m_ctx.add_clause(sz, reinterpret_cast<typename CTX::ineq * const *>(atoms)); }
virtual void display_constraints(std::ostream & out, bool use_star) const { m_ctx.display_constraints(out, use_star); } void display_constraints(std::ostream & out, bool use_star) const override { m_ctx.display_constraints(out, use_star); }
virtual void set_display_proc(display_var_proc * p) { m_ctx.set_display_proc(p); } void set_display_proc(display_var_proc * p) override { m_ctx.set_display_proc(p); }
virtual void reset_statistics() { m_ctx.reset_statistics(); } void reset_statistics() override { m_ctx.reset_statistics(); }
virtual void collect_statistics(statistics & st) const { m_ctx.collect_statistics(st); } void collect_statistics(statistics & st) const override { m_ctx.collect_statistics(st); }
virtual void collect_param_descrs(param_descrs & r) { m_ctx.collect_param_descrs(r); } void collect_param_descrs(param_descrs & r) override { m_ctx.collect_param_descrs(r); }
virtual void updt_params(params_ref const & p) { m_ctx.updt_params(p); } void updt_params(params_ref const & p) override { m_ctx.updt_params(p); }
virtual void operator()() { m_ctx(); } void operator()() override { m_ctx(); }
virtual void display_bounds(std::ostream & out) const { m_ctx.display_bounds(out); } void display_bounds(std::ostream & out) const override { m_ctx.display_bounds(out); }
}; };
class context_mpq_wrapper : public context_wrapper<context_mpq> { class context_mpq_wrapper : public context_wrapper<context_mpq> {
@ -66,11 +66,11 @@ namespace subpaving {
m_as(m) 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); m_as.reserve(sz);
for (unsigned i = 0; i < sz; i++) { for (unsigned i = 0; i < sz; i++) {
m_ctx.nm().set(m_as[i], as[i]); m_ctx.nm().set(m_as[i], as[i]);
@ -78,7 +78,7 @@ namespace subpaving {
m_ctx.nm().set(m_c, c); m_ctx.nm().set(m_c, c);
return m_ctx.mk_sum(m_c, sz, m_as.c_ptr(), xs); 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<ineq*>(m_ctx.mk_ineq(x, k, lower, open)); return reinterpret_cast<ineq*>(m_ctx.mk_ineq(x, k, lower, open));
} }
}; };
@ -108,11 +108,11 @@ namespace subpaving {
m_q2(m_qm) { 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 { try {
m_as.reserve(sz); m_as.reserve(sz);
for (unsigned i = 0; i < sz; i++) { for (unsigned i = 0; i < sz; i++) {
@ -125,7 +125,7 @@ namespace subpaving {
throw subpaving::exception(); 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 { try {
f2n<mpf_manager> & m = m_ctx.nm(); f2n<mpf_manager> & m = m_ctx.nm();
if (lower) if (lower)
@ -165,11 +165,11 @@ namespace subpaving {
m_qm(qm) { 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 { try {
m_as.reserve(sz); m_as.reserve(sz);
for (unsigned i = 0; i < sz; i++) { for (unsigned i = 0; i < sz; i++) {
@ -182,7 +182,7 @@ namespace subpaving {
throw subpaving::exception(); 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 { try {
f2n<hwf_manager> & m = m_ctx.nm(); f2n<hwf_manager> & m = m_ctx.nm();
if (lower) if (lower)
@ -223,11 +223,11 @@ namespace subpaving {
m_z2(m_qm) { 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 { try {
m_as.reserve(sz); m_as.reserve(sz);
for (unsigned i = 0; i < sz; i++) { 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 { try {
typename context_fpoint::numeral_manager & m = this->m_ctx.nm(); typename context_fpoint::numeral_manager & m = this->m_ctx.nm();
if (lower) if (lower)

View file

@ -36,7 +36,7 @@ public:
context_t<C>::node_selector(ctx) { context_t<C>::node_selector(ctx) {
} }
virtual node * operator()(node * front, node * back) { node * operator()(node * front, node * back) override {
return back; return back;
} }
}; };
@ -80,7 +80,7 @@ public:
} }
// Return the next variable to branch. // Return the next variable to branch.
virtual var operator()(typename context_t<C>::node * n) { var operator()(typename context_t<C>::node * n) override {
typename context_t<C>::numeral_manager & nm = this->ctx()->nm(); typename context_t<C>::numeral_manager & nm = this->ctx()->nm();
SASSERT(this->ctx()->num_vars() > 0); SASSERT(this->ctx()->num_vars() > 0);
var x = this->ctx()->splitting_var(n); var x = this->ctx()->splitting_var(n);
@ -197,7 +197,7 @@ public:
SASSERT(m_delta < INT_MAX); SASSERT(m_delta < INT_MAX);
} }
virtual void operator()(node * n, var x) { void operator()(node * n, var x) override {
SASSERT(!n->inconsistent()); SASSERT(!n->inconsistent());
numeral_manager & nm = this->ctx()->nm(); numeral_manager & nm = this->ctx()->nm();
node * left = this->mk_node(n); node * left = this->mk_node(n);

View file

@ -40,7 +40,7 @@ class subpaving_tactic : public tactic {
ast_manager & m() const { return m_inv.get_manager(); } 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); expr * t = m_inv.get(x, 0);
if (t != 0) if (t != 0)
out << mk_ismt2_pp(t, m()); out << mk_ismt2_pp(t, m());
@ -216,36 +216,36 @@ public:
m_params(p) { m_params(p) {
} }
virtual ~subpaving_tactic() { ~subpaving_tactic() override {
dealloc(m_imp); dealloc(m_imp);
} }
virtual tactic * translate(ast_manager & m) { tactic * translate(ast_manager & m) override {
return alloc(subpaving_tactic, m, m_params); 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_params = p;
m_imp->updt_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); m_imp->collect_param_descrs(r);
} }
virtual void collect_statistics(statistics & st) const { void collect_statistics(statistics & st) const override {
st.copy(m_stats); st.copy(m_stats);
} }
virtual void reset_statistics() { void reset_statistics() override {
m_stats.reset(); m_stats.reset();
} }
virtual void operator()(goal_ref const & in, void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result,
model_converter_ref & mc, model_converter_ref & mc,
proof_converter_ref & pc, proof_converter_ref & pc,
expr_dependency_ref & core) { expr_dependency_ref & core) override {
try { try {
m_imp->process(*in); m_imp->process(*in);
m_imp->collect_statistics(m_stats); m_imp->collect_statistics(m_stats);
@ -261,7 +261,7 @@ public:
} }
} }
virtual void cleanup() { void cleanup() override {
ast_manager & m = m_imp->m(); ast_manager & m = m_imp->m();
dealloc(m_imp); dealloc(m_imp);
m_imp = alloc(imp, m, m_params); m_imp = alloc(imp, m, m_params);

View file

@ -90,10 +90,10 @@ namespace datalog {
return idx; return idx;
} }
virtual unsigned get_constant_count() const { unsigned get_constant_count() const override {
return m_el_names.size(); 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()) { if (el_num>=m_el_names.size()) {
out << el_num; out << el_num;
return; return;
@ -132,10 +132,10 @@ namespace datalog {
} }
return idx; return idx;
} }
virtual unsigned get_constant_count() const { unsigned get_constant_count() const override {
return m_el_names.size(); 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()) { if (el_num >= m_el_names.size()) {
out << "<unk " << m_sort->get_name() << ":" << el_num << '>'; out << "<unk " << m_sort->get_name() << ":" << el_num << '>';
return; return;
@ -159,9 +159,9 @@ namespace datalog {
public: public:
restore_rules(rule_set& r): m_old_rules(alloc(rule_set, r)) {} 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); ctx.replace_rules(*m_old_rules);
reset(); reset();
} }
@ -173,8 +173,8 @@ namespace datalog {
unsigned m_old_size; unsigned m_old_size;
public: public:
restore_vec_size_trail(Vec& v): m_vector(v), m_old_size(v.size()) {} restore_vec_size_trail(Vec& v): m_vector(v), m_old_size(v.size()) {}
virtual ~restore_vec_size_trail() {} ~restore_vec_size_trail() override {}
virtual void undo(Ctx& ctx) { m_vector.shrink(m_old_size); } void undo(Ctx& ctx) override { m_vector.shrink(m_old_size); }
}; };
void context::push() { void context::push() {

View file

@ -110,7 +110,7 @@ namespace datalog {
class rel_context_base : public engine_base { class rel_context_base : public engine_base {
public: public:
rel_context_base(ast_manager& m, char const* name): engine_base(m, name) {} 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 relation_manager & get_rmanager() = 0;
virtual const relation_manager & get_rmanager() const = 0; virtual const relation_manager & get_rmanager() const = 0;
virtual relation_base & get_relation(func_decl * pred) = 0; virtual relation_base & get_relation(func_decl * pred) = 0;
@ -146,9 +146,9 @@ namespace datalog {
context const& ctx; context const& ctx;
public: public:
contains_pred(context& ctx): ctx(ctx) {} 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); return ctx.is_predicate(e);
} }
}; };

View file

@ -385,7 +385,7 @@ namespace datalog {
public: public:
skip_model_converter() {} skip_model_converter() {}
virtual model_converter * translate(ast_translation & translator) { model_converter * translate(ast_translation & translator) override {
return alloc(skip_model_converter); return alloc(skip_model_converter);
} }
@ -394,12 +394,12 @@ namespace datalog {
model_converter* mk_skip_model_converter() { return alloc(skip_model_converter); } model_converter* mk_skip_model_converter() { return alloc(skip_model_converter); }
class skip_proof_converter : public proof_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); SASSERT(num_source == 1);
result = source[0]; result = source[0];
} }
virtual proof_converter * translate(ast_translation & translator) { proof_converter * translate(ast_translation & translator) override {
return alloc(skip_proof_converter); return alloc(skip_proof_converter);
} }

View file

@ -55,18 +55,18 @@ namespace datalog {
public: public:
bmc(context& ctx); 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 reset_statistics() override;
void get_rules_along_trace(datalog::rule_ref_vector& rules); 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. // direct access to (new) non-linear compiler.
void compile(rule_set const& rules, expr_ref_vector& fmls, unsigned level); void compile(rule_set const& rules, expr_ref_vector& fmls, unsigned level);

View file

@ -32,12 +32,12 @@ namespace datalog {
imp* m_imp; imp* m_imp;
public: public:
clp(context& ctx); clp(context& ctx);
~clp(); ~clp() override;
virtual lbool query(expr* query); lbool query(expr* query) override;
virtual void reset_statistics(); void reset_statistics() override;
virtual void collect_statistics(statistics& st) const; void collect_statistics(statistics& st) const override;
virtual void display_certificate(std::ostream& out) const; void display_certificate(std::ostream& out) const override;
virtual expr_ref get_answer(); expr_ref get_answer() override;
}; };
}; };

View file

@ -35,12 +35,12 @@ namespace datalog {
imp* m_imp; imp* m_imp;
public: public:
ddnf(context& ctx); ddnf(context& ctx);
~ddnf(); ~ddnf() override;
virtual lbool query(expr* query); lbool query(expr* query) override;
virtual void reset_statistics(); void reset_statistics() override;
virtual void collect_statistics(statistics& st) const; void collect_statistics(statistics& st) const override;
virtual void display_certificate(std::ostream& out) const; void display_certificate(std::ostream& out) const override;
virtual expr_ref get_answer(); expr_ref get_answer() override;
}; };
class ddnf_node; class ddnf_node;

View file

@ -41,33 +41,33 @@ namespace Duality {
public: public:
dl_interface(datalog::context& ctx); 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;} duality_data *dd(){return _d;}

View file

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

View file

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

View file

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

View file

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

View file

@ -47,29 +47,29 @@ namespace pdr {
public: public:
dl_interface(datalog::context& ctx); 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;
}; };
} }

View file

@ -30,8 +30,8 @@ namespace pdr {
unsigned m_failure_limit; unsigned m_failure_limit;
public: public:
core_bool_inductive_generalizer(context& ctx, unsigned failure_limit) : core_generalizer(ctx), m_failure_limit(failure_limit) {} core_bool_inductive_generalizer(context& ctx, unsigned failure_limit) : core_generalizer(ctx), m_failure_limit(failure_limit) {}
virtual ~core_bool_inductive_generalizer() {} ~core_bool_inductive_generalizer() override {}
virtual void operator()(model_node& n, expr_ref_vector& core, bool& uses_level); void operator()(model_node& n, expr_ref_vector& core, bool& uses_level) override;
}; };
template <typename T> template <typename T>
@ -61,17 +61,17 @@ namespace pdr {
bool substitute_alias(rational const&r, expr* x, expr* e, expr_ref& result); bool substitute_alias(rational const&r, expr* x, expr* e, expr_ref& result);
public: public:
core_arith_inductive_generalizer(context& ctx); core_arith_inductive_generalizer(context& ctx);
virtual ~core_arith_inductive_generalizer() {} ~core_arith_inductive_generalizer() override {}
virtual void operator()(model_node& n, expr_ref_vector& core, bool& uses_level); void operator()(model_node& n, expr_ref_vector& core, bool& uses_level) override;
}; };
class core_farkas_generalizer : public core_generalizer { class core_farkas_generalizer : public core_generalizer {
farkas_learner m_farkas_learner; farkas_learner m_farkas_learner;
public: public:
core_farkas_generalizer(context& ctx, ast_manager& m, smt_params& p); core_farkas_generalizer(context& ctx, ast_manager& m, smt_params& p);
virtual ~core_farkas_generalizer() {} ~core_farkas_generalizer() override {}
virtual void operator()(model_node& n, expr_ref_vector& core, bool& uses_level); void operator()(model_node& n, expr_ref_vector& core, bool& uses_level) override;
virtual void collect_statistics(statistics& st) const; void collect_statistics(statistics& st) const override;
}; };
@ -85,26 +85,26 @@ namespace pdr {
bool is_unsat(expr_ref_vector const& As, expr* B); bool is_unsat(expr_ref_vector const& As, expr* B);
public: public:
core_convex_hull_generalizer(context& ctx, bool is_closure); core_convex_hull_generalizer(context& ctx, bool is_closure);
virtual ~core_convex_hull_generalizer() {} ~core_convex_hull_generalizer() override {}
virtual void operator()(model_node& n, expr_ref_vector const& core, bool uses_level, cores& new_cores); void operator()(model_node& n, expr_ref_vector const& core, bool uses_level, cores& new_cores) override;
virtual void operator()(model_node& n, expr_ref_vector& core, bool& uses_level); void operator()(model_node& n, expr_ref_vector& core, bool& uses_level) override;
}; };
class core_multi_generalizer : public core_generalizer { class core_multi_generalizer : public core_generalizer {
core_bool_inductive_generalizer m_gen; core_bool_inductive_generalizer m_gen;
public: public:
core_multi_generalizer(context& ctx, unsigned max_failures): core_generalizer(ctx), m_gen(ctx, max_failures) {} core_multi_generalizer(context& ctx, unsigned max_failures): core_generalizer(ctx), m_gen(ctx, max_failures) {}
virtual ~core_multi_generalizer() {} ~core_multi_generalizer() override {}
virtual void operator()(model_node& n, expr_ref_vector& core, bool& uses_level); void operator()(model_node& n, expr_ref_vector& core, bool& uses_level) override;
virtual void operator()(model_node& n, expr_ref_vector const& core, bool uses_level, cores& new_cores); 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 core_induction_generalizer : public core_generalizer {
class imp; class imp;
public: public:
core_induction_generalizer(context& ctx): core_generalizer(ctx) {} core_induction_generalizer(context& ctx): core_generalizer(ctx) {}
virtual ~core_induction_generalizer() {} ~core_induction_generalizer() override {}
virtual void operator()(model_node& n, expr_ref_vector& core, bool& uses_level); void operator()(model_node& n, expr_ref_vector& core, bool& uses_level) override;
}; };
}; };
#endif #endif

View file

@ -59,15 +59,15 @@ namespace pdr {
smt::kernel & m_context; smt::kernel & m_context;
public: public:
_smt_context(smt::kernel & ctx, smt_context_manager& p, app* pred); _smt_context(smt::kernel & ctx, smt_context_manager& p, app* pred);
virtual ~_smt_context() {} ~_smt_context() override {}
virtual void assert_expr(expr* e); void assert_expr(expr* e) override;
virtual lbool check(expr_ref_vector& assumptions); lbool check(expr_ref_vector& assumptions) override;
virtual void get_model(model_ref& model); void get_model(model_ref& model) override;
virtual proof* get_proof(); proof* get_proof() override;
virtual void push() { m_context.push(); } void push() override { m_context.push(); }
virtual void pop() { m_context.pop(1); } void pop() override { m_context.pop(1); }
virtual unsigned get_unsat_core_size() { return m_context.get_unsat_core_size(); } unsigned get_unsat_core_size() override { return m_context.get_unsat_core_size(); }
virtual expr* get_unsat_core_expr(unsigned i) { return m_context.get_unsat_core_expr(i); } expr* get_unsat_core_expr(unsigned i) override { return m_context.get_unsat_core_expr(i); }
}; };
class smt_context_manager { class smt_context_manager {

View file

@ -192,8 +192,8 @@ namespace datalog {
const unsigned * cols1, const unsigned * cols2) const unsigned * cols1, const unsigned * cols2)
: convenient_join_fn(o1_sig, o2_sig, col_cnt, cols1, cols2), m_join(j) : convenient_join_fn(o1_sig, o2_sig, col_cnt, cols1, cols2), m_join(j)
{} {}
virtual ~join_fn() {} ~join_fn() override {}
virtual relation_base * operator()(const relation_base & r1, const relation_base & r2) { relation_base * operator()(const relation_base & r1, const relation_base & r2) override {
check_relation const& t1 = get(r1); check_relation const& t1 = get(r1);
check_relation const& t2 = get(r2); check_relation const& t2 = get(r2);
check_relation_plugin& p = t1.get_plugin(); 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, : convenient_join_project_fn(o1_sig, o2_sig, col_cnt, cols1, cols2,
removed_col_cnt, removed_cols), m_join(j) removed_col_cnt, removed_cols), m_join(j)
{} {}
virtual ~join_project_fn() {} ~join_project_fn() override {}
virtual relation_base * operator()(const relation_base & r1, const relation_base & r2) { relation_base * operator()(const relation_base & r1, const relation_base & r2) override {
check_relation const& t1 = get(r1); check_relation const& t1 = get(r1);
check_relation const& t2 = get(r2); check_relation const& t2 = get(r2);
check_relation_plugin& p = t1.get_plugin(); check_relation_plugin& p = t1.get_plugin();
@ -491,7 +491,7 @@ namespace datalog {
public: public:
union_fn(relation_union_fn* m): m_union(m) {} 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");); TRACE("doc", _r.display(tout << "dst:\n"); _src.display(tout << "src:\n"););
check_relation& r = get(_r); check_relation& r = get(_r);
check_relation const& src = get(_src); check_relation const& src = get(_src);
@ -529,9 +529,9 @@ namespace datalog {
m_filter(f) { 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& r = get(_r);
check_relation_plugin& p = r.get_plugin(); check_relation_plugin& p = r.get_plugin();
ast_manager& m = p.m; ast_manager& m = p.m;
@ -565,9 +565,9 @@ namespace datalog {
m_condition(condition) { 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& r = get(tb);
check_relation_plugin& p = r.get_plugin(); check_relation_plugin& p = r.get_plugin();
expr_ref fml = r.m_fml; expr_ref fml = r.m_fml;
@ -592,9 +592,9 @@ namespace datalog {
m_project(p) { 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 const& t = get(tb);
check_relation_plugin& p = t.get_plugin(); check_relation_plugin& p = t.get_plugin();
relation_base* r = (*m_project)(t.rb()); relation_base* r = (*m_project)(t.rb());
@ -620,9 +620,9 @@ namespace datalog {
m_permute(permute) { 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 const& t = get(_t);
check_relation_plugin& p = t.get_plugin(); check_relation_plugin& p = t.get_plugin();
relation_signature const& sig = get_result_signature(); relation_signature const& sig = get_result_signature();
@ -649,8 +649,8 @@ namespace datalog {
m_val(val), m_val(val),
m_col(col) m_col(col)
{} {}
virtual ~filter_equal_fn() { } ~filter_equal_fn() override { }
virtual void operator()(relation_base & tb) { void operator()(relation_base & tb) override {
check_relation & t = get(tb); check_relation & t = get(tb);
check_relation_plugin& p = t.get_plugin(); check_relation_plugin& p = t.get_plugin();
(*m_filter)(t.rb()); (*m_filter)(t.rb());
@ -682,7 +682,7 @@ namespace datalog {
SASSERT(joined_col_cnt > 0); 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& t = get(tb);
check_relation const& n = get(negb); check_relation const& n = get(negb);
check_relation_plugin& p = t.get_plugin(); check_relation_plugin& p = t.get_plugin();
@ -763,9 +763,9 @@ namespace datalog {
m_xform(xform) 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 const & t = get(tb);
check_relation_plugin& p = t.get_plugin(); check_relation_plugin& p = t.get_plugin();
relation_base* r = (*m_xform)(t.rb()); relation_base* r = (*m_xform)(t.rb());

View file

@ -38,20 +38,20 @@ namespace datalog {
expr_ref mk_eq(relation_fact const& f) const; expr_ref mk_eq(relation_fact const& f) const;
public: public:
check_relation(check_relation_plugin& p, relation_signature const& s, relation_base* r); check_relation(check_relation_plugin& p, relation_signature const& s, relation_base* r);
virtual ~check_relation(); ~check_relation() override;
virtual void reset(); void reset() override;
virtual void add_fact(const relation_fact & f); void add_fact(const relation_fact & f) override;
virtual void add_new_fact(const relation_fact & f); void add_new_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 check_relation * clone() const; check_relation * clone() const override;
virtual check_relation * complement(func_decl*) const; check_relation * complement(func_decl*) const override;
virtual void to_formula(expr_ref& fml) const; void to_formula(expr_ref& fml) const override;
check_relation_plugin& get_plugin() const; check_relation_plugin& get_plugin() const;
virtual bool fast_empty() const; bool fast_empty() const override;
virtual bool empty() const; bool empty() const override;
virtual void display(std::ostream& out) const; void display(std::ostream& out) const override;
virtual bool is_precise() const { return m_relation->is_precise(); } bool is_precise() const override { return m_relation->is_precise(); }
virtual unsigned get_size_estimate_rows() const { return m_relation->get_size_estimate_rows(); } unsigned get_size_estimate_rows() const override { return m_relation->get_size_estimate_rows(); }
relation_base& rb() { return *m_relation; } relation_base& rb() { return *m_relation; }
relation_base const& rb() const { return *m_relation; } relation_base const& rb() const { return *m_relation; }
expr_ref ground(expr* fml) const; expr_ref ground(expr* fml) const;
@ -90,39 +90,39 @@ namespace datalog {
unsigned_vector const& cols1, unsigned_vector const& cols2); unsigned_vector const& cols1, unsigned_vector const& cols2);
public: public:
check_relation_plugin(relation_manager& rm); check_relation_plugin(relation_manager& rm);
~check_relation_plugin(); ~check_relation_plugin() override;
void set_plugin(relation_plugin* p) { m_base = p; } 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"); } static symbol get_name() { return symbol("check_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;
virtual relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2, relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2,
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override;
virtual relation_join_fn * mk_join_project_fn( relation_join_fn * mk_join_project_fn(
const relation_base & t1, const relation_base & t2, const relation_base & t1, const relation_base & t2,
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2, unsigned col_cnt, const unsigned * cols1, const unsigned * cols2,
unsigned removed_col_cnt, const unsigned * removed_cols); unsigned removed_col_cnt, const unsigned * removed_cols) override;
virtual relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt,
const unsigned * removed_cols); const unsigned * removed_cols) override;
virtual relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len,
const unsigned * permutation_cycle); const unsigned * permutation_cycle) override;
virtual relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src,
const relation_base * delta); const relation_base * delta) override;
virtual relation_union_fn * mk_widen_fn(const relation_base & tgt, const relation_base & src, relation_union_fn * mk_widen_fn(const relation_base & tgt, const relation_base & src,
const relation_base * delta); const relation_base * delta) override;
virtual relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt,
const unsigned * identical_cols); const unsigned * identical_cols) override;
virtual relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value,
unsigned col); unsigned col) override;
virtual relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition); relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition) override;
virtual relation_intersection_filter_fn * mk_filter_by_negation_fn( relation_intersection_filter_fn * mk_filter_by_negation_fn(
const relation_base& t, const relation_base& t,
const relation_base& neg, unsigned joined_col_cnt, const unsigned *t_cols, const relation_base& neg, unsigned joined_col_cnt, const unsigned *t_cols,
const unsigned *negated_cols); const unsigned *negated_cols) override;
virtual relation_transformer_fn * mk_filter_interpreted_and_project_fn( relation_transformer_fn * mk_filter_interpreted_and_project_fn(
const relation_base & t, app * condition, 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, void verify_join(relation_base const& t1, relation_base const& t2, relation_base const& t,
unsigned_vector const& cols1, unsigned_vector const& cols2); unsigned_vector const& cols1, unsigned_vector const& cols2);

View file

@ -423,17 +423,17 @@ namespace datalog {
const row_interface & m_parent; const row_interface & m_parent;
unsigned m_index; unsigned m_index;
protected: protected:
virtual bool is_finished() const { return m_index==m_parent.size(); } bool is_finished() const override { return m_index==m_parent.size(); }
public: public:
fact_row_iterator(const row_interface & row, bool finished) fact_row_iterator(const row_interface & row, bool finished)
: m_parent(row), m_index(finished ? row.size() : 0) {} : m_parent(row), m_index(finished ? row.size() : 0) {}
virtual table_element operator*() { table_element operator*() override {
SASSERT(!is_finished()); SASSERT(!is_finished());
return m_parent[m_index]; return m_parent[m_index];
} }
virtual void operator++() { void operator++() override {
m_index++; m_index++;
SASSERT(m_index<=m_parent.size()); SASSERT(m_index<=m_parent.size());
} }

View file

@ -220,7 +220,7 @@ namespace datalog {
*/ */
class mutator_fn : public base_fn { class mutator_fn : public base_fn {
public: public:
virtual ~mutator_fn() {} ~mutator_fn() override {}
virtual void operator()(base_object & t) = 0; virtual void operator()(base_object & t) = 0;
@ -629,19 +629,19 @@ namespace datalog {
class identity_transformer_fn : public transformer_fn { class identity_transformer_fn : public transformer_fn {
public: public:
virtual base_object * operator()(const base_object & t) { base_object * operator()(const base_object & t) override {
return t.clone(); return t.clone();
} }
}; };
class identity_mutator_fn : public mutator_fn { class identity_mutator_fn : public mutator_fn {
public: public:
virtual void operator()(base_object & t) {}; void operator()(base_object & t) override {};
}; };
class identity_intersection_filter_fn : public intersection_filter_fn { class identity_intersection_filter_fn : public intersection_filter_fn {
public: 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 { class default_permutation_rename_fn : public transformer_fn {
@ -655,11 +655,11 @@ namespace datalog {
: m_permutation(o.get_signature().size(), permutation), : m_permutation(o.get_signature().size(), permutation),
m_renamers_initialized(false) {} m_renamers_initialized(false) {}
~default_permutation_rename_fn() { ~default_permutation_rename_fn() override {
dealloc_ptr_vector_content(m_renamers); 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; const base_object * res = &o;
scoped_rel<base_object> res_scoped; scoped_rel<base_object> res_scoped;
if(m_renamers_initialized) { if(m_renamers_initialized) {
@ -803,11 +803,11 @@ namespace datalog {
protected: protected:
relation_base(relation_plugin & plugin, const relation_signature & s) relation_base(relation_plugin & plugin, const relation_signature & s)
: base_ancestor(plugin, s) {} : base_ancestor(plugin, s) {}
virtual ~relation_base() {} ~relation_base() override {}
public: public:
virtual relation_base * complement(func_decl* p) const = 0; 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 { virtual void display_tuples(func_decl & pred, std::ostream & out) const {
out << "Tuples in " << pred.get_name() << ": \n"; 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) {} table_plugin(symbol const& n, relation_manager & manager) : plugin_object(n, manager) {}
public: 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: protected:
/** /**
@ -1044,17 +1044,17 @@ namespace datalog {
protected: protected:
table_base(table_plugin & plugin, const table_signature & s) table_base(table_plugin & plugin, const table_signature & s)
: base_ancestor(plugin, s) {} : base_ancestor(plugin, s) {}
virtual ~table_base() {} ~table_base() override {}
public: 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 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 \brief Return true if table contains fact that corresponds to \c f in all non-functional
columns. 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, \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_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_fact * facts);
virtual void remove_facts(unsigned fact_cnt, const table_element * facts); virtual void remove_facts(unsigned fact_cnt, const table_element * facts);
virtual void reset(); void reset() override;
class row_interface; 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. \brief Convert table to a formula that encodes the table.
@ -1245,9 +1245,9 @@ namespace datalog {
public: public:
caching_row_interface(const table_base & parent) : row_interface(parent) {} 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(); ensure_populated();
return m_current[col]; return m_current[col];
} }

View file

@ -79,7 +79,7 @@ namespace datalog {
: convenient_relation_join_fn(o1_sig, o2_sig, col_cnt, cols1, cols2) { : 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& r1 = get(_r1);
bound_relation const& r2 = get(_r2); bound_relation const& r2 = get(_r2);
bound_relation_plugin& p = r1.get_plugin(); bound_relation_plugin& p = r1.get_plugin();
@ -104,7 +104,7 @@ namespace datalog {
: convenient_relation_project_fn(orig_sig, removed_col_cnt, removed_cols) { : 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 const& r = get(_r);
bound_relation_plugin& p = r.get_plugin(); bound_relation_plugin& p = r.get_plugin();
bound_relation* result = get(p.mk_full(0, get_result_signature())); 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) { : 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 const& r = get(_r);
bound_relation_plugin& p = r.get_plugin(); bound_relation_plugin& p = r.get_plugin();
bound_relation* result = get(p.mk_full(0, get_result_signature())); bound_relation* result = get(p.mk_full(0, get_result_signature()));
@ -148,7 +148,7 @@ namespace datalog {
union_fn(bool is_widen) : union_fn(bool is_widen) :
m_is_widen(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");); TRACE("bound_relation", _r.display(tout << "dst:\n"); _src.display(tout << "src:\n"););
get(_r).mk_union(get(_src), get(_delta), m_is_widen); get(_r).mk_union(get(_src), get(_delta), m_is_widen);
} }
@ -160,7 +160,7 @@ namespace datalog {
union_fn_i(bool is_widen) : union_fn_i(bool is_widen) :
m_is_widen(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");); 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); get(_r).mk_union_i(get_interval_relation(_src), get(_delta), m_is_widen);
TRACE("bound_relation", _r.display(tout << "dst':\n");); TRACE("bound_relation", _r.display(tout << "dst':\n"););
@ -197,7 +197,7 @@ namespace datalog {
filter_identical_fn(unsigned col_cnt, const unsigned * identical_cols) filter_identical_fn(unsigned col_cnt, const unsigned * identical_cols)
: m_cols(col_cnt, 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) { for (unsigned i = 1; i < m_cols.size(); ++i) {
get(r).equate(m_cols[0], m_cols[i]); get(r).equate(m_cols[0], m_cols[i]);
} }
@ -216,7 +216,7 @@ namespace datalog {
public: public:
filter_equal_fn(relation_element const& value, unsigned col) {} 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, relation_mutator_fn * bound_relation_plugin::mk_filter_equal_fn(const relation_base & r,
@ -342,7 +342,7 @@ namespace datalog {
// x < y + z // 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);); TRACE("dl", tout << mk_pp(m_cond, m_cond.get_manager()) << "\n"; t.display(tout););
bound_relation& r = get(t); bound_relation& r = get(t);
switch(m_kind) { switch(m_kind) {
@ -370,11 +370,11 @@ namespace datalog {
TRACE("dl", t.display(tout << "result\n");); 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); return is_interval_relation(t);
} }
void attach(relation_base& t) { void attach(relation_base& t) override {
SASSERT(is_interval_relation(t)); SASSERT(is_interval_relation(t));
interval_relation& r = get_interval_relation(t); interval_relation& r = get_interval_relation(t);
m_interval = &r; m_interval = &r;

View file

@ -47,29 +47,29 @@ namespace datalog {
bool_rewriter m_bsimp; bool_rewriter m_bsimp;
public: public:
bound_relation_plugin(relation_manager& m); 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"); } static symbol get_name() { return symbol("bound_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;
virtual relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2, relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2,
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override;
virtual relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt,
const unsigned * removed_cols); const unsigned * removed_cols) override;
virtual relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len,
const unsigned * permutation_cycle); const unsigned * permutation_cycle) override;
virtual relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src,
const relation_base * delta); const relation_base * delta) override;
virtual relation_union_fn * mk_widen_fn(const relation_base & tgt, const relation_base & src, relation_union_fn * mk_widen_fn(const relation_base & tgt, const relation_base & src,
const relation_base * delta); const relation_base * delta) override;
virtual relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt,
const unsigned * identical_cols); const unsigned * identical_cols) override;
virtual relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value,
unsigned col); unsigned col) override;
virtual relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition); relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition) override;
virtual relation_join_fn * mk_join_project_fn(const relation_base & t1, const relation_base & t2, 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 joined_col_cnt, const unsigned * cols1, const unsigned * cols2,
unsigned removed_col_cnt, const unsigned * removed_cols) { return 0; } unsigned removed_col_cnt, const unsigned * removed_cols) override { return 0; }
#if 0 #if 0
@ -123,12 +123,12 @@ namespace datalog {
bound_relation(bound_relation_plugin& p, relation_signature const& s, bool is_empty); bound_relation(bound_relation_plugin& p, relation_signature const& s, bool is_empty);
bound_relation& operator=(bound_relation const& other); bound_relation& operator=(bound_relation const& other);
virtual bool empty() const { return m_empty; } bool empty() const override { return m_empty; }
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 bound_relation * clone() const; bound_relation * clone() const override;
virtual bound_relation * complement(func_decl* p) const; bound_relation * complement(func_decl* p) const override;
virtual void to_formula(expr_ref& fml) const; void to_formula(expr_ref& fml) const override;
bound_relation_plugin& get_plugin() const; bound_relation_plugin& get_plugin() const;
void mk_union_i(interval_relation const& src, bound_relation* delta, bool is_widen); 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; bool is_lt(unsigned i, unsigned j) const;
virtual bool is_precise() const { return false; } bool is_precise() const override { return false; }
private: private:
typedef uint_set2 T; 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; void normalize(T const& src, T& dst) const;

View file

@ -65,7 +65,7 @@ namespace datalog {
m_checker = p.get_manager().mk_join_fn(checker(t1), checker(t2), col_cnt, cols1, cols2); 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";); IF_VERBOSE(1, verbose_stream() << __FUNCTION__ << "\n";);
table_base* ttocheck = (*m_tocheck)(tocheck(t1), tocheck(t2)); table_base* ttocheck = (*m_tocheck)(tocheck(t1), tocheck(t2));
table_base* tchecker = (*m_checker)(checker(t1), checker(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); 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* ttocheck = (*m_tocheck)(tocheck(t1), tocheck(t2));
table_base* tchecker = (*m_checker)(checker(t1), checker(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); 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)); 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";); IF_VERBOSE(1, verbose_stream() << __FUNCTION__ << "\n";);
(*m_tocheck)(tocheck(tgt), tocheck(src), tocheck(delta)); (*m_tocheck)(tocheck(tgt), tocheck(src), tocheck(delta));
(*m_checker)(checker(tgt), checker(src), checker(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); 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* tchecker = (*m_checker)(checker(src));
table_base* ttocheck = (*m_tocheck)(tocheck(src)); table_base* ttocheck = (*m_tocheck)(tocheck(src));
check_table* result = alloc(check_table, get(src).get_plugin(), tchecker->get_signature(), ttocheck, tchecker); 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); 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* tchecker = (*m_checker)(checker(src));
table_base* ttocheck = (*m_tocheck)(tocheck(src)); table_base* ttocheck = (*m_tocheck)(tocheck(src));
check_table* result = alloc(check_table, get(src).get_plugin(), tchecker->get_signature(), ttocheck, tchecker); 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); 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";); IF_VERBOSE(1, verbose_stream() << __FUNCTION__ << "\n";);
table_base* tchecker = (*m_checker)(checker(src)); table_base* tchecker = (*m_checker)(checker(src));
table_base* ttocheck = (*m_tocheck)(tocheck(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); 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_checker)(checker(t));
(*m_tocheck)(tocheck(t)); (*m_tocheck)(tocheck(t));
get(t).well_formed(); get(t).well_formed();
@ -247,7 +247,7 @@ namespace datalog {
m_tocheck = p.get_manager().mk_filter_equal_fn(tocheck(t), v, col); 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_checker)(checker(src));
(*m_tocheck)(tocheck(src)); (*m_tocheck)(tocheck(src));
get(src).well_formed(); get(src).well_formed();
@ -271,7 +271,7 @@ namespace datalog {
m_tocheck = p.get_manager().mk_filter_interpreted_fn(tocheck(t), condition); 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_checker)(checker(src));
(*m_tocheck)(tocheck(src)); (*m_tocheck)(tocheck(src));
get(src).well_formed(); 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); 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* tchecker = (*m_checker)(checker(src));
table_base* ttocheck = (*m_tocheck)(tocheck(src)); table_base* ttocheck = (*m_tocheck)(tocheck(src));
check_table* result = alloc(check_table, get(src).get_plugin(), ttocheck->get_signature(), ttocheck, tchecker); 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); 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";); IF_VERBOSE(1, verbose_stream() << __FUNCTION__ << "\n";);
(*m_checker)(checker(src), checker(negated_obj)); (*m_checker)(checker(src), checker(negated_obj));
(*m_tocheck)(tocheck(src), tocheck(negated_obj)); (*m_tocheck)(tocheck(src), tocheck(negated_obj));

View file

@ -53,34 +53,34 @@ namespace datalog {
m_checker(*manager.get_table_plugin(checker)), m_checker(*manager.get_table_plugin(checker)),
m_tocheck(*manager.get_table_plugin(tocheck)), m_count(0) {} 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, table_join_fn * mk_join_fn(const table_base & t1, const table_base & t2,
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override;
virtual table_join_fn * mk_join_project_fn(const table_base & t1, const table_base & t2, 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, unsigned col_cnt, const unsigned * cols1, const unsigned * cols2, unsigned removed_col_cnt,
const unsigned * removed_cols); const unsigned * removed_cols) override;
virtual table_union_fn * mk_union_fn(const table_base & tgt, const table_base & src, table_union_fn * mk_union_fn(const table_base & tgt, const table_base & src,
const table_base * delta); const table_base * delta) override;
virtual table_transformer_fn * mk_project_fn(const table_base & t, unsigned col_cnt, table_transformer_fn * mk_project_fn(const table_base & t, unsigned col_cnt,
const unsigned * removed_cols); const unsigned * removed_cols) override;
virtual table_transformer_fn * mk_select_equal_and_project_fn(const table_base & t, table_transformer_fn * mk_select_equal_and_project_fn(const table_base & t,
const table_element & value, unsigned col); const table_element & value, unsigned col) override;
virtual table_transformer_fn * mk_rename_fn(const table_base & t, unsigned permutation_cycle_len, table_transformer_fn * mk_rename_fn(const table_base & t, unsigned permutation_cycle_len,
const unsigned * permutation_cycle); const unsigned * permutation_cycle) override;
virtual table_mutator_fn * mk_filter_identical_fn(const table_base & t, unsigned col_cnt, table_mutator_fn * mk_filter_identical_fn(const table_base & t, unsigned col_cnt,
const unsigned * identical_cols); const unsigned * identical_cols) override;
virtual table_mutator_fn * mk_filter_equal_fn(const table_base & t, const table_element & value, table_mutator_fn * mk_filter_equal_fn(const table_base & t, const table_element & value,
unsigned col); unsigned col) override;
virtual table_mutator_fn * mk_filter_interpreted_fn(const table_base & t, app * condition); table_mutator_fn * mk_filter_interpreted_fn(const table_base & t, app * condition) override;
virtual table_transformer_fn * mk_filter_interpreted_and_project_fn(const table_base & t, table_transformer_fn * mk_filter_interpreted_and_project_fn(const table_base & t,
app * condition, unsigned removed_col_cnt, const unsigned * removed_cols); app * condition, unsigned removed_col_cnt, const unsigned * removed_cols) override;
virtual table_intersection_filter_fn * mk_filter_by_negation_fn( table_intersection_filter_fn * mk_filter_by_negation_fn(
const table_base & t, const table_base & t,
const table_base & negated_obj, unsigned joined_col_cnt, const table_base & negated_obj, unsigned joined_col_cnt,
const unsigned * t_cols, const unsigned * negated_cols); 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: private:
static check_table& get(table_base& r); 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);
check_table(check_table_plugin & p, const table_signature & sig, table_base* tocheck, table_base* checker); 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; bool well_formed() const;
@ -116,18 +116,18 @@ namespace datalog {
return static_cast<check_table_plugin &>(table_base::get_plugin()); return static_cast<check_table_plugin &>(table_base::get_plugin());
} }
virtual bool empty() const; bool empty() const override;
virtual void add_fact(const table_fact & f); void add_fact(const table_fact & f) override;
virtual void remove_fact(const table_element* fact); void remove_fact(const table_element* fact) override;
virtual bool contains_fact(const table_fact & f) const; bool contains_fact(const table_fact & f) const override;
virtual table_base * complement(func_decl* p, const table_element * func_columns = 0) const; table_base * complement(func_decl* p, const table_element * func_columns = 0) const override;
virtual table_base * clone() const; table_base * clone() const override;
virtual iterator begin() const { SASSERT(well_formed()); return m_tocheck->begin(); } iterator begin() const override { SASSERT(well_formed()); return m_tocheck->begin(); }
virtual iterator end() const { return m_tocheck->end(); } iterator end() const override { return m_tocheck->end(); }
virtual unsigned get_size_estimate_rows() const { return m_tocheck->get_size_estimate_rows(); } unsigned get_size_estimate_rows() const override { 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_bytes() const override { return m_tocheck->get_size_estimate_bytes(); }
}; };
}; };

View file

@ -97,7 +97,7 @@ namespace datalog {
void start_rule(rule * r) { SASSERT(!m_current); m_current=r; } void start_rule(rule * r) { SASSERT(!m_current); m_current=r; }
void finish_rule() { m_current = 0; } void finish_rule() { m_current = 0; }
virtual void notify(instruction * i) { void notify(instruction * i) override {
if(m_current) { if(m_current) {
i->set_accounting_parent_object(m_parent.m_context, m_current); i->set_accounting_parent_object(m_parent.m_context, m_current);
} }

View file

@ -195,7 +195,7 @@ namespace datalog {
m_join_fn = m.mk_func_decl(fid, OP_RA_JOIN, params.size(), params.c_ptr(), 2, domain); 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()); expr_ref res(m_plugin.get_ast_manager());
m_args[0] = get(r1).get_relation(); m_args[0] = get(r1).get_relation();
m_args[1] = get(r2).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); 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_ref res(m_plugin.get_ast_manager());
expr* rel = get(r).get_relation(); expr* rel = get(r).get_relation();
m_plugin.reduce(m_project_fn, 1, &rel, res); 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); 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* rel = get(r).get_relation();
expr_ref res(m_plugin.get_ast_manager()); expr_ref res(m_plugin.get_ast_manager());
m_args[0] = rel; 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); 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(); ast_manager& m = m_plugin.get_ast_manager();
expr_ref_vector res(m); expr_ref_vector res(m);
m_args[0] = get(r).get_relation(); m_args[0] = get(r).get_relation();
@ -342,7 +342,7 @@ namespace datalog {
SASSERT(p.get_ast_manager().is_bool(condition)); 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)); SASSERT(m_plugin.check_kind(r));
expr* arg = get(r).get_relation(); expr* arg = get(r).get_relation();
m_plugin.reduce_assign(m_filter_fn, 1, &arg, 1, &arg); 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(); expr* r0 = get(r).get_relation();
for (unsigned i = 0; i < m_filter_fn.size(); ++i) { for (unsigned i = 0; i < m_filter_fn.size(); ++i) {
m_plugin.reduce_assign(m_filter_fn[i].get(), 1, &r0, 1, &r0); 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); 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[0] = get(t).get_relation();
m_args[1] = get(negated_obj).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); m_plugin.reduce_assign(m_negated_filter_fn.get(), 2, m_args, 1, m_args);

View file

@ -54,30 +54,30 @@ namespace datalog {
public: public:
external_relation_plugin(external_relation_context& ctx, relation_manager & m); 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"); } 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, relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2,
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override;
virtual relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt,
const unsigned * removed_cols); const unsigned * removed_cols) override;
virtual relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len,
const unsigned * permutation_cycle); const unsigned * permutation_cycle) override;
virtual relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src,
const relation_base * delta); const relation_base * delta) override;
virtual relation_union_fn * mk_widen_fn(const relation_base & tgt, const relation_base & src, relation_union_fn * mk_widen_fn(const relation_base & tgt, const relation_base & src,
const relation_base * delta); const relation_base * delta) override;
virtual relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt,
const unsigned * identical_cols); const unsigned * identical_cols) override;
virtual relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value,
unsigned col); unsigned col) override;
virtual relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition); relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition) override;
virtual relation_intersection_filter_fn * mk_filter_by_negation_fn(const relation_base & t, relation_intersection_filter_fn * mk_filter_by_negation_fn(const relation_base & t,
const relation_base & negated_obj, unsigned joined_col_cnt, const relation_base & negated_obj, unsigned joined_col_cnt,
const unsigned * t_cols, const unsigned * negated_cols); const unsigned * t_cols, const unsigned * negated_cols) override;
private: 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; 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); external_relation(external_relation_plugin & p, const relation_signature & s, expr* r);
virtual ~external_relation(); ~external_relation() override;
public: public:
external_relation_plugin & get_plugin() const; 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(); } 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(); }
}; };

View file

@ -333,7 +333,7 @@ namespace datalog {
: convenient_relation_join_fn(sig1, sig2, col_cnt, cols1, cols2), : convenient_relation_join_fn(sig1, sig2, col_cnt, cols1, cols2),
m_plugin(plugin) {} 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<finite_product_relation> r1_conv; scoped_rel<finite_product_relation> r1_conv;
if(&r1.get_plugin()!=&m_plugin) { if(&r1.get_plugin()!=&m_plugin) {
r1_conv = convert(r1); r1_conv = convert(r1);
@ -390,7 +390,7 @@ namespace datalog {
relation_vector & rjoins) relation_vector & rjoins)
: m_parent(parent), m_r1(r1), m_r2(r2), m_rjoins(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 & or1 = m_r1.get_inner_rel(func_columns[0]);
const relation_base & or2 = m_r2.get_inner_rel(func_columns[1]); const relation_base & or2 = m_r2.get_inner_rel(func_columns[1]);
SASSERT(&or1); SASSERT(&or1);
@ -450,7 +450,7 @@ namespace datalog {
return (*m_rjoin_fn)(r1, r2); 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(); finite_product_relation_plugin & plugin = get(rb1).get_plugin();
relation_manager & rmgr = plugin.get_manager(); relation_manager & rmgr = plugin.get_manager();
@ -565,7 +565,7 @@ namespace datalog {
project_reducer(project_fn & parent, relation_vector & relations) project_reducer(project_fn & parent, relation_vector & relations)
: m_parent(parent), m_relations(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<unsigned>(func_columns[0])]->clone(); relation_base * tgt = m_relations[static_cast<unsigned>(func_columns[0])]->clone();
relation_base & src = *m_relations[static_cast<unsigned>(merged_func_columns[0])]; relation_base & src = *m_relations[static_cast<unsigned>(merged_func_columns[0])];
if(!m_parent.m_inner_rel_union) { 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); const finite_product_relation & r = get(rb);
finite_product_relation_plugin & plugin = r.get_plugin(); finite_product_relation_plugin & plugin = r.get_plugin();
const table_base & rtable = r.get_table(); 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 finite_product_relation & r = get(rb);
const table_base & rtable = r.get_table(); const table_base & rtable = r.get_table();
@ -795,9 +795,9 @@ namespace datalog {
m_delta_indexes(delta_indexes), m_delta_indexes(delta_indexes),
m_delta_rels(delta_rels) {} 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]); relation_base & otgt_orig = m_tgt.get_inner_rel(func_columns[0]);
const relation_base & osrc = m_src.get_inner_rel(func_columns[1]); 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) src_copying_mapper(finite_product_relation & tgt, const finite_product_relation & src)
: m_tgt(tgt), m_src(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]); const relation_base & osrc = m_src.get_inner_rel(func_columns[0]);
unsigned new_tgt_idx = m_tgt.get_next_rel_idx(); unsigned new_tgt_idx = m_tgt.get_next_rel_idx();
m_tgt.set_inner_rel(new_tgt_idx, osrc.clone()); 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); finite_product_relation & tgt = get(tgtb);
const finite_product_relation & src0 = get(srcb); const finite_product_relation & src0 = get(srcb);
finite_product_relation * delta = get(deltab); finite_product_relation * delta = get(deltab);
@ -1088,7 +1088,7 @@ namespace datalog {
class finite_product_relation_plugin::converting_union_fn : public relation_union_fn { class finite_product_relation_plugin::converting_union_fn : public relation_union_fn {
scoped_ptr<relation_union_fn> m_tr_union_fun; scoped_ptr<relation_union_fn> m_tr_union_fun;
public: 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()); SASSERT(srcb.get_plugin().is_finite_product_relation());
const finite_product_relation & src = get(srcb); const finite_product_relation & src = get(srcb);
finite_product_relation_plugin & plugin = src.get_plugin(); finite_product_relation_plugin & plugin = src.get_plugin();
@ -1164,7 +1164,7 @@ namespace datalog {
SASSERT(m_rel_filter); SASSERT(m_rel_filter);
} }
virtual void operator()(relation_base & rb) { void operator()(relation_base & rb) override {
finite_product_relation & r = get(rb); finite_product_relation & r = get(rb);
if(m_table_cols.size()>1) { 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); finite_product_relation & r = get(rb);
if(m_table_filter) { 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); finite_product_relation & r = get(rb);
table_base & rtable = r.get_table(); table_base & rtable = r.get_table();
table_plugin & tplugin = r.get_table_plugin(); table_plugin & tplugin = r.get_table_plugin();
@ -1537,7 +1537,7 @@ namespace datalog {
const finite_product_relation & inters) const finite_product_relation & inters)
: m_parent(parent), m_r(r), m_inters(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(); 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]); 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); finite_product_relation & r = get(rb);
const finite_product_relation & neg = get(negb); 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 & r = get(rb);
finite_product_relation_plugin & plugin = r.get_plugin(); finite_product_relation_plugin & plugin = r.get_plugin();
table_plugin & tplugin = r.get_table_plugin(); table_plugin & tplugin = r.get_table_plugin();
@ -2043,7 +2043,7 @@ namespace datalog {
public: public:
live_rel_collection_reducer(idx_set & accumulator) : m_accumulator(accumulator) {} 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<unsigned>(merged_func_columns[0])); m_accumulator.insert(static_cast<unsigned>(merged_func_columns[0]));
} }
}; };

View file

@ -93,23 +93,23 @@ namespace datalog {
finite_product_relation_plugin(relation_plugin & inner_plugin, relation_manager & manager); 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; } 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 \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, finite_product_relation * mk_empty(const relation_signature & s, const bool * table_columns,
family_id inner_kind=null_family_id); family_id inner_kind=null_family_id);
finite_product_relation * mk_empty(const finite_product_relation & original); finite_product_relation * mk_empty(const finite_product_relation & original);
virtual relation_base * mk_empty(const relation_base & original); relation_base * mk_empty(const relation_base & original) override;
virtual relation_base * mk_empty(const relation_signature & s, family_id kind); 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 \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); table_relation * to_table_relation(const finite_product_relation & r);
protected: protected:
virtual relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2, relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2,
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override;
virtual relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt,
const unsigned * removed_cols); const unsigned * removed_cols) override;
virtual relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len,
const unsigned * permutation_cycle); const unsigned * permutation_cycle) override;
virtual relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src,
const relation_base * delta); const relation_base * delta) override;
virtual relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt,
const unsigned * identical_cols); const unsigned * identical_cols) override;
virtual relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value,
unsigned col); unsigned col) override;
virtual relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition); relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition) override;
virtual relation_intersection_filter_fn * mk_filter_by_negation_fn(const relation_base & t, relation_intersection_filter_fn * mk_filter_by_negation_fn(const relation_base & t,
const relation_base & negated_obj, unsigned joined_col_cnt, const relation_base & negated_obj, unsigned joined_col_cnt,
const unsigned * t_cols, const unsigned * negated_cols); const unsigned * t_cols, const unsigned * negated_cols) override;
private: private:
/** /**
@ -309,7 +309,7 @@ namespace datalog {
bool try_modify_specification(const bool * table_cols); 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(); } { 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. 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. \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, 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); const bool * table_columns, table_plugin & tplugin, relation_plugin & oplugin, family_id other_kind);
finite_product_relation(const finite_product_relation & r); finite_product_relation(const finite_product_relation & r);
virtual ~finite_product_relation(); ~finite_product_relation() override;
public: public:
context & get_context() const; context & get_context() const;
finite_product_relation_plugin & get_plugin() 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. The function calls garbage_collect, so the internal state may change when it is called.
*/ */
virtual bool empty() const; bool empty() const override;
void reset() { m_table->reset(); garbage_collect(false); } void reset() override { m_table->reset(); garbage_collect(false); }
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 finite_product_relation * clone() const; finite_product_relation * clone() const override;
virtual finite_product_relation * complement(func_decl* p) const; finite_product_relation * complement(func_decl* p) 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;
virtual unsigned get_size_estimate_rows() const { return m_table->get_size_estimate_rows(); } unsigned get_size_estimate_rows() const override { 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_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;
}; };
}; };

View file

@ -192,7 +192,7 @@ namespace datalog {
public: public:
instr_io(bool store, func_decl_ref const& pred, reg_idx reg) instr_io(bool store, func_decl_ref const& pred, reg_idx reg)
: m_store(store), m_pred(pred), m_reg(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); log_verbose(ctx);
if (m_store) { if (m_store) {
if (ctx.reg(m_reg)) { if (ctx.reg(m_reg)) {
@ -218,10 +218,10 @@ namespace datalog {
} }
return true; 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()); 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(); const char * rel_name = m_pred->get_name().bare_str();
if (m_store) { if (m_store) {
out << "store " << m_reg << " into " << rel_name; out << "store " << m_reg << " into " << rel_name;
@ -245,14 +245,14 @@ namespace datalog {
reg_idx m_reg; reg_idx m_reg;
public: public:
instr_dealloc(reg_idx reg) : m_reg(reg) {} 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); ctx.make_empty(m_reg);
return true; return true;
} }
virtual void make_annotations(execution_context & ctx) { void make_annotations(execution_context & ctx) override {
ctx.set_register_annotation(m_reg, "alloc"); 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; out << "dealloc " << m_reg;
} }
}; };
@ -268,7 +268,7 @@ namespace datalog {
public: public:
instr_clone_move(bool clone, reg_idx src, reg_idx tgt) instr_clone_move(bool clone, reg_idx src, reg_idx tgt)
: m_clone(clone), m_src(src), m_tgt(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 (ctx.reg(m_src)) log_verbose(ctx);
if (m_clone) { if (m_clone) {
ctx.set_reg(m_tgt, ctx.reg(m_src) ? ctx.reg(m_src)->clone() : 0); ctx.set_reg(m_tgt, ctx.reg(m_src) ? ctx.reg(m_src)->clone() : 0);
@ -278,7 +278,7 @@ namespace datalog {
} }
return true; return true;
} }
virtual void make_annotations(execution_context & ctx) { void make_annotations(execution_context & ctx) override {
std::string str; std::string str;
if (ctx.get_register_annotation(m_src, str)) { if (ctx.get_register_annotation(m_src, str)) {
ctx.set_register_annotation(m_tgt, str); ctx.set_register_annotation(m_tgt, str);
@ -287,7 +287,7 @@ namespace datalog {
ctx.set_register_annotation(m_src, str); 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; out << (m_clone ? "clone " : "move ") << m_src << " into " << m_tgt;
} }
}; };
@ -317,17 +317,17 @@ namespace datalog {
return true; return true;
} }
protected: protected:
virtual void process_all_costs() { void process_all_costs() override {
instruction::process_all_costs(); instruction::process_all_costs();
m_body->process_all_costs(); m_body->process_all_costs();
} }
public: public:
instr_while_loop(unsigned control_reg_cnt, const reg_idx * control_regs, instruction_block * body) 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) {} : m_controls(control_reg_cnt, control_regs), m_body(body) {}
virtual ~instr_while_loop() { ~instr_while_loop() override {
dealloc(m_body); dealloc(m_body);
} }
virtual bool perform(execution_context & ctx) { bool perform(execution_context & ctx) override {
log_verbose(ctx); log_verbose(ctx);
TRACE("dl", tout << "loop entered\n";); TRACE("dl", tout << "loop entered\n";);
unsigned count = 0; unsigned count = 0;
@ -341,14 +341,14 @@ namespace datalog {
TRACE("dl", tout << "while loop exited\n";); TRACE("dl", tout << "while loop exited\n";);
return true; return true;
} }
virtual void make_annotations(execution_context & ctx) { void make_annotations(execution_context & ctx) override {
m_body->make_annotations(ctx); 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"; out << "while";
print_container(m_controls, out); 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+" "); m_body->display_indented(ctx, out, indentation+" ");
} }
}; };
@ -371,7 +371,7 @@ namespace datalog {
const unsigned * cols2, reg_idx result) const unsigned * cols2, reg_idx result)
: m_rel1(rel1), m_rel2(rel2), m_cols1(col_cnt, cols1), : m_rel1(rel1), m_rel2(rel2), m_cols1(col_cnt, cols1),
m_cols2(col_cnt, cols2), m_res(result) {} m_cols2(col_cnt, cols2), m_res(result) {}
virtual bool perform(execution_context & ctx) { bool perform(execution_context & ctx) override {
log_verbose(ctx); log_verbose(ctx);
++ctx.m_stats.m_join; ++ctx.m_stats.m_join;
if (!ctx.reg(m_rel1) || !ctx.reg(m_rel2)) { if (!ctx.reg(m_rel1) || !ctx.reg(m_rel2)) {
@ -408,13 +408,13 @@ namespace datalog {
} }
return true; return true;
} }
virtual void make_annotations(execution_context & ctx) { void make_annotations(execution_context & ctx) override {
std::string a1 = "rel1", a2 = "rel2"; std::string a1 = "rel1", a2 = "rel2";
ctx.get_register_annotation(m_rel1, a1); ctx.get_register_annotation(m_rel1, a1);
ctx.get_register_annotation(m_rel1, a1); ctx.get_register_annotation(m_rel1, a1);
ctx.set_register_annotation(m_res, "join " + a1 + " " + a2); 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; out << "join " << m_rel1;
print_container(m_cols1, out); print_container(m_cols1, out);
out << " and " << m_rel2; out << " and " << m_rel2;
@ -435,7 +435,7 @@ namespace datalog {
public: public:
instr_filter_equal(ast_manager & m, reg_idx reg, const relation_element & value, unsigned col) 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) {} : 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); log_verbose(ctx);
++ctx.m_stats.m_filter_eq; ++ctx.m_stats.m_filter_eq;
if (!ctx.reg(m_reg)) { if (!ctx.reg(m_reg)) {
@ -460,12 +460,12 @@ namespace datalog {
} }
return true; return true;
} }
virtual void make_annotations(execution_context & ctx) { void make_annotations(execution_context & ctx) override {
std::stringstream a; std::stringstream a;
a << "filter_equal " << m_col << " val: " << ctx.get_rel_context().get_rmanager().to_nice_string(m_value); 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()); 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: " out << "filter_equal " << m_reg << " col: " << m_col << " val: "
<< ctx.get_rel_context().get_rmanager().to_nice_string(m_value); << ctx.get_rel_context().get_rmanager().to_nice_string(m_value);
} }
@ -484,7 +484,7 @@ namespace datalog {
public: public:
instr_filter_identical(reg_idx reg, unsigned col_cnt, const unsigned * identical_cols) instr_filter_identical(reg_idx reg, unsigned col_cnt, const unsigned * identical_cols)
: m_reg(reg), m_cols(col_cnt, 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); log_verbose(ctx);
++ctx.m_stats.m_filter_id; ++ctx.m_stats.m_filter_id;
if (!ctx.reg(m_reg)) { if (!ctx.reg(m_reg)) {
@ -509,11 +509,11 @@ namespace datalog {
} }
return true; 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 << " "; out << "filter_identical " << m_reg << " ";
print_container(m_cols, out); 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"); ctx.set_register_annotation(m_reg, "filter_identical");
} }
}; };
@ -529,7 +529,7 @@ namespace datalog {
public: public:
instr_filter_interpreted(reg_idx reg, app_ref & condition) instr_filter_interpreted(reg_idx reg, app_ref & condition)
: m_reg(reg), m_cond(condition) {} : m_reg(reg), m_cond(condition) {}
virtual bool perform(execution_context & ctx) { bool perform(execution_context & ctx) override {
if (!ctx.reg(m_reg)) { if (!ctx.reg(m_reg)) {
return true; return true;
} }
@ -557,11 +557,11 @@ namespace datalog {
return true; 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 " out << "filter_interpreted " << m_reg << " using "
<< mk_pp(m_cond, m_cond.get_manager()); << 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; std::stringstream a;
a << "filter_interpreted " << mk_pp(m_cond, m_cond.get_manager()); a << "filter_interpreted " << mk_pp(m_cond, m_cond.get_manager());
ctx.set_register_annotation(m_reg, a.str()); 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_src(src), m_cond(condition), m_cols(col_cnt, removed_cols),
m_res(result) {} m_res(result) {}
virtual bool perform(execution_context & ctx) { bool perform(execution_context & ctx) override {
log_verbose(ctx); log_verbose(ctx);
if (!ctx.reg(m_src)) { if (!ctx.reg(m_src)) {
ctx.make_empty(m_res); ctx.make_empty(m_res);
@ -614,14 +614,14 @@ namespace datalog {
return true; 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 << "filter_interpreted_and_project " << m_src << " into " << m_res;
out << " using " << mk_pp(m_cond, m_cond.get_manager()); out << " using " << mk_pp(m_cond, m_cond.get_manager());
out << " deleting columns "; out << " deleting columns ";
print_container(m_cols, out); print_container(m_cols, out);
} }
virtual void make_annotations(execution_context & ctx) { void make_annotations(execution_context & ctx) override {
std::stringstream s; std::stringstream s;
std::string a = "rel_src"; std::string a = "rel_src";
ctx.get_register_annotation(m_src, a); ctx.get_register_annotation(m_src, a);
@ -644,7 +644,7 @@ namespace datalog {
public: public:
instr_union(reg_idx src, reg_idx tgt, reg_idx delta, bool widen) 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) {} : 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 TRACE("dl", tout << "union " << m_src << " into " << m_tgt
<< " " << ctx.reg(m_src) << " " << ctx.reg(m_tgt) << "\n";); << " " << ctx.reg(m_src) << " " << ctx.reg(m_tgt) << "\n";);
if (!ctx.reg(m_src)) { if (!ctx.reg(m_src)) {
@ -721,7 +721,7 @@ namespace datalog {
return true; return true;
} }
virtual void make_annotations(execution_context & ctx) { void make_annotations(execution_context & ctx) override {
std::string str = "union"; std::string str = "union";
if (!ctx.get_register_annotation(m_tgt, str)) { if (!ctx.get_register_annotation(m_tgt, str)) {
ctx.set_register_annotation(m_tgt, "union"); ctx.set_register_annotation(m_tgt, "union");
@ -731,7 +731,7 @@ namespace datalog {
} }
ctx.set_register_annotation(m_delta, str); 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; out << (m_widen ? "widen " : "union ") << m_src << " into " << m_tgt;
if (m_delta!=execution_context::void_register) { if (m_delta!=execution_context::void_register) {
out << " with delta " << m_delta; 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, instr_project_rename(bool projection, reg_idx src, unsigned col_cnt, const unsigned * cols,
reg_idx tgt) : m_projection(projection), m_src(src), reg_idx tgt) : m_projection(projection), m_src(src),
m_cols(col_cnt, cols), m_tgt(tgt) {} 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)) { if (!ctx.reg(m_src)) {
ctx.make_empty(m_tgt); ctx.make_empty(m_tgt);
return true; return true;
@ -787,12 +787,12 @@ namespace datalog {
return true; 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 ? "project " : "rename ") << m_src << " into " << m_tgt;
out << (m_projection ? " deleting columns " : " with cycle "); out << (m_projection ? " deleting columns " : " with cycle ");
print_container(m_cols, out); print_container(m_cols, out);
} }
virtual void make_annotations(execution_context & ctx) { void make_annotations(execution_context & ctx) override {
std::stringstream s; std::stringstream s;
std::string a = "rel_src"; std::string a = "rel_src";
ctx.get_register_annotation(m_src, a); 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_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) { 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); log_verbose(ctx);
if (!ctx.reg(m_rel1) || !ctx.reg(m_rel2)) { if (!ctx.reg(m_rel1) || !ctx.reg(m_rel2)) {
ctx.make_empty(m_res); ctx.make_empty(m_res);
@ -852,7 +852,7 @@ namespace datalog {
} }
return true; 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* r1 = ctx.reg(m_rel1);
relation_base const* r2 = ctx.reg(m_rel2); relation_base const* r2 = ctx.reg(m_rel2);
out << "join_project " << m_rel1; out << "join_project " << m_rel1;
@ -870,7 +870,7 @@ namespace datalog {
out << " into " << m_res << " removing columns "; out << " into " << m_res << " removing columns ";
print_container(m_removed_cols, out); 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"; std::string s1 = "rel1", s2 = "rel2";
ctx.get_register_annotation(m_rel1, s1); ctx.get_register_annotation(m_rel1, s1);
ctx.get_register_annotation(m_rel2, s2); 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";); // 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)) { if (!ctx.reg(m_src)) {
ctx.make_empty(m_result); ctx.make_empty(m_result);
return true; return true;
@ -923,11 +923,11 @@ namespace datalog {
} }
return true; 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 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); << " 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::stringstream s;
std::string s1 = "src"; std::string s1 = "src";
ctx.get_register_annotation(m_src, s1); 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, instr_filter_by_negation(reg_idx tgt, reg_idx neg_rel, unsigned col_cnt, const unsigned * cols1,
const unsigned * cols2) const unsigned * cols2)
: m_tgt(tgt), m_neg_rel(neg_rel), m_cols1(col_cnt, cols1), m_cols2(col_cnt, 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); log_verbose(ctx);
if (!ctx.reg(m_tgt) || !ctx.reg(m_neg_rel)) { if (!ctx.reg(m_tgt) || !ctx.reg(m_neg_rel)) {
return true; return true;
@ -980,14 +980,14 @@ namespace datalog {
} }
return true; 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; out << "filter_by_negation on " << m_tgt;
print_container(m_cols1, out); print_container(m_cols1, out);
out << " with " << m_neg_rel; out << " with " << m_neg_rel;
print_container(m_cols2, out); print_container(m_cols2, out);
out << " as the negated table"; out << " as the negated table";
} }
virtual void make_annotations(execution_context & ctx) { void make_annotations(execution_context & ctx) override {
std::string s = "negated relation"; std::string s = "negated relation";
ctx.get_register_annotation(m_neg_rel, s); ctx.get_register_annotation(m_neg_rel, s);
ctx.set_register_annotation(m_tgt, "filter by negation " + s); ctx.set_register_annotation(m_tgt, "filter by negation " + s);
@ -1011,7 +1011,7 @@ namespace datalog {
m_sig.push_back(s); m_sig.push_back(s);
m_fact.push_back(val); m_fact.push_back(val);
} }
virtual bool perform(execution_context & ctx) { bool perform(execution_context & ctx) override {
log_verbose(ctx); log_verbose(ctx);
++ctx.m_stats.m_unary_singleton; ++ctx.m_stats.m_unary_singleton;
relation_base * rel = ctx.get_rel_context().get_rmanager().mk_empty_relation(m_sig, m_pred); 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); ctx.set_reg(m_tgt, rel);
return true; 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:" 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]) << " val:"
<< ctx.get_rel_context().get_rmanager().to_nice_string(m_sig[0], m_fact[0]); << 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; std::string s;
if (!ctx.get_register_annotation(m_tgt, s)) { if (!ctx.get_register_annotation(m_tgt, s)) {
ctx.set_register_annotation(m_tgt, "mk unary singleton"); ctx.set_register_annotation(m_tgt, "mk unary singleton");
@ -1044,18 +1044,18 @@ namespace datalog {
reg_idx m_tgt; reg_idx m_tgt;
public: public:
instr_mk_total(const relation_signature & sig, func_decl* p, reg_idx tgt) : m_sig(sig), m_pred(p), m_tgt(tgt) {} 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); log_verbose(ctx);
++ctx.m_stats.m_total; ++ctx.m_stats.m_total;
ctx.set_reg(m_tgt, ctx.get_rel_context().get_rmanager().mk_full_relation(m_sig, m_pred)); ctx.set_reg(m_tgt, ctx.get_rel_context().get_rmanager().mk_full_relation(m_sig, m_pred));
return true; 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:" out << "mk_total into " << m_tgt << " sort:"
<< ctx.get_rel_context().get_rmanager().to_nice_string(m_sig) << ctx.get_rel_context().get_rmanager().to_nice_string(m_sig)
<< " " << m_pred->get_name(); << " " << m_pred->get_name();
} }
virtual void make_annotations(execution_context & ctx) { void make_annotations(execution_context & ctx) override {
std::string s; std::string s;
if (!ctx.get_register_annotation(m_tgt, s)) { if (!ctx.get_register_annotation(m_tgt, s)) {
ctx.set_register_annotation(m_tgt, "mk_total"); ctx.set_register_annotation(m_tgt, "mk_total");
@ -1072,15 +1072,15 @@ namespace datalog {
public: public:
instr_mark_saturated(ast_manager & m, func_decl * pred) instr_mark_saturated(ast_manager & m, func_decl * pred)
: m_pred(pred, m) {} : m_pred(pred, m) {}
virtual bool perform(execution_context & ctx) { bool perform(execution_context & ctx) override {
log_verbose(ctx); log_verbose(ctx);
ctx.get_rel_context().get_rmanager().mark_saturated(m_pred); ctx.get_rel_context().get_rmanager().mark_saturated(m_pred);
return true; 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(); 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: public:
instr_assert_signature(const relation_signature & s, reg_idx tgt) instr_assert_signature(const relation_signature & s, reg_idx tgt)
: m_sig(s), m_tgt(tgt) {} : m_sig(s), m_tgt(tgt) {}
virtual bool perform(execution_context & ctx) { bool perform(execution_context & ctx) override {
log_verbose(ctx); log_verbose(ctx);
if (ctx.reg(m_tgt)) { if (ctx.reg(m_tgt)) {
SASSERT(ctx.reg(m_tgt)->get_signature()==m_sig); SASSERT(ctx.reg(m_tgt)->get_signature()==m_sig);
} }
return true; 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:"; out << "instr_assert_signature of " << m_tgt << " signature:";
print_container(m_sig, out); print_container(m_sig, out);
} }
virtual void make_annotations(execution_context & ctx) { void make_annotations(execution_context & ctx) override {
std::string s; std::string s;
if (!ctx.get_register_annotation(m_tgt, s)) { if (!ctx.get_register_annotation(m_tgt, s)) {
ctx.set_register_annotation(m_tgt, "assert signature"); ctx.set_register_annotation(m_tgt, "assert signature");

View file

@ -59,7 +59,7 @@ namespace datalog {
: convenient_relation_join_fn(o1_sig, o2_sig, col_cnt, cols1, cols2){ : 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& r1 = get(_r1);
interval_relation const& r2 = get(_r2); interval_relation const& r2 = get(_r2);
interval_relation_plugin& p = r1.get_plugin(); interval_relation_plugin& p = r1.get_plugin();
@ -84,7 +84,7 @@ namespace datalog {
: convenient_relation_project_fn(orig_sig, removed_col_cnt, removed_cols) { : 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 const& r = get(_r);
interval_relation_plugin& p = r.get_plugin(); interval_relation_plugin& p = r.get_plugin();
interval_relation* result = dynamic_cast<interval_relation*>(p.mk_full(0, get_result_signature())); interval_relation* result = dynamic_cast<interval_relation*>(p.mk_full(0, get_result_signature()));
@ -104,7 +104,7 @@ namespace datalog {
: convenient_relation_rename_fn(orig_sig, cycle_len, 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 {
interval_relation const& r = get(_r); interval_relation const& r = get(_r);
interval_relation_plugin& p = r.get_plugin(); interval_relation_plugin& p = r.get_plugin();
interval_relation* result = dynamic_cast<interval_relation*>(p.mk_full(0, get_result_signature())); interval_relation* result = dynamic_cast<interval_relation*>(p.mk_full(0, get_result_signature()));
@ -198,7 +198,7 @@ namespace datalog {
m_is_widen(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("interval_relation", _r.display(tout << "dst:\n"); _src.display(tout << "src:\n");); 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) filter_identical_fn(unsigned col_cnt, const unsigned * identical_cols)
: m_identical_cols(col_cnt, 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); interval_relation & pr = get(r);
for (unsigned i = 1; i < m_identical_cols.size(); ++i) { for (unsigned i = 1; i < m_identical_cols.size(); ++i) {
unsigned c1 = m_identical_cols[0]; unsigned c1 = m_identical_cols[0];
@ -266,7 +266,7 @@ namespace datalog {
VERIFY(arith.is_numeral(value, m_value)); 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 & r = get(_r);
interval_relation_plugin & p = r.get_plugin(); interval_relation_plugin & p = r.get_plugin();
r.mk_intersect(m_col, interval(p.dep(), m_value)); 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()) { 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); get(t).filter_interpreted(m_cond);
TRACE("interval_relation", tout << mk_pp(m_cond, m_cond.get_manager()) << "\n"; t.display(tout);); TRACE("interval_relation", tout << mk_pp(m_cond, m_cond.get_manager()) << "\n"; t.display(tout););
} }

View file

@ -53,25 +53,25 @@ namespace datalog {
public: public:
interval_relation_plugin(relation_manager& m); 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"); } static symbol get_name() { return symbol("interval_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;
virtual relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2, relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2,
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override;
virtual relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt,
const unsigned * removed_cols); const unsigned * removed_cols) override;
virtual relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len,
const unsigned * permutation_cycle); const unsigned * permutation_cycle) override;
virtual relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src,
const relation_base * delta); const relation_base * delta) override;
virtual relation_union_fn * mk_widen_fn(const relation_base & tgt, const relation_base & src, relation_union_fn * mk_widen_fn(const relation_base & tgt, const relation_base & src,
const relation_base * delta); const relation_base * delta) override;
virtual relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt,
const unsigned * identical_cols); const unsigned * identical_cols) override;
virtual relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value,
unsigned col); unsigned col) override;
virtual relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition); 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_empty(unsigned idx, interval const& i);
static bool is_infinite(interval const& i); static bool is_infinite(interval const& i);
@ -97,39 +97,39 @@ namespace datalog {
public: public:
interval_relation(interval_relation_plugin& p, relation_signature const& s, bool is_empty); interval_relation(interval_relation_plugin& p, relation_signature const& s, bool is_empty);
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 interval_relation * clone() const; interval_relation * clone() const override;
virtual interval_relation * complement(func_decl*) const; interval_relation * complement(func_decl*) const override;
virtual void to_formula(expr_ref& fml) const; void to_formula(expr_ref& fml) const override;
interval_relation_plugin& get_plugin() const; interval_relation_plugin& get_plugin() const;
void filter_interpreted(app* cond); void filter_interpreted(app* cond);
virtual bool is_precise() const { return false; } bool is_precise() const override { return false; }
private: 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); 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); 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); 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); void mk_intersect(unsigned idx, interval const& i);

View file

@ -50,7 +50,7 @@ namespace datalog {
unsigned const* cols1, unsigned const* cols2): unsigned const* cols1, unsigned const* cols2):
convenient_table_join_fn(s1, s2, col_cnt, cols1, 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& t1 = get(_t1);
lazy_table const& t2 = get(_t2); 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()); 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 { class lazy_table_plugin::union_fn : public table_union_fn {
public: public:
void operator()(table_base & _tgt, const table_base & _src, void operator()(table_base & _tgt, const table_base & _src,
table_base * _delta) { table_base * _delta) override {
lazy_table& tgt = get(_tgt); lazy_table& tgt = get(_tgt);
lazy_table const& src = get(_src); lazy_table const& src = get(_src);
lazy_table* delta = get(_delta); lazy_table* delta = get(_delta);
@ -111,7 +111,7 @@ namespace datalog {
convenient_table_project_fn(orig_sig, cnt, cols) 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); 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())); 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) 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); 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())); 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: public:
filter_identical_fn(unsigned cnt, unsigned const* cols): m_cols(cnt, cols) {} 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); lazy_table& t = get(_t);
t.set(alloc(lazy_table_filter_identical, m_cols.size(), m_cols.c_ptr(), t)); t.set(alloc(lazy_table_filter_identical, m_cols.size(), m_cols.c_ptr(), t));
} }
@ -188,7 +188,7 @@ namespace datalog {
public: public:
filter_interpreted_fn(app_ref& p): m_condition(p) {} 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); lazy_table& t = get(_t);
t.set(alloc(lazy_table_filter_interpreted, t, m_condition)); t.set(alloc(lazy_table_filter_interpreted, t, m_condition));
} }
@ -214,7 +214,7 @@ namespace datalog {
public: public:
filter_by_negation_fn(unsigned cnt, unsigned const* cols1, unsigned const* cols2): filter_by_negation_fn(unsigned cnt, unsigned const* cols1, unsigned const* cols2):
m_cols1(cnt, cols1), m_cols2(cnt, 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& t = get(_t);
lazy_table const& it = get(_intersected_obj); lazy_table const& it = get(_intersected_obj);
t.set(alloc(lazy_table_filter_by_negation, t, it, m_cols1, m_cols2)); t.set(alloc(lazy_table_filter_by_negation, t, it, m_cols1, m_cols2));
@ -246,7 +246,7 @@ namespace datalog {
m_col(col) m_col(col)
{ } { }
virtual void operator()(table_base& _t) { void operator()(table_base& _t) override {
lazy_table& t = get(_t); lazy_table& t = get(_t);
t.set(alloc(lazy_table_filter_equal, m_col, m_value, t)); t.set(alloc(lazy_table_filter_equal, m_col, m_value, t));
} }

View file

@ -48,37 +48,37 @@ namespace datalog {
table_plugin(mk_name(p), p.get_manager()), table_plugin(mk_name(p), p.get_manager()),
m_plugin(p) {} 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); 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); static table_plugin* mk_sparse(relation_manager& rm);
protected: protected:
virtual table_join_fn * mk_join_fn( table_join_fn * mk_join_fn(
const table_base & t1, const table_base & t2, const table_base & t1, const table_base & t2,
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override;
virtual table_union_fn * mk_union_fn( table_union_fn * mk_union_fn(
const table_base & tgt, const table_base & src, const table_base & tgt, const table_base & src,
const table_base * delta); const table_base * delta) override;
virtual table_transformer_fn * mk_project_fn( table_transformer_fn * mk_project_fn(
const table_base & t, unsigned col_cnt, const table_base & t, unsigned col_cnt,
const unsigned * removed_cols); const unsigned * removed_cols) override;
virtual table_transformer_fn * mk_rename_fn( table_transformer_fn * mk_rename_fn(
const table_base & t, unsigned permutation_cycle_len, const table_base & t, unsigned permutation_cycle_len,
const unsigned * permutation_cycle); const unsigned * permutation_cycle) override;
virtual table_mutator_fn * mk_filter_identical_fn( table_mutator_fn * mk_filter_identical_fn(
const table_base & t, unsigned col_cnt, const unsigned * identical_cols); const table_base & t, unsigned col_cnt, const unsigned * identical_cols) override;
virtual table_mutator_fn * mk_filter_equal_fn( table_mutator_fn * mk_filter_equal_fn(
const table_base & t, const table_element & value, unsigned col); const table_base & t, const table_element & value, unsigned col) override;
virtual table_mutator_fn * mk_filter_interpreted_fn( table_mutator_fn * mk_filter_interpreted_fn(
const table_base & t, app * condition); const table_base & t, app * condition) override;
virtual table_intersection_filter_fn * mk_filter_by_negation_fn( table_intersection_filter_fn * mk_filter_by_negation_fn(
const table_base & t, const table_base & t,
const table_base & negated_obj, unsigned joined_col_cnt, const table_base & negated_obj, unsigned joined_col_cnt,
const unsigned * t_cols, const unsigned * negated_cols); const unsigned * t_cols, const unsigned * negated_cols) override;
static lazy_table const& get(table_base const& tb); static lazy_table const& get(table_base const& tb);
static lazy_table& get(table_base& tb); static lazy_table& get(table_base& tb);
@ -129,30 +129,30 @@ namespace datalog {
m_ref(t) m_ref(t)
{} {}
virtual ~lazy_table() {} ~lazy_table() override {}
lazy_table_plugin& get_lplugin() const { lazy_table_plugin& get_lplugin() const {
return dynamic_cast<lazy_table_plugin&>(table_base::get_plugin()); return dynamic_cast<lazy_table_plugin&>(table_base::get_plugin());
} }
virtual table_base * clone() const; table_base * clone() const override;
virtual table_base * complement(func_decl* p, const table_element * func_columns = 0) const; table_base * complement(func_decl* p, const table_element * func_columns = 0) const override;
virtual bool empty() const; bool empty() const override;
virtual bool contains_fact(const table_fact & f) const; bool contains_fact(const table_fact & f) const override;
virtual void remove_fact(table_element const* fact); void remove_fact(table_element const* fact) override;
virtual void remove_facts(unsigned fact_cnt, const table_fact * facts); void remove_facts(unsigned fact_cnt, const table_fact * facts) override;
virtual void remove_facts(unsigned fact_cnt, const table_element * facts); void remove_facts(unsigned fact_cnt, const table_element * facts) override;
virtual void reset(); void reset() override;
virtual void add_fact(table_fact const& f); void add_fact(table_fact const& f) override;
virtual unsigned get_size_estimate_rows() const { return 1; } unsigned get_size_estimate_rows() const override { return 1; }
virtual unsigned get_size_estimate_bytes() const { return 1; } unsigned get_size_estimate_bytes() const override { return 1; }
virtual bool knows_exact_size() const { return false; } bool knows_exact_size() const override { return false; }
table_base* eval() const; table_base* eval() const;
virtual table_base::iterator begin() const; table_base::iterator begin() const override;
virtual table_base::iterator end() const; table_base::iterator end() const override;
lazy_table_ref* get_ref() const { return m_ref.get(); } lazy_table_ref* get_ref() const { return m_ref.get(); }
void set(lazy_table_ref* r) { m_ref = r; } void set(lazy_table_ref* r) { m_ref = r; }
@ -165,9 +165,9 @@ namespace datalog {
m_table = table; m_table = table;
// SASSERT(&p.m_plugin == &table->get_lplugin()); // SASSERT(&p.m_plugin == &table->get_lplugin());
} }
virtual ~lazy_table_base() {} ~lazy_table_base() override {}
virtual lazy_table_kind kind() const { return LAZY_TABLE_BASE; } lazy_table_kind kind() const override { return LAZY_TABLE_BASE; }
virtual table_base* force() { return m_table.get(); } table_base* force() override { return m_table.get(); }
}; };
class lazy_table_join : public lazy_table_ref { class lazy_table_join : public lazy_table_ref {
@ -184,13 +184,13 @@ namespace datalog {
m_cols2(col_cnt, cols2), m_cols2(col_cnt, cols2),
m_t1(t1.get_ref()), m_t1(t1.get_ref()),
m_t2(t2.get_ref()) { } m_t2(t2.get_ref()) { }
virtual ~lazy_table_join() {} ~lazy_table_join() override {}
virtual lazy_table_kind kind() const { return LAZY_TABLE_JOIN; } lazy_table_kind kind() const override { return LAZY_TABLE_JOIN; }
unsigned_vector const& cols1() const { return m_cols1; } unsigned_vector const& cols1() const { return m_cols1; }
unsigned_vector const& cols2() const { return m_cols2; } unsigned_vector const& cols2() const { return m_cols2; }
lazy_table_ref* t1() const { return m_t1.get(); } lazy_table_ref* t1() const { return m_t1.get(); }
lazy_table_ref* t2() const { return m_t2.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), : lazy_table_ref(src.get_lplugin(), sig),
m_cols(col_cnt, cols), m_cols(col_cnt, cols),
m_src(src.get_ref()) {} 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; } unsigned_vector const& cols() const { return m_cols; }
lazy_table_ref* src() const { return m_src.get(); } 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 { class lazy_table_rename : public lazy_table_ref {
@ -218,12 +218,12 @@ namespace datalog {
: lazy_table_ref(src.get_lplugin(), sig), : lazy_table_ref(src.get_lplugin(), sig),
m_cols(col_cnt, cols), m_cols(col_cnt, cols),
m_src(src.get_ref()) {} 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; } unsigned_vector const& cols() const { return m_cols; }
lazy_table_ref* src() const { return m_src.get(); } 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 { class lazy_table_filter_identical : public lazy_table_ref {
@ -232,12 +232,12 @@ namespace datalog {
public: public:
lazy_table_filter_identical(unsigned col_cnt, const unsigned * cols, lazy_table const& src) 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()) {} : 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; } unsigned_vector const& cols() const { return m_cols; }
lazy_table_ref* src() const { return m_src.get(); } 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 { class lazy_table_filter_equal : public lazy_table_ref {
@ -250,13 +250,13 @@ namespace datalog {
m_col(col), m_col(col),
m_value(value), m_value(value),
m_src(src.get_ref()) {} 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; } unsigned col() const { return m_col; }
table_element value() const { return m_value; } table_element value() const { return m_value; }
lazy_table_ref* src() const { return m_src.get(); } 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 { 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_filter_interpreted(lazy_table const& src, app* condition)
: lazy_table_ref(src.get_lplugin(), src.get_signature()), : lazy_table_ref(src.get_lplugin(), src.get_signature()),
m_condition(condition, src.get_lplugin().get_ast_manager()), m_src(src.get_ref()) {} 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; } app* condition() const { return m_condition; }
lazy_table_ref* src() const { return m_src.get(); } 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_src(src.get_ref()),
m_cols1(c1), m_cols1(c1),
m_cols2(c2) {} m_cols2(c2) {}
virtual ~lazy_table_filter_by_negation() {} ~lazy_table_filter_by_negation() override {}
virtual lazy_table_kind kind() const { return LAZY_TABLE_FILTER_BY_NEGATION; } lazy_table_kind kind() const override { return LAZY_TABLE_FILTER_BY_NEGATION; }
lazy_table_ref* tgt() const { return m_tgt.get(); } lazy_table_ref* tgt() const { return m_tgt.get(); }
lazy_table_ref* src() const { return m_src.get(); } lazy_table_ref* src() const { return m_src.get(); }
unsigned_vector const& cols1() const { return m_cols1; } unsigned_vector const& cols1() const { return m_cols1; }
unsigned_vector const& cols2() const { return m_cols2; } unsigned_vector const& cols2() const { return m_cols2; }
virtual table_base* force(); table_base* force() override;
}; };

View file

@ -69,7 +69,7 @@ namespace datalog {
m_relation_level_explanations(relation_level), m_relation_level_explanations(relation_level),
m_union_decl(mk_explanations::get_union_decl(get_context()), get_ast_manager()) {} 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 i = 0; i < m_pool.size(); ++i) {
for (unsigned j = 0; j < m_pool[i].size(); ++j) { for (unsigned j = 0; j < m_pool[i].size(); ++j) {
dealloc(m_pool[i][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(); unsigned n=s.size();
for (unsigned i=0; i<n; i++) { for (unsigned i=0; i<n; i++) {
if (!get_context().get_decl_util().is_rule_sort(s[i])) { if (!get_context().get_decl_util().is_rule_sort(s[i])) {
@ -87,27 +87,27 @@ namespace datalog {
return true; return true;
} }
virtual relation_base * mk_empty(const relation_signature & s); relation_base * mk_empty(const relation_signature & s) override;
void recycle(explanation_relation* r); void recycle(explanation_relation* r);
protected: protected:
virtual relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2, relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2,
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override;
virtual relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt,
const unsigned * removed_cols); const unsigned * removed_cols) override;
virtual relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len,
const unsigned * permutation_cycle); const unsigned * permutation_cycle) override;
virtual relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src,
const relation_base * delta); const relation_base * delta) override;
virtual relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition); relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition) override;
virtual relation_intersection_filter_fn * mk_filter_by_negation_fn(const relation_base & t, relation_intersection_filter_fn * mk_filter_by_negation_fn(const relation_base & t,
const relation_base & negated_obj, unsigned joined_col_cnt, const relation_base & negated_obj, unsigned joined_col_cnt,
const unsigned * t_cols, const unsigned * negated_cols); const unsigned * t_cols, const unsigned * negated_cols) override;
virtual relation_intersection_filter_fn * mk_filter_by_intersection_fn(const relation_base & t, relation_intersection_filter_fn * mk_filter_by_intersection_fn(const relation_base & t,
const relation_base & src, unsigned joined_col_cnt, const relation_base & src, unsigned joined_col_cnt,
const unsigned * t_cols, const unsigned * src_cols); const unsigned * t_cols, const unsigned * src_cols) override;
}; };
@ -173,7 +173,7 @@ namespace datalog {
} }
} }
virtual void deallocate() { void deallocate() override {
get_plugin().recycle(this); get_plugin().recycle(this);
} }
@ -183,7 +183,7 @@ namespace datalog {
return static_cast<explanation_relation_plugin &>(relation_base::get_plugin()); return static_cast<explanation_relation_plugin &>(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(); ast_manager& m = fml.get_manager();
fml = m.mk_eq(m.mk_var(0, m.get_sort(m_data[0])), m_data[0]); 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; 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; m_empty = true;
} }
virtual void add_fact(const relation_fact & f) { void add_fact(const relation_fact & f) override {
SASSERT(empty()); SASSERT(empty());
assign_data(f); assign_data(f);
} }
virtual bool contains_fact(const relation_fact & f) const { bool contains_fact(const relation_fact & f) const override {
UNREACHABLE(); UNREACHABLE();
throw 0; throw 0;
} }
virtual explanation_relation * clone() const { explanation_relation * clone() const override {
explanation_relation * res = static_cast<explanation_relation *>(get_plugin().mk_empty(get_signature())); explanation_relation * res = static_cast<explanation_relation *>(get_plugin().mk_empty(get_signature()));
res->m_empty = m_empty; res->m_empty = m_empty;
SASSERT(res->m_data.empty()); SASSERT(res->m_data.empty());
@ -228,7 +228,7 @@ namespace datalog {
return res; return res;
} }
virtual relation_base * complement(func_decl* pred) const { relation_base * complement(func_decl* pred) const override {
explanation_relation * res = static_cast<explanation_relation *>(get_plugin().mk_empty(get_signature())); explanation_relation * res = static_cast<explanation_relation *>(get_plugin().mk_empty(get_signature()));
if (empty()) { if (empty()) {
res->set_undefined(); 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()) { if (empty()) {
out << "<empty explanation relation>\n"; out << "<empty explanation relation>\n";
return; return;
@ -298,7 +298,7 @@ namespace datalog {
join_fn(const relation_signature & sig1, const relation_signature & sig2) join_fn(const relation_signature & sig1, const relation_signature & sig2)
: convenient_relation_join_fn(sig1, sig2, 0, 0, 0) {} : 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<const explanation_relation &>(r1_0); const explanation_relation & r1 = static_cast<const explanation_relation &>(r1_0);
const explanation_relation & r2 = static_cast<const explanation_relation &>(r2_0); const explanation_relation & r2 = static_cast<const explanation_relation &>(r2_0);
explanation_relation_plugin & plugin = r1.get_plugin(); 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) project_fn(const relation_signature & sig, unsigned col_cnt, const unsigned * removed_cols)
: convenient_relation_project_fn(sig, col_cnt, 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<const explanation_relation &>(r0); const explanation_relation & r = static_cast<const explanation_relation &>(r0);
explanation_relation_plugin & plugin = r.get_plugin(); 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) rename_fn(const relation_signature & sig, unsigned permutation_cycle_len, const unsigned * permutation_cycle)
: convenient_relation_rename_fn(sig, permutation_cycle_len, 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<const explanation_relation &>(r0); const explanation_relation & r = static_cast<const explanation_relation &>(r0);
explanation_relation_plugin & plugin = r.get_plugin(); explanation_relation_plugin & plugin = r.get_plugin();
@ -382,7 +382,7 @@ namespace datalog {
class explanation_relation_plugin::union_fn : public relation_union_fn { class explanation_relation_plugin::union_fn : public relation_union_fn {
scoped_ptr<relation_union_fn> m_delta_union_fun; scoped_ptr<relation_union_fn> m_delta_union_fun;
public: 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<explanation_relation &>(tgt0); explanation_relation & tgt = static_cast<explanation_relation &>(tgt0);
const explanation_relation & src = static_cast<const explanation_relation &>(src0); const explanation_relation & src = static_cast<const explanation_relation &>(src0);
explanation_relation * delta = delta0 ? static_cast<explanation_relation *>(delta0) : 0; explanation_relation * delta = delta0 ? static_cast<explanation_relation *>(delta0) : 0;
@ -418,7 +418,7 @@ namespace datalog {
class explanation_relation_plugin::foreign_union_fn : public relation_union_fn { class explanation_relation_plugin::foreign_union_fn : public relation_union_fn {
scoped_ptr<relation_union_fn> m_delta_union_fun; scoped_ptr<relation_union_fn> m_delta_union_fun;
public: 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<explanation_relation &>(tgt0); explanation_relation & tgt = static_cast<explanation_relation &>(tgt0);
explanation_relation * delta = delta0 ? static_cast<explanation_relation *>(delta0) : 0; explanation_relation * delta = delta0 ? static_cast<explanation_relation *>(delta0) : 0;
@ -456,7 +456,7 @@ namespace datalog {
m_col_idx(col_idx), m_col_idx(col_idx),
m_new_rule(std::move(new_rule)) {} m_new_rule(std::move(new_rule)) {}
virtual void operator()(relation_base & r0) { void operator()(relation_base & r0) override {
explanation_relation & r = static_cast<explanation_relation &>(r0); explanation_relation & r = static_cast<explanation_relation &>(r0);
if (!r.is_undefined(m_col_idx)) { 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 { class explanation_relation_plugin::negation_filter_fn : public relation_intersection_filter_fn {
public: public:
virtual void operator()(relation_base & r, const relation_base & neg) { void operator()(relation_base & r, const relation_base & neg) override {
if (!neg.empty()) { if (!neg.empty()) {
r.reset(); r.reset();
} }
@ -531,7 +531,7 @@ namespace datalog {
intersection_filter_fn(explanation_relation_plugin & plugin) intersection_filter_fn(explanation_relation_plugin & plugin)
: m_union_decl(plugin.m_union_decl) {} : 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<explanation_relation &>(tgt0); explanation_relation & tgt = static_cast<explanation_relation &>(tgt0);
const explanation_relation & src = static_cast<const explanation_relation &>(src0); const explanation_relation & src = static_cast<const explanation_relation &>(src0);

View file

@ -76,7 +76,7 @@ namespace datalog {
return get_union_decl(m_context); 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); static expr* get_explanation(relation_base const& r);
}; };

View file

@ -69,7 +69,7 @@ namespace datalog {
public: public:
mk_similarity_compressor(context & ctx); mk_similarity_compressor(context & ctx);
rule_set * operator()(rule_set const & source); rule_set * operator()(rule_set const & source) override;
}; };
}; };

View file

@ -54,7 +54,7 @@ namespace datalog {
public: public:
mk_simple_joins(context & ctx); mk_simple_joins(context & ctx);
rule_set * operator()(rule_set const & source); rule_set * operator()(rule_set const & source) override;
}; };
}; };

View file

@ -444,12 +444,12 @@ namespace datalog {
init(r1.get_signature(), 1, rels1, r2.get_signature(), 1, rels2, col_cnt, cols1, cols2); 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_joins);
dealloc_ptr_vector_content(m_full); 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);); TRACE("dl", _r1.display(tout); _r2.display(tout););
ptr_vector<relation_base> relations; ptr_vector<relation_base> relations;
unsigned sz = m_joins.size(); unsigned sz = m_joins.size();
@ -491,9 +491,9 @@ namespace datalog {
m_sig(std::move(s)), m_sig(std::move(s)),
m_transforms(num_trans, trans) {} 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 const& r = get(_r);
product_relation_plugin& p = r.get_plugin(); product_relation_plugin& p = r.get_plugin();
SASSERT(m_transforms.size() == r.size()); SASSERT(m_transforms.size() == r.size());
@ -628,14 +628,14 @@ namespace datalog {
init(tgt.m_relations, src.m_relations, delta ? &delta->m_relations : 0); init(tgt.m_relations, src.m_relations, delta ? &delta->m_relations : 0);
} }
~aligned_union_fn() { ~aligned_union_fn() override {
unsigned sz = m_unions.size(); unsigned sz = m_unions.size();
for(unsigned i=0; i<sz; i++) { for(unsigned i=0; i<sz; i++) {
dealloc_ptr_vector_content(m_unions[i]); dealloc_ptr_vector_content(m_unions[i]);
} }
} }
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 {
TRACE("dl", _tgt.display(tout << "dst:\n"); _src.display(tout << "src:\n");); TRACE("dl", _tgt.display(tout << "dst:\n"); _src.display(tout << "src:\n"););
SASSERT(m_plugin.check_kind(_tgt)); SASSERT(m_plugin.check_kind(_tgt));
SASSERT(m_plugin.check_kind(_src)); SASSERT(m_plugin.check_kind(_src));
@ -748,7 +748,7 @@ namespace datalog {
} }
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 {
TRACE("dl_verbose", _tgt.display(tout << "dst:\n"); _src.display(tout << "src:\n");); TRACE("dl_verbose", _tgt.display(tout << "dst:\n"); _src.display(tout << "src:\n"););
product_relation& tgt = get(_tgt); product_relation& tgt = get(_tgt);
product_relation const& src0 = get(_src); product_relation const& src0 = get(_src);
@ -783,7 +783,7 @@ namespace datalog {
: m_single_rel_idx(single_rel_idx), : m_single_rel_idx(single_rel_idx),
m_inner_union_fun(inner_union_fun) {} m_inner_union_fun(inner_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 {
TRACE("dl", tgt.display(tout); _src.display(tout); ); TRACE("dl", tgt.display(tout); _src.display(tout); );
product_relation const& src = get(_src); product_relation const& src = get(_src);
(*m_inner_union_fun)(tgt, src[m_single_rel_idx], delta); (*m_inner_union_fun)(tgt, src[m_single_rel_idx], delta);
@ -834,9 +834,9 @@ namespace datalog {
mutator_fn(unsigned sz, relation_mutator_fn** muts): mutator_fn(unsigned sz, relation_mutator_fn** muts):
m_mutators(sz, muts) {} m_mutators(sz, muts) {}
~mutator_fn() { dealloc_ptr_vector_content(m_mutators); } ~mutator_fn() override { dealloc_ptr_vector_content(m_mutators); }
virtual void operator()(relation_base & _r) { void operator()(relation_base & _r) override {
TRACE("dl", _r.display(tout);); TRACE("dl", _r.display(tout););
product_relation& r = get(_r); product_relation& r = get(_r);
SASSERT(m_mutators.size() == r.size()); SASSERT(m_mutators.size() == r.size());
@ -911,9 +911,9 @@ namespace datalog {
} }
} }
~filter_interpreted_fn() { dealloc_ptr_vector_content(m_mutators); } ~filter_interpreted_fn() override { dealloc_ptr_vector_content(m_mutators); }
void operator()(relation_base& _r) { void operator()(relation_base& _r) override {
TRACE("dl", _r.display(tout);); TRACE("dl", _r.display(tout););
product_relation const& r = get(_r); product_relation const& r = get(_r);
for (unsigned i = 0; i < m_attach.size(); ++i) { for (unsigned i = 0; i < m_attach.size(); ++i) {

View file

@ -59,37 +59,37 @@ namespace datalog {
product_relation_plugin(relation_manager& m); product_relation_plugin(relation_manager& m);
virtual void initialize(family_id fid); void initialize(family_id fid) override;
virtual bool can_handle_signature(const relation_signature & s); bool can_handle_signature(const relation_signature & s) override;
virtual bool can_handle_signature(const relation_signature & s, family_id kind); bool can_handle_signature(const relation_signature & s, family_id kind) override;
static symbol get_name() { return symbol("product_relation"); } static symbol get_name() { return symbol("product_relation"); }
family_id get_relation_kind(const relation_signature & sig, const rel_spec & spec); family_id get_relation_kind(const relation_signature & sig, const rel_spec & spec);
virtual relation_base * mk_empty(const relation_signature & s); relation_base * mk_empty(const relation_signature & s) override;
virtual relation_base * mk_empty(const relation_signature & s, family_id kind); 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;
virtual relation_base * mk_full(func_decl* p, const relation_signature & s, family_id kind); relation_base * mk_full(func_decl* p, const relation_signature & s, family_id kind) override;
protected: protected:
virtual relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2, relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2,
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override;
virtual relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt,
const unsigned * removed_cols); const unsigned * removed_cols) override;
virtual relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len,
const unsigned * permutation_cycle); const unsigned * permutation_cycle) override;
virtual relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src,
const relation_base * delta); const relation_base * delta) override;
virtual relation_union_fn * mk_widen_fn(const relation_base & tgt, const relation_base & src, relation_union_fn * mk_widen_fn(const relation_base & tgt, const relation_base & src,
const relation_base * delta); const relation_base * delta) override;
virtual relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt,
const unsigned * identical_cols); const unsigned * identical_cols) override;
virtual relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value,
unsigned col); unsigned col) override;
virtual relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition); relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition) override;
static bool is_product_relation(relation_base const& r); static bool is_product_relation(relation_base const& r);
@ -154,15 +154,15 @@ namespace datalog {
product_relation(product_relation_plugin& p, relation_signature const& s); product_relation(product_relation_plugin& p, relation_signature const& s);
product_relation(product_relation_plugin& p, relation_signature const& s, unsigned num_relations, relation_base** relations); product_relation(product_relation_plugin& p, relation_signature const& s, unsigned num_relations, relation_base** relations);
~product_relation(); ~product_relation() override;
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 product_relation * clone() const; product_relation * clone() const override;
virtual product_relation * complement(func_decl* p) const; product_relation * complement(func_decl* p) const override;
virtual void display(std::ostream & out) const; void display(std::ostream & out) const override;
virtual void to_formula(expr_ref& fml) const; void to_formula(expr_ref& fml) const override;
product_relation_plugin& get_plugin() const; product_relation_plugin& get_plugin() const;
unsigned size() const { return m_relations.size(); } unsigned size() const { return m_relations.size(); }
@ -175,7 +175,7 @@ namespace datalog {
*/ */
bool try_get_single_non_transparent(unsigned & idx) const; bool try_get_single_non_transparent(unsigned & idx) const;
virtual bool is_precise() const { bool is_precise() const override {
for (unsigned i = 0; i < m_relations.size(); ++i) { for (unsigned i = 0; i < m_relations.size(); ++i) {
if (!m_relations[i]->is_precise()) { if (!m_relations[i]->is_precise()) {
return false; return false;

View file

@ -538,7 +538,7 @@ namespace datalog {
class relation_manager::empty_signature_relation_join_fn : public relation_join_fn { class relation_manager::empty_signature_relation_join_fn : public relation_join_fn {
public: 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";); TRACE("dl", tout << r1.get_plugin().get_name() << " " << r2.get_plugin().get_name() << "\n";);
if(r1.get_signature().empty()) { if(r1.get_signature().empty()) {
if(r1.empty()) { if(r1.empty()) {
@ -615,7 +615,7 @@ namespace datalog {
m_project(0), m_project(0),
m_removed_cols(removed_col_cnt, removed_cols) {} 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<relation_base> t1 = t.clone(); scoped_rel<relation_base> t1 = t.clone();
(*m_filter)(*t1); (*m_filter)(*t1);
if( !m_project) { if( !m_project) {
@ -658,11 +658,11 @@ namespace datalog {
default_relation_apply_sequential_fn(unsigned n, relation_mutator_fn ** mutators): default_relation_apply_sequential_fn(unsigned n, relation_mutator_fn ** mutators):
m_mutators(n, 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<relation_mutator_fn>()); std::for_each(m_mutators.begin(), m_mutators.end(), delete_proc<relation_mutator_fn>());
} }
virtual void operator()(relation_base& t) { void operator()(relation_base& t) override {
for (unsigned i = 0; i < m_mutators.size(); ++i) { for (unsigned i = 0; i < m_mutators.size(); ++i) {
if (t.empty()) return; if (t.empty()) return;
(*(m_mutators[i]))(t); (*(m_mutators[i]))(t);
@ -688,7 +688,7 @@ namespace datalog {
const unsigned * removed_cols) const unsigned * removed_cols)
: m_join(join), m_project(0), m_removed_cols(removed_col_cnt, 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<relation_base> aux = (*m_join)(t1, t2); scoped_rel<relation_base> aux = (*m_join)(t1, t2);
if(!m_project) { if(!m_project) {
relation_manager & rmgr = aux->get_plugin().get_manager(); 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) default_relation_select_equal_and_project_fn(relation_mutator_fn * filter, relation_transformer_fn * project)
: m_filter(filter), m_project(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";); TRACE("dl", tout << t1.get_plugin().get_name() << "\n";);
scoped_rel<relation_base> aux = t1.clone(); scoped_rel<relation_base> aux = t1.clone();
(*m_filter)(*aux); (*m_filter)(*aux);
@ -823,7 +823,7 @@ namespace datalog {
default_relation_intersection_filter_fn(relation_join_fn * join_fun, relation_union_fn * union_fun) 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) {} : 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<relation_base> filtered_rel = (*m_join_fun)(tgt, intersected_obj); scoped_rel<relation_base> filtered_rel = (*m_join_fun)(tgt, intersected_obj);
TRACE("dl", TRACE("dl",
tgt.display(tout << "tgt:\n"); tgt.display(tout << "tgt:\n");
@ -926,7 +926,7 @@ namespace datalog {
const unsigned * cols1, const unsigned * cols2) const unsigned * cols1, const unsigned * cols2)
: convenient_table_join_fn(t1_sig, t2_sig, col_cnt, cols1, cols2), m_col_cnt(col_cnt) {} : 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(); table_plugin * plugin = &t1.get_plugin();
const table_signature & res_sign = get_result_signature(); const table_signature & res_sign = get_result_signature();
@ -1037,15 +1037,15 @@ namespace datalog {
SASSERT(removed_col_cnt>0); 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(); 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); 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); return auxiliary_table_transformer_fn::operator()(t);
} }
}; };
@ -1054,7 +1054,7 @@ namespace datalog {
const table_signature m_empty_sig; const table_signature m_empty_sig;
public: public:
null_signature_table_project_fn() : m_empty_sig() {} 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(); relation_manager & m = t.get_plugin().get_manager();
table_base * res = m.mk_empty_table(m_empty_sig); table_base * res = m.mk_empty_table(m_empty_sig);
if(!t.empty()) { if(!t.empty()) {
@ -1096,14 +1096,14 @@ namespace datalog {
m_removed_cols(removed_col_cnt, removed_cols) {} m_removed_cols(removed_col_cnt, removed_cols) {}
class unreachable_reducer : public table_row_pair_reduce_fn { 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 //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) //(see code of the table_signature::from_join_project function)
UNREACHABLE(); 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); table_base * aux = (*m_join)(t1, t2);
if(m_project==0) { if(m_project==0) {
relation_manager & rmgr = aux->get_plugin().get_manager(); relation_manager & rmgr = aux->get_plugin().get_manager();
@ -1154,15 +1154,15 @@ namespace datalog {
SASSERT(permutation_cycle_len>=2); 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(); 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); 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); return auxiliary_table_transformer_fn::operator()(t);
} }
@ -1190,7 +1190,7 @@ namespace datalog {
class relation_manager::default_table_union_fn : public table_union_fn { class relation_manager::default_table_union_fn : public table_union_fn {
table_fact m_row; table_fact m_row;
public: 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 it = src.begin();
table_base::iterator iend = src.end(); table_base::iterator iend = src.end();
@ -1283,7 +1283,7 @@ namespace datalog {
SASSERT(col_cnt>=2); 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]]; table_element val=f[m_identical_cols[0]];
for(unsigned i=1; i<m_col_cnt; i++) { for(unsigned i=1; i<m_col_cnt; i++) {
if(f[m_identical_cols[i]]!=val) { if(f[m_identical_cols[i]]!=val) {
@ -1293,7 +1293,7 @@ namespace datalog {
return false; return false;
} }
virtual void operator()(table_base & t) { void operator()(table_base & t) override {
auxiliary_table_filter_fn::operator()(t); auxiliary_table_filter_fn::operator()(t);
} }
@ -1318,11 +1318,11 @@ namespace datalog {
: m_value(value), : m_value(value),
m_col(col) {} m_col(col) {}
virtual bool should_remove(const table_fact & f) const { bool should_remove(const table_fact & f) const override {
return f[m_col]!=m_value; return f[m_col]!=m_value;
} }
virtual void operator()(table_base & t) { void operator()(table_base & t) override {
auxiliary_table_filter_fn::operator()(t); auxiliary_table_filter_fn::operator()(t);
} }
}; };
@ -1346,11 +1346,11 @@ namespace datalog {
m_value(value) { m_value(value) {
} }
virtual bool should_remove(const table_fact & f) const { bool should_remove(const table_fact & f) const override {
return f[m_column] == m_value; return f[m_column] == m_value;
} }
virtual void operator()(table_base & t) { void operator()(table_base & t) override {
auxiliary_table_filter_fn::operator()(t); auxiliary_table_filter_fn::operator()(t);
} }
@ -1402,7 +1402,7 @@ namespace datalog {
m_free_vars(m_condition); m_free_vars(m_condition);
} }
virtual bool should_remove(const table_fact & f) const { bool should_remove(const table_fact & f) const override {
expr_ref_vector& args = const_cast<expr_ref_vector&>(m_args); expr_ref_vector& args = const_cast<expr_ref_vector&>(m_args);
args.reset(); args.reset();
@ -1425,7 +1425,7 @@ namespace datalog {
return m_ast_manager.is_false(ground); 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); auxiliary_table_filter_fn::operator()(t);
} }
}; };
@ -1455,7 +1455,7 @@ namespace datalog {
: m_filter(filter), m_condition(condition, ctx.get_manager()), : m_filter(filter), m_condition(condition, ctx.get_manager()),
m_removed_cols(removed_col_cnt, removed_cols) {} 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(); table_base *t2 = tb.clone();
(*m_filter)(*t2); (*m_filter)(*t2);
if (!m_project) { if (!m_project) {
@ -1506,7 +1506,7 @@ namespace datalog {
m_aux_fact.resize(neg_t.get_signature().size()); 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) { if(!m_all_neg_bound || m_overlap) {
table_base::iterator nit = m_negated_table->begin(); table_base::iterator nit = m_negated_table->begin();
table_base::iterator nend = m_negated_table->end(); 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); SASSERT(m_negated_table==0);
flet<const table_base *> flet_neg_table(m_negated_table, &negated_table); flet<const table_base *> flet_neg_table(m_negated_table, &negated_table);
auxiliary_table_filter_fn::operator()(tgt); 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) default_table_select_equal_and_project_fn(table_mutator_fn * filter, table_transformer_fn * project)
: m_filter(filter), m_project(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";); TRACE("dl", tout << t1.get_plugin().get_name() << "\n";);
scoped_rel<table_base> aux = t1.clone(); scoped_rel<table_base> aux = t1.clone();
(*m_filter)(*aux); (*m_filter)(*aux);
@ -1606,9 +1606,9 @@ namespace datalog {
m_union_fn = plugin.mk_union_fn(t, *m_aux_table, static_cast<table_base *>(0)); m_union_fn = plugin.mk_union_fn(t, *m_aux_table, static_cast<table_base *>(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()); SASSERT(t.get_signature()==m_aux_table->get_signature());
if(!m_aux_table->empty()) { if(!m_aux_table->empty()) {
m_aux_table->reset(); m_aux_table->reset();
@ -1664,7 +1664,7 @@ namespace datalog {
m_former_row.resize(get_result_signature().size()); 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 { virtual void modify_fact(table_fact & f) const {
unsigned ofs=1; 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(); table_plugin & plugin = t.get_plugin();
const table_signature & res_sign = get_result_signature(); const table_signature & res_sign = get_result_signature();
SASSERT(plugin.can_handle_signature(res_sign)); SASSERT(plugin.can_handle_signature(res_sign));

View file

@ -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 r1_sieved = r1.get_plugin().is_sieve_relation();
bool r2_sieved = r2.get_plugin().is_sieve_relation(); bool r2_sieved = r2.get_plugin().is_sieve_relation();
SASSERT(r1_sieved || r2_sieved); SASSERT(r1_sieved || r2_sieved);
@ -357,7 +357,7 @@ namespace datalog {
get_result_signature() = result_sig; 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()); SASSERT(r0.get_plugin().is_sieve_relation());
const sieve_relation & r = static_cast<const sieve_relation &>(r0); const sieve_relation & r = static_cast<const sieve_relation &>(r0);
sieve_relation_plugin & plugin = r.get_plugin(); sieve_relation_plugin & plugin = r.get_plugin();
@ -439,7 +439,7 @@ namespace datalog {
public: public:
union_fn(relation_union_fn * union_fun) : m_union_fun(union_fun) {} 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 tgt_sieved = tgt.get_plugin().is_sieve_relation();
bool src_sieved = src.get_plugin().is_sieve_relation(); bool src_sieved = src.get_plugin().is_sieve_relation();
bool delta_sieved = delta && delta->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) filter_fn(relation_mutator_fn * inner_fun)
: m_inner_fun(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()); SASSERT(r0.get_plugin().is_sieve_relation());
sieve_relation & r = static_cast<sieve_relation &>(r0); sieve_relation & r = static_cast<sieve_relation &>(r0);
@ -600,7 +600,7 @@ namespace datalog {
negation_filter_fn(relation_intersection_filter_fn * inner_fun) negation_filter_fn(relation_intersection_filter_fn * inner_fun)
: m_inner_fun(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 r_sieved = r.get_plugin().is_sieve_relation();
bool neg_sieved = neg.get_plugin().is_sieve_relation(); bool neg_sieved = neg.get_plugin().is_sieve_relation();
SASSERT(r_sieved || neg_sieved); SASSERT(r_sieved || neg_sieved);

View file

@ -85,7 +85,7 @@ namespace datalog {
sieve_relation_plugin(relation_manager & manager); 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 get_relation_kind(const relation_signature & sig, const bool * inner_columns,
family_id inner_kind); family_id inner_kind);
@ -95,15 +95,15 @@ namespace datalog {
return get_relation_kind(sig, inner_columns.c_ptr(), inner_kind); 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); sieve_relation * mk_empty(const sieve_relation & original);
virtual relation_base * mk_empty(const relation_base & original); relation_base * mk_empty(const relation_base & original) override;
virtual relation_base * mk_empty(const relation_signature & s, family_id kind); relation_base * mk_empty(const relation_signature & s, family_id kind) override;
sieve_relation * mk_empty(const relation_signature & s, relation_plugin & inner_plugin); 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 * 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, sieve_relation * mk_from_inner(const relation_signature & s, const bool * inner_columns,
@ -116,22 +116,22 @@ namespace datalog {
protected: protected:
virtual relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2, relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2,
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override;
virtual relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt,
const unsigned * removed_cols); const unsigned * removed_cols) override;
virtual relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len,
const unsigned * permutation_cycle); const unsigned * permutation_cycle) override;
virtual relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src,
const relation_base * delta); const relation_base * delta) override;
virtual relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt,
const unsigned * identical_cols); const unsigned * identical_cols) override;
virtual relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value,
unsigned col); unsigned col) override;
virtual relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition); relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition) override;
virtual relation_intersection_filter_fn * mk_filter_by_negation_fn(const relation_base & t, relation_intersection_filter_fn * mk_filter_by_negation_fn(const relation_base & t,
const relation_base & negated_obj, unsigned joined_col_cnt, const relation_base & negated_obj, unsigned joined_col_cnt,
const unsigned * t_cols, const unsigned * negated_cols); const unsigned * t_cols, const unsigned * negated_cols) override;
}; };
@ -176,18 +176,18 @@ namespace datalog {
relation_base & get_inner() { return *m_inner; } relation_base & get_inner() { return *m_inner; }
const relation_base & get_inner() const { return *m_inner; } const relation_base & get_inner() const { return *m_inner; }
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 sieve_relation * clone() const; sieve_relation * clone() const override;
virtual relation_base * complement(func_decl*p) const; relation_base * complement(func_decl*p) const override;
virtual void to_formula(expr_ref& fml) const; void to_formula(expr_ref& fml) const override;
virtual bool empty() const { return get_inner().empty(); } bool empty() const override { return get_inner().empty(); }
virtual void reset() { get_inner().reset(); } void reset() override { get_inner().reset(); }
virtual unsigned get_size_estimate_rows() const { return get_inner().get_size_estimate_rows(); } unsigned get_size_estimate_rows() const override { return get_inner().get_size_estimate_rows(); }
virtual unsigned get_size_estimate_bytes() const { return get_inner().get_size_estimate_bytes(); } 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;
}; };

View file

@ -198,7 +198,7 @@ namespace datalog {
row_interface(t), row_interface(t),
m_parent(parent) {} 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); return m_parent.m_layout.get(m_parent.m_ptr, col);
} }
@ -218,15 +218,15 @@ namespace datalog {
m_row_obj(t, *this), m_row_obj(t, *this),
m_layout(t.m_column_layout) {} m_layout(t.m_column_layout) {}
virtual bool is_finished() const { bool is_finished() const override {
return m_ptr == m_end; return m_ptr == m_end;
} }
virtual row_interface & operator*() { row_interface & operator*() override {
SASSERT(!is_finished()); SASSERT(!is_finished());
return m_row_obj; return m_row_obj;
} }
virtual void operator++() { void operator++() override {
SASSERT(!is_finished()); SASSERT(!is_finished());
m_ptr+=m_fact_size; m_ptr+=m_fact_size;
} }
@ -312,7 +312,7 @@ namespace datalog {
m_keys(key_len*sizeof(table_element)), m_keys(key_len*sizeof(table_element)),
m_first_nonindexed(0) {} 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()) { if (m_first_nonindexed == t.m_data.after_last_offset()) {
return; return;
} }
@ -351,7 +351,7 @@ namespace datalog {
m_first_nonindexed = t.m_data.after_last_offset(); 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); key_to_reserve(key);
store_offset ofs; store_offset ofs;
if (!m_keys.find_reserve_content(ofs)) { if (!m_keys.find_reserve_content(ofs)) {
@ -406,9 +406,9 @@ namespace datalog {
m_key_fact.resize(t.get_signature().size()); 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(); unsigned key_len = m_key_cols.size();
for (unsigned i=0; i<key_len; i++) { for (unsigned i=0; i<key_len; i++) {
m_key_fact[m_permutation[i]] = key[i]; m_key_fact[m_permutation[i]] = key[i];
@ -826,7 +826,7 @@ namespace datalog {
m_removed_cols.push_back(UINT_MAX); m_removed_cols.push_back(UINT_MAX);
} }
virtual table_base * operator()(const table_base & tb1, const table_base & tb2) { table_base * operator()(const table_base & tb1, const table_base & tb2) override {
const sparse_table & t1 = get(tb1); const sparse_table & t1 = get(tb1);
const sparse_table & t2 = get(tb2); const sparse_table & t2 = get(tb2);
@ -882,7 +882,7 @@ namespace datalog {
class sparse_table_plugin::union_fn : public table_union_fn { class sparse_table_plugin::union_fn : public table_union_fn {
public: public:
virtual void operator()(table_base & tgt0, const table_base & src0, table_base * delta0) { void operator()(table_base & tgt0, const table_base & src0, table_base * delta0) override {
verbose_action _va("union"); verbose_action _va("union");
sparse_table & tgt = get(tgt0); sparse_table & tgt = get(tgt0);
const sparse_table & src = get(src0); const sparse_table & src = get(src0);
@ -941,7 +941,7 @@ namespace datalog {
SASSERT(r_idx == m_removed_col_cnt); SASSERT(r_idx == m_removed_col_cnt);
} }
virtual table_base * operator()(const table_base & tb) { table_base * operator()(const table_base & tb) override {
verbose_action _va("project"); verbose_action _va("project");
const sparse_table & t = get(tb); const sparse_table & t = get(tb);
@ -985,7 +985,7 @@ namespace datalog {
m_key.push_back(val); m_key.push_back(val);
} }
virtual table_base * operator()(const table_base & tb) { table_base * operator()(const table_base & tb) override {
verbose_action _va("select_equal_and_project"); verbose_action _va("select_equal_and_project");
const sparse_table & t = get(tb); const sparse_table & t = get(tb);
@ -1072,7 +1072,7 @@ namespace datalog {
} }
} }
virtual table_base * operator()(const table_base & tb) { table_base * operator()(const table_base & tb) override {
verbose_action _va("rename"); verbose_action _va("rename");
const sparse_table & t = get(tb); const sparse_table & t = get(tb);
@ -1210,7 +1210,7 @@ namespace datalog {
} }
} }
virtual void operator()(table_base & tgt0, const table_base & neg0) { void operator()(table_base & tgt0, const table_base & neg0) override {
sparse_table & tgt = get(tgt0); sparse_table & tgt = get(tgt0);
const sparse_table & neg = get(neg0); const sparse_table & neg = get(neg0);
@ -1310,7 +1310,7 @@ namespace datalog {
m_s2_cols.append(src2_cols); m_s2_cols.append(src2_cols);
} }
virtual void operator()(table_base & _t, const table_base & _s1, const table_base& _s2) { void operator()(table_base & _t, const table_base & _s1, const table_base& _s2) override {
verbose_action _va("negated_join"); verbose_action _va("negated_join");
sparse_table& t = get(_t); sparse_table& t = get(_t);

View file

@ -69,39 +69,39 @@ namespace datalog {
typedef sparse_table table; typedef sparse_table table;
sparse_table_plugin(relation_manager & manager); sparse_table_plugin(relation_manager & manager);
~sparse_table_plugin(); ~sparse_table_plugin() override;
virtual bool can_handle_signature(const table_signature & s) bool can_handle_signature(const table_signature & s) override
{ return s.size()>0; } { return s.size()>0; }
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); sparse_table * mk_clone(const sparse_table & t);
protected: protected:
virtual table_join_fn * mk_join_fn(const table_base & t1, const table_base & t2, table_join_fn * mk_join_fn(const table_base & t1, const table_base & t2,
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override;
virtual table_join_fn * mk_join_project_fn(const table_base & t1, const table_base & t2, 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, unsigned col_cnt, const unsigned * cols1, const unsigned * cols2, unsigned removed_col_cnt,
const unsigned * removed_cols); const unsigned * removed_cols) override;
virtual table_union_fn * mk_union_fn(const table_base & tgt, const table_base & src, table_union_fn * mk_union_fn(const table_base & tgt, const table_base & src,
const table_base * delta); const table_base * delta) override;
virtual table_transformer_fn * mk_project_fn(const table_base & t, unsigned col_cnt, table_transformer_fn * mk_project_fn(const table_base & t, unsigned col_cnt,
const unsigned * removed_cols); const unsigned * removed_cols) override;
virtual table_transformer_fn * mk_rename_fn(const table_base & t, unsigned permutation_cycle_len, table_transformer_fn * mk_rename_fn(const table_base & t, unsigned permutation_cycle_len,
const unsigned * permutation_cycle); const unsigned * permutation_cycle) override;
virtual table_transformer_fn * mk_select_equal_and_project_fn(const table_base & t, table_transformer_fn * mk_select_equal_and_project_fn(const table_base & t,
const table_element & value, unsigned col); const table_element & value, unsigned col) override;
virtual table_intersection_filter_fn * mk_filter_by_negation_fn(const table_base & t, table_intersection_filter_fn * mk_filter_by_negation_fn(const table_base & t,
const table_base & negated_obj, unsigned joined_col_cnt, const table_base & negated_obj, unsigned joined_col_cnt,
const unsigned * t_cols, const unsigned * negated_cols); const unsigned * t_cols, const unsigned * negated_cols) override;
virtual table_intersection_join_filter_fn* mk_filter_by_negated_join_fn( table_intersection_join_filter_fn* mk_filter_by_negated_join_fn(
const table_base & t, const table_base & t,
const table_base & src1, const table_base & src1,
const table_base & src2, const table_base & src2,
unsigned_vector const& t_cols, unsigned_vector const& t_cols,
unsigned_vector const& src_cols, unsigned_vector const& src_cols,
unsigned_vector const& src1_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 const& get(table_base const&);
static sparse_table& get(table_base&); 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(sparse_table_plugin & p, const table_signature & sig, unsigned init_capacity=0);
sparse_table(const sparse_table & t); sparse_table(const sparse_table & t);
virtual ~sparse_table(); ~sparse_table() override;
public: public:
virtual void deallocate() { void deallocate() override {
get_plugin().recycle(this); get_plugin().recycle(this);
} }
@ -475,22 +475,22 @@ namespace datalog {
sparse_table_plugin & get_plugin() const sparse_table_plugin & get_plugin() const
{ return static_cast<sparse_table_plugin &>(table_base::get_plugin()); } { return static_cast<sparse_table_plugin &>(table_base::get_plugin()); }
virtual bool empty() const { return row_count()==0; } bool empty() const override { return row_count()==0; }
virtual void add_fact(const table_fact & f); void add_fact(const table_fact & f) override;
virtual bool contains_fact(const table_fact & f) const; bool contains_fact(const table_fact & f) const override;
virtual bool fetch_fact(table_fact & f) const; bool fetch_fact(table_fact & f) const override;
virtual void ensure_fact(const table_fact & f); void ensure_fact(const table_fact & f) override;
virtual void remove_fact(const table_element* fact); void remove_fact(const table_element* fact) override;
virtual void reset(); void reset() override;
virtual table_base * clone() const; table_base * clone() const override;
virtual table_base::iterator begin() const; table_base::iterator begin() const override;
virtual table_base::iterator end() const; table_base::iterator end() const override;
virtual unsigned get_size_estimate_rows() const { return row_count(); } unsigned get_size_estimate_rows() const override { return row_count(); }
virtual unsigned get_size_estimate_bytes() const; unsigned get_size_estimate_bytes() const override;
virtual bool knows_exact_size() const { return true; } bool knows_exact_size() const override { return true; }
}; };
}; };

View file

@ -43,7 +43,7 @@ namespace datalog {
: convenient_table_join_fn(t1_sig, t2_sig, col_cnt, cols1, cols2), : convenient_table_join_fn(t1_sig, t2_sig, col_cnt, cols1, cols2),
m_joined_col_cnt(col_cnt) {} 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<const hashtable_table &>(t1); const hashtable_table & ht1 = static_cast<const hashtable_table &>(t1);
const hashtable_table & ht2 = static_cast<const hashtable_table &>(t2); const hashtable_table & ht2 = static_cast<const hashtable_table &>(t2);
@ -105,10 +105,10 @@ namespace datalog {
public: public:
our_row(const our_iterator_core & parent) : row_interface(parent.m_parent), m_parent(parent) {} 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; 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]; 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_parent(t), m_inner(finished ? t.m_data.end() : t.m_data.begin()),
m_end(t.m_data.end()), m_row_obj(*this) {} 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; return m_inner==m_end;
} }
virtual row_interface & operator*() { row_interface & operator*() override {
SASSERT(!is_finished()); SASSERT(!is_finished());
return m_row_obj; return m_row_obj;
} }
virtual void operator++() { void operator++() override {
SASSERT(!is_finished()); SASSERT(!is_finished());
++m_inner; ++m_inner;
} }
@ -192,7 +192,7 @@ namespace datalog {
const bv_iterator& m_parent; const bv_iterator& m_parent;
public: public:
our_row(const bv_iterator & p) : caching_row_interface(p.m_bv), m_parent(p) {} 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()) { if (result.size() < size()) {
result.resize(size(), 0); 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(); return m_offset == m_bv.m_bv.size();
} }
virtual row_interface & operator*() { row_interface & operator*() override {
SASSERT(!is_finished()); SASSERT(!is_finished());
return m_row_obj; return m_row_obj;
} }
virtual void operator++() { void operator++() override {
SASSERT(!is_finished()); SASSERT(!is_finished());
++m_offset; ++m_offset;
while (!is_finished() && !m_bv.m_bv.get(m_offset)) { while (!is_finished() && !m_bv.m_bv.get(m_offset)) {

View file

@ -61,10 +61,10 @@ namespace datalog {
hashtable_table_plugin(relation_manager & manager) hashtable_table_plugin(relation_manager & manager)
: table_plugin(symbol("hashtable"), 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, table_join_fn * mk_join_fn(const table_base & t1, const table_base & t2,
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override;
}; };
class hashtable_table : public table_base { class hashtable_table : public table_base {
@ -84,23 +84,23 @@ namespace datalog {
hashtable_table_plugin & get_plugin() const hashtable_table_plugin & get_plugin() const
{ return static_cast<hashtable_table_plugin &>(table_base::get_plugin()); } { return static_cast<hashtable_table_plugin &>(table_base::get_plugin()); }
virtual void add_fact(const table_fact & f) { void add_fact(const table_fact & f) override {
m_data.insert(f); 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); table_fact f(get_signature().size(), fact);
m_data.remove(f); 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); return m_data.contains(f);
} }
virtual iterator begin() const; iterator begin() const override;
virtual iterator end() const; iterator end() const override;
virtual unsigned get_size_estimate_rows() const { return m_data.size(); } unsigned get_size_estimate_rows() const override { return m_data.size(); }
virtual unsigned get_size_estimate_bytes() const { return m_data.size()*get_signature().size()*8; } unsigned get_size_estimate_bytes() const override { return m_data.size()*get_signature().size()*8; }
virtual bool knows_exact_size() const { return true; } bool knows_exact_size() const override { return true; }
}; };
// ----------------------------------- // -----------------------------------
@ -118,9 +118,9 @@ namespace datalog {
bitvector_table_plugin(relation_manager & manager) bitvector_table_plugin(relation_manager & manager)
: table_plugin(symbol("bitvector"), 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 { class bitvector_table : public table_base {
@ -137,11 +137,11 @@ namespace datalog {
bitvector_table(bitvector_table_plugin & plugin, const table_signature & sig); bitvector_table(bitvector_table_plugin & plugin, const table_signature & sig);
public: public:
virtual void add_fact(const table_fact & f); void add_fact(const table_fact & f) override;
virtual void remove_fact(const table_element* fact); void remove_fact(const table_element* fact) override;
virtual bool contains_fact(const table_fact & f) const; bool contains_fact(const table_fact & f) const override;
virtual iterator begin() const; iterator begin() const override;
virtual iterator end() const; iterator end() const override;
}; };

View file

@ -82,7 +82,7 @@ namespace datalog {
: convenient_relation_join_project_fn(s1, s2, col_cnt, cols1, cols2, removed_col_cnt, : convenient_relation_join_project_fn(s1, s2, col_cnt, cols1, cols2, removed_col_cnt,
removed_cols), m_tfun(tfun) {} 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(t1.from_table());
SASSERT(t2.from_table()); SASSERT(t2.from_table());
table_relation_plugin & plugin = static_cast<table_relation_plugin &>(t1.get_plugin()); table_relation_plugin & plugin = static_cast<table_relation_plugin &>(t1.get_plugin());
@ -146,7 +146,7 @@ namespace datalog {
tr_transformer_fn(const relation_signature & rsig, table_transformer_fn * tfun) tr_transformer_fn(const relation_signature & rsig, table_transformer_fn * tfun)
: m_tfun(tfun) { get_result_signature() = rsig; } : 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()); SASSERT(t.from_table());
table_relation_plugin & plugin = static_cast<table_relation_plugin &>(t.get_plugin()); table_relation_plugin & plugin = static_cast<table_relation_plugin &>(t.get_plugin());
@ -235,7 +235,7 @@ namespace datalog {
by iterating through the table and calling \c add_fact of the target relation. 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 { 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()); SASSERT(src.from_table());
const table_relation & tr_src = static_cast<const table_relation &>(src); const table_relation & tr_src = static_cast<const table_relation &>(src);
@ -271,7 +271,7 @@ namespace datalog {
public: public:
tr_union_fn(table_union_fn * tfun) : m_tfun(tfun) {} 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(tgt.from_table());
SASSERT(src.from_table()); SASSERT(src.from_table());
SASSERT(!delta || delta->from_table()); SASSERT(!delta || delta->from_table());
@ -311,7 +311,7 @@ namespace datalog {
public: public:
tr_mutator_fn(table_mutator_fn * tfun) : m_tfun(tfun) {} 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()); SASSERT(r.from_table());
table_relation & tr = static_cast<table_relation &>(r); table_relation & tr = static_cast<table_relation &>(r);
(*m_tfun)(tr.get_table()); (*m_tfun)(tr.get_table());
@ -377,7 +377,7 @@ namespace datalog {
public: public:
tr_intersection_filter_fn(table_intersection_filter_fn * tfun) : m_tfun(tfun) {} 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(r.from_table());
SASSERT(src.from_table()); SASSERT(src.from_table());

View file

@ -46,40 +46,40 @@ namespace datalog {
table_plugin & get_table_plugin() { return m_table_plugin; } 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); 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); relation_base * mk_from_table(const relation_signature & s, table_base * t);
protected: protected:
virtual relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2, relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2,
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override;
virtual relation_join_fn * mk_join_project_fn(const relation_base & t1, const relation_base & t2, 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, unsigned joined_col_cnt, const unsigned * cols1, const unsigned * cols2, unsigned removed_col_cnt,
const unsigned * removed_cols); const unsigned * removed_cols) override;
virtual relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt,
const unsigned * removed_cols); const unsigned * removed_cols) override;
virtual relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len,
const unsigned * permutation_cycle); const unsigned * permutation_cycle) override;
virtual relation_transformer_fn * mk_permutation_rename_fn(const relation_base & t, relation_transformer_fn * mk_permutation_rename_fn(const relation_base & t,
const unsigned * permutation); const unsigned * permutation) override;
virtual relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src,
const relation_base * delta); const relation_base * delta) override;
virtual relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt,
const unsigned * identical_cols); const unsigned * identical_cols) override;
virtual relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value,
unsigned col); unsigned col) override;
virtual relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition); relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition) override;
virtual relation_transformer_fn * mk_filter_interpreted_and_project_fn(const relation_base & t, relation_transformer_fn * mk_filter_interpreted_and_project_fn(const relation_base & t,
app * condition, unsigned removed_col_cnt, const unsigned * removed_cols); app * condition, unsigned removed_col_cnt, const unsigned * removed_cols) override;
virtual relation_intersection_filter_fn * mk_filter_by_intersection_fn(const relation_base & t, 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); const relation_base & src, unsigned joined_col_cnt, const unsigned * t_cols, const unsigned * src_cols) override;
virtual relation_intersection_filter_fn * mk_filter_by_negation_fn(const relation_base & t, relation_intersection_filter_fn * mk_filter_by_negation_fn(const relation_base & t,
const relation_base & negated_obj, unsigned joined_col_cnt, const relation_base & negated_obj, unsigned joined_col_cnt,
const unsigned * t_cols, const unsigned * negated_cols); const unsigned * t_cols, const unsigned * negated_cols) override;
virtual relation_transformer_fn * mk_select_equal_and_project_fn(const relation_base & t, relation_transformer_fn * mk_select_equal_and_project_fn(const relation_base & t,
const relation_element & value, unsigned col); const relation_element & value, unsigned col) override;
}; };
class table_relation : public relation_base { class table_relation : public relation_base {
@ -107,24 +107,24 @@ namespace datalog {
table_base & get_table() { return *m_table; } table_base & get_table() { return *m_table; }
const table_base & get_table() const { 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); void add_table_fact(const table_fact & f);
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 relation_base * clone() const; relation_base * clone() const override;
virtual relation_base * complement(func_decl* p) const; relation_base * complement(func_decl* p) const override;
virtual void to_formula(expr_ref& fml) const { get_table().to_formula(get_signature(), fml); } 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); 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(); } unsigned get_size_estimate_rows() const override { 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_bytes() const override { return m_table->get_size_estimate_bytes(); }
virtual bool knows_exact_size() const { return m_table->knows_exact_size(); } bool knows_exact_size() const override { return m_table->knows_exact_size(); }
}; };
}; };

View file

@ -55,12 +55,12 @@ namespace datalog {
} }
} }
virtual ~vector_relation() { ~vector_relation() override {
dealloc(m_eqs); dealloc(m_eqs);
dealloc(m_elems); dealloc(m_elems);
} }
virtual void swap(relation_base& other) { void swap(relation_base& other) override {
vector_relation& o = dynamic_cast<vector_relation&>(other); vector_relation& o = dynamic_cast<vector_relation&>(other);
if (&o == this) return; if (&o == this) return;
std::swap(o.m_eqs, m_eqs); 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)]; } 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_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()) { if (empty()) {
out << "empty\n"; out << "empty\n";
return; return;

View file

@ -36,13 +36,13 @@ namespace datalog {
{ {
} }
virtual bool empty() const { bool empty() const override {
return m_empty; 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_empty);
SASSERT(!m_basis_valid); SASSERT(!m_basis_valid);
m_empty = false; 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(); UNREACHABLE();
return false; return false;
} }
virtual void display(std::ostream & out) const { void display(std::ostream & out) const override {
if (m_fn) { if (m_fn) {
out << m_fn->get_name() << "\n"; 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); karr_relation* result = alloc(karr_relation, m_plugin, m_fn, get_signature(), m_empty);
result->copy(*this); result->copy(*this);
return result; return result;
} }
virtual karr_relation * complement(func_decl*) const { karr_relation * complement(func_decl*) const override {
UNREACHABLE(); UNREACHABLE();
return 0; return 0;
} }
virtual void to_formula(expr_ref& fml) const { void to_formula(expr_ref& fml) const override {
if (empty()) { if (empty()) {
fml = m.mk_false(); fml = m.mk_false();
} }
@ -514,7 +514,7 @@ namespace datalog {
: convenient_relation_join_fn(o1_sig, o2_sig, col_cnt, cols1, cols2){ : 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& r1 = get(_r1);
karr_relation const& r2 = get(_r2); karr_relation const& r2 = get(_r2);
karr_relation_plugin& p = r1.get_plugin(); karr_relation_plugin& p = r1.get_plugin();
@ -540,7 +540,7 @@ namespace datalog {
: convenient_relation_project_fn(orig_sig, removed_col_cnt, removed_cols) { : 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 const& r = get(_r);
karr_relation_plugin& p = r.get_plugin(); karr_relation_plugin& p = r.get_plugin();
karr_relation* result = dynamic_cast<karr_relation*>(p.mk_full(0, get_result_signature())); karr_relation* result = dynamic_cast<karr_relation*>(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) 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) {} : 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 const& r = get(_r);
karr_relation_plugin& p = r.get_plugin(); karr_relation_plugin& p = r.get_plugin();
karr_relation* result = dynamic_cast<karr_relation*>(p.mk_full(0, get_result_signature())); karr_relation* result = dynamic_cast<karr_relation*>(p.mk_full(0, get_result_signature()));
@ -676,7 +676,7 @@ namespace datalog {
public: public:
union_fn() {} 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& r = get(_r);
karr_relation const& src = get(_src); karr_relation const& src = get(_src);
@ -707,7 +707,7 @@ namespace datalog {
filter_identical_fn(unsigned col_cnt, const unsigned * identical_cols) filter_identical_fn(unsigned col_cnt, const unsigned * identical_cols)
: m_identical_cols(col_cnt, 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); karr_relation & r = get(_r);
TRACE("dl", r.display(tout << "src:\n");); TRACE("dl", r.display(tout << "src:\n"););
r.get_ineqs(); r.get_ineqs();
@ -747,7 +747,7 @@ namespace datalog {
m_valid = arith.is_numeral(value, m_value) && m_value.is_int(); 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); karr_relation & r = get(_r);
if (m_valid) { if (m_valid) {
r.get_ineqs(); r.get_ineqs();
@ -779,7 +779,7 @@ namespace datalog {
m_cond(cond, t.get_plugin().get_ast_manager()) { 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); get(t).filter_interpreted(m_cond);
TRACE("dl", tout << mk_pp(m_cond, m_cond.get_manager()) << "\n"; t.display(tout);); TRACE("dl", tout << mk_pp(m_cond, m_cond.get_manager()) << "\n"; t.display(tout););
} }

View file

@ -45,33 +45,33 @@ namespace datalog {
a(get_ast_manager()) 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(); return get_manager().get_context().karr();
} }
static symbol get_name() { return symbol("karr_relation"); } 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& get(relation_base& r);
static karr_relation const & get(relation_base const& r); static karr_relation const & get(relation_base const& r);
virtual relation_join_fn * mk_join_fn( relation_join_fn * mk_join_fn(
const relation_base & t1, const relation_base & t2, const relation_base & t1, const relation_base & t2,
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override;
virtual relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt,
const unsigned * removed_cols); const unsigned * removed_cols) override;
virtual relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len,
const unsigned * permutation_cycle); const unsigned * permutation_cycle) override;
virtual relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src,
const relation_base * delta); const relation_base * delta) override;
virtual relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt,
const unsigned * identical_cols); const unsigned * identical_cols) override;
virtual relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value,
unsigned col); unsigned col) override;
virtual relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition); relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition) override;
private: private:
bool dualizeI(matrix& dst, matrix const& src); bool dualizeI(matrix& dst, matrix const& src);

View file

@ -56,72 +56,72 @@ namespace datalog {
public: public:
rel_context(context& ctx); rel_context(context& ctx);
virtual ~rel_context(); ~rel_context() override;
virtual relation_manager & get_rmanager(); relation_manager & get_rmanager() override;
virtual const relation_manager & get_rmanager() const; const relation_manager & get_rmanager() const override;
ast_manager& get_manager() const { return m; } ast_manager& get_manager() const { return m; }
context& get_context() const { return m_context; } context& get_context() const { return m_context; }
virtual relation_base & get_relation(func_decl * pred); relation_base & get_relation(func_decl * pred) override;
virtual relation_base * try_get_relation(func_decl * pred) const; relation_base * try_get_relation(func_decl * pred) const override;
virtual bool is_empty_relation(func_decl* pred) const; bool is_empty_relation(func_decl* pred) const override;
virtual expr_ref try_get_formula(func_decl * pred) const; expr_ref try_get_formula(func_decl * pred) const override;
virtual expr_ref get_answer() { return m_answer; } expr_ref get_answer() override { return m_answer; }
virtual bool output_profile() const; bool output_profile() const override;
virtual lbool query(expr* q); lbool query(expr* q) override;
virtual lbool query(unsigned num_rels, func_decl * const* rels); lbool query(unsigned num_rels, func_decl * const* rels) override;
virtual void set_predicate_representation(func_decl * pred, unsigned relation_name_cnt, void set_predicate_representation(func_decl * pred, unsigned relation_name_cnt,
symbol const * relation_names); 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. \brief Restrict the set of used predicates to \c res.
The function deallocates unsused relations, it does not deal with rules. 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. \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); return get_rmanager().collect_non_empty_predicates(ps);
} }
/** \brief add facts to relation /** \brief add facts to relation
*/ */
virtual void add_fact(func_decl* pred, relation_fact const& fact); void add_fact(func_decl* pred, relation_fact const& fact) override;
virtual void add_fact(func_decl* pred, table_fact const& fact); void add_fact(func_decl* pred, table_fact const& fact) override;
/** \brief check if facts were added to relation /** \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 \brief Store the relation \c rel under the predicate \c pred. The \c context object
takes over the ownership of the relation 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; void display_output_facts(rule_set const& rules, std::ostream & out) const override;
virtual void display_facts(std::ostream & out) const; 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;
}; };
}; };

View file

@ -328,7 +328,7 @@ namespace datalog {
t2.expand_column_vector(m_cols2); 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& r1 = get(_r1);
udoc_relation const& r2 = get(_r2); udoc_relation const& r2 = get(_r2);
TRACE("doc", r1.display(tout << "r1:\n"); r2.display(tout << "r2:\n");); 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");); TRACE("doc", tb.display(tout << "src:\n"););
udoc_relation const& t = get(tb); udoc_relation const& t = get(tb);
udoc_plugin& p = t.get_plugin(); 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); udoc_relation const& r = get(_r);
TRACE("doc", r.display(tout << "r:\n");); TRACE("doc", r.display(tout << "r:\n"););
udoc_plugin& p = r.get_plugin(); udoc_plugin& p = r.get_plugin();
@ -494,7 +494,7 @@ namespace datalog {
public: public:
union_fn() {} 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");); TRACE("doc", _r.display(tout << "dst:\n"); _src.display(tout << "src:\n"););
udoc_relation& r = get(_r); udoc_relation& r = get(_r);
udoc_relation const& src = get(_src); 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_relation& r = get(_r);
udoc& d = r.get_udoc(); udoc& d = r.get_udoc();
doc_manager& dm = r.get_dm(); doc_manager& dm = r.get_dm();
@ -602,10 +602,10 @@ namespace datalog {
SASSERT(num_bits == hi - lo); SASSERT(num_bits == hi - lo);
dm.tbvm().set(m_filter->pos(), r, hi-1, lo); dm.tbvm().set(m_filter->pos(), r, hi-1, lo);
} }
virtual ~filter_equal_fn() { ~filter_equal_fn() override {
dm.deallocate(m_filter); dm.deallocate(m_filter);
} }
virtual void operator()(relation_base & tb) { void operator()(relation_base & tb) override {
udoc_relation & t = get(tb); udoc_relation & t = get(tb);
t.get_udoc().intersect(dm, *m_filter); t.get_udoc().intersect(dm, *m_filter);
SASSERT(t.get_udoc().well_formed(t.get_dm())); SASSERT(t.get_udoc().well_formed(t.get_dm()));
@ -932,11 +932,11 @@ namespace datalog {
m_udoc.display(dm, tout) << "\n";); m_udoc.display(dm, tout) << "\n";);
} }
virtual ~filter_interpreted_fn() { ~filter_interpreted_fn() override {
m_udoc.reset(dm); m_udoc.reset(dm);
} }
virtual void operator()(relation_base & tb) { void operator()(relation_base & tb) override {
udoc_relation & t = get(tb); udoc_relation & t = get(tb);
udoc& u = t.get_udoc(); udoc& u = t.get_udoc();
SASSERT(u.well_formed(dm)); SASSERT(u.well_formed(dm));
@ -987,7 +987,7 @@ namespace datalog {
// TBD: replace this by "join" given below. // 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 #if 1
return join(get(t1), get(t2)); return join(get(t1), get(t2));
#else #else
@ -1043,7 +1043,7 @@ namespace datalog {
public: public:
join_project_and_fn() {} 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()); udoc_relation *result = get(t1.clone());
result->get_udoc().intersect(result->get_dm(), get(t2).get_udoc()); result->get_udoc().intersect(result->get_dm(), get(t2).get_udoc());
return result; return result;
@ -1121,7 +1121,7 @@ namespace datalog {
neg.expand_column_vector(m_neg_cols); 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& t = get(tb);
udoc_relation const& n = get(negb); udoc_relation const& n = get(negb);
IF_VERBOSE(3, t.display(verbose_stream() << "dst:");); IF_VERBOSE(3, t.display(verbose_stream() << "dst:"););
@ -1223,10 +1223,10 @@ namespace datalog {
t.compile_guard(guard, m_udoc, m_to_delete); t.compile_guard(guard, m_udoc, m_to_delete);
} }
virtual ~filter_proj_fn() { ~filter_proj_fn() override {
m_udoc.reset(dm); 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_relation const & t = get(tb);
udoc const& u1 = t.get_udoc(); udoc const& u1 = t.get_udoc();
doc_manager& dm = t.get_dm(); doc_manager& dm = t.get_dm();

View file

@ -39,21 +39,21 @@ namespace datalog {
expr_ref to_formula(doc const& d) const; expr_ref to_formula(doc const& d) const;
public: public:
udoc_relation(udoc_plugin& p, relation_signature const& s); udoc_relation(udoc_plugin& p, relation_signature const& s);
virtual ~udoc_relation(); ~udoc_relation() override;
virtual void reset(); void reset() override;
virtual void add_fact(const relation_fact & f); void add_fact(const relation_fact & f) override;
virtual void add_new_fact(const relation_fact & f); void add_new_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 udoc_relation * clone() const; udoc_relation * clone() const override;
virtual udoc_relation * complement(func_decl*) const; udoc_relation * complement(func_decl*) const override;
virtual void to_formula(expr_ref& fml) const; void to_formula(expr_ref& fml) const override;
udoc_plugin& get_plugin() const; udoc_plugin& get_plugin() const;
virtual bool fast_empty() const { return m_elems.is_empty(); } bool fast_empty() const override { return m_elems.is_empty(); }
virtual bool empty() const; bool empty() const override;
virtual void display(std::ostream& out) const; void display(std::ostream& out) const override;
virtual bool is_precise() const { return true; } bool is_precise() const override { return true; }
virtual unsigned get_size_estimate_rows() const { return m_elems.size(); } unsigned get_size_estimate_rows() const override { return m_elems.size(); }
virtual unsigned get_size_estimate_bytes() const; unsigned get_size_estimate_bytes() const override;
doc_manager& get_dm() const { return dm; } doc_manager& get_dm() const { return dm; }
udoc const& get_udoc() const { return m_elems; } udoc const& get_udoc() const { return m_elems; }
@ -113,38 +113,38 @@ namespace datalog {
expr* mk_numeral(rational const& r, sort* s); expr* mk_numeral(rational const& r, sort* s);
public: public:
udoc_plugin(relation_manager& rm); udoc_plugin(relation_manager& rm);
~udoc_plugin(); ~udoc_plugin() override;
virtual bool can_handle_signature(const relation_signature & s); bool can_handle_signature(const relation_signature & s) override;
static symbol get_name() { return symbol("doc"); } static symbol get_name() { return symbol("doc"); }
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;
virtual relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2, relation_join_fn * mk_join_fn(const relation_base & t1, const relation_base & t2,
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2); unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) override;
virtual relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt, relation_transformer_fn * mk_project_fn(const relation_base & t, unsigned col_cnt,
const unsigned * removed_cols); const unsigned * removed_cols) override;
virtual relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len, relation_transformer_fn * mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len,
const unsigned * permutation_cycle); const unsigned * permutation_cycle) override;
virtual relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src, relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src,
const relation_base * delta); const relation_base * delta) override;
virtual relation_union_fn * mk_widen_fn(const relation_base & tgt, const relation_base & src, relation_union_fn * mk_widen_fn(const relation_base & tgt, const relation_base & src,
const relation_base * delta); const relation_base * delta) override;
virtual relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt, relation_mutator_fn * mk_filter_identical_fn(const relation_base & t, unsigned col_cnt,
const unsigned * identical_cols); const unsigned * identical_cols) override;
virtual relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value, relation_mutator_fn * mk_filter_equal_fn(const relation_base & t, const relation_element & value,
unsigned col); unsigned col) override;
virtual relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition); relation_mutator_fn * mk_filter_interpreted_fn(const relation_base & t, app * condition) override;
virtual relation_intersection_filter_fn * mk_filter_by_negation_fn( relation_intersection_filter_fn * mk_filter_by_negation_fn(
const relation_base& t, const relation_base& t,
const relation_base& neg, unsigned joined_col_cnt, const unsigned *t_cols, const relation_base& neg, unsigned joined_col_cnt, const unsigned *t_cols,
const unsigned *negated_cols); const unsigned *negated_cols) override;
virtual relation_transformer_fn * mk_filter_interpreted_and_project_fn( relation_transformer_fn * mk_filter_interpreted_and_project_fn(
const relation_base & t, app * condition, const relation_base & t, app * condition,
unsigned removed_col_cnt, const unsigned * removed_cols); unsigned removed_col_cnt, const unsigned * removed_cols) override;
virtual relation_join_fn * mk_join_project_fn( relation_join_fn * mk_join_project_fn(
relation_base const& t1, relation_base const& t2, relation_base const& t1, relation_base const& t2,
unsigned joined_col_cnt, const unsigned * cols1, const unsigned * cols2, unsigned joined_col_cnt, const unsigned * cols1, const unsigned * cols2,
unsigned removed_col_cnt, const unsigned * removed_cols); unsigned removed_col_cnt, const unsigned * removed_cols) override;
void disable_fast_pass() { m_disable_fast_pass = true; } void disable_fast_pass() { m_disable_fast_pass = true; }
}; };
}; };

View file

@ -45,39 +45,39 @@ class dl_interface : public datalog::engine_base {
public: public:
dl_interface(datalog::context& ctx); 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;
}; };
} }

View file

@ -30,8 +30,8 @@ namespace spacer {
class lemma_sanity_checker : public lemma_generalizer { class lemma_sanity_checker : public lemma_generalizer {
public: public:
lemma_sanity_checker(context& ctx) : lemma_generalizer(ctx) {} lemma_sanity_checker(context& ctx) : lemma_generalizer(ctx) {}
virtual ~lemma_sanity_checker() {} ~lemma_sanity_checker() override {}
virtual void operator()(lemma_ref &lemma); void operator()(lemma_ref &lemma) override;
}; };
/** /**
@ -53,11 +53,11 @@ class lemma_bool_inductive_generalizer : public lemma_generalizer {
public: public:
lemma_bool_inductive_generalizer(context& ctx, unsigned failure_limit) : lemma_bool_inductive_generalizer(context& ctx, unsigned failure_limit) :
lemma_generalizer(ctx), m_failure_limit(failure_limit) {} lemma_generalizer(ctx), m_failure_limit(failure_limit) {}
virtual ~lemma_bool_inductive_generalizer() {} ~lemma_bool_inductive_generalizer() override {}
virtual void operator()(lemma_ref &lemma); void operator()(lemma_ref &lemma) override;
virtual void collect_statistics(statistics& st) const; void collect_statistics(statistics& st) const override;
virtual void reset_statistics() {m_st.reset();} void reset_statistics() override {m_st.reset();}
}; };
class unsat_core_generalizer : public lemma_generalizer { class unsat_core_generalizer : public lemma_generalizer {
@ -72,26 +72,26 @@ class unsat_core_generalizer : public lemma_generalizer {
stats m_st; stats m_st;
public: public:
unsat_core_generalizer(context &ctx) : lemma_generalizer(ctx) {} unsat_core_generalizer(context &ctx) : lemma_generalizer(ctx) {}
virtual ~unsat_core_generalizer() {} ~unsat_core_generalizer() override {}
virtual void operator()(lemma_ref &lemma); void operator()(lemma_ref &lemma) override;
virtual void collect_statistics(statistics &st) const; void collect_statistics(statistics &st) const override;
virtual void reset_statistics() {m_st.reset();} void reset_statistics() override {m_st.reset();}
}; };
class lemma_array_eq_generalizer : public lemma_generalizer { class lemma_array_eq_generalizer : public lemma_generalizer {
public: public:
lemma_array_eq_generalizer(context &ctx) : lemma_generalizer(ctx) {} lemma_array_eq_generalizer(context &ctx) : lemma_generalizer(ctx) {}
virtual ~lemma_array_eq_generalizer() {} ~lemma_array_eq_generalizer() override {}
virtual void operator()(lemma_ref &lemma); void operator()(lemma_ref &lemma) override;
}; };
class lemma_eq_generalizer : public lemma_generalizer { class lemma_eq_generalizer : public lemma_generalizer {
public: public:
lemma_eq_generalizer(context &ctx) : lemma_generalizer(ctx) {} lemma_eq_generalizer(context &ctx) : lemma_generalizer(ctx) {}
virtual ~lemma_eq_generalizer() {} ~lemma_eq_generalizer() override {}
virtual void operator()(lemma_ref &lemma); void operator()(lemma_ref &lemma) override;
}; };

View file

@ -86,10 +86,10 @@ public:
m_farkas_a_const(farkas_a_const) m_farkas_a_const(farkas_a_const)
{} {}
virtual ~itp_solver() {} ~itp_solver() override {}
/* itp solver specific */ /* 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); virtual void get_itp_core(expr_ref_vector &core);
void set_split_literals(bool v) {m_split_literals = v;} void set_split_literals(bool v) {m_split_literals = v;}
bool mk_proxies(expr_ref_vector &v, unsigned from = 0); bool mk_proxies(expr_ref_vector &v, unsigned from = 0);
@ -104,53 +104,53 @@ public:
/* solver interface */ /* 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);} {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);} {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);} {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);} {m_solver.set_produce_models(f);}
virtual void assert_expr(expr *t) void assert_expr(expr *t) override
{m_solver.assert_expr(t);} {m_solver.assert_expr(t);}
virtual void assert_expr(expr *t, expr *a) void assert_expr(expr *t, expr *a) override
{NOT_IMPLEMENTED_YET();} {NOT_IMPLEMENTED_YET();}
virtual void push(); void push() override;
virtual void pop(unsigned n); void pop(unsigned n) override;
virtual unsigned get_scope_level() const unsigned get_scope_level() const override
{return m_solver.get_scope_level();} {return m_solver.get_scope_level();}
virtual lbool check_sat(unsigned num_assumptions, expr * const *assumptions); lbool check_sat(unsigned num_assumptions, expr * const *assumptions) override;
virtual void set_progress_callback(progress_callback *callback) void set_progress_callback(progress_callback *callback) override
{m_solver.set_progress_callback(callback);} {m_solver.set_progress_callback(callback);}
virtual unsigned get_num_assertions() const unsigned get_num_assertions() const override
{return m_solver.get_num_assertions();} {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);} {return m_solver.get_assertion(idx);}
virtual unsigned get_num_assumptions() const unsigned get_num_assumptions() const override
{return m_solver.get_num_assumptions();} {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);} {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); } { return m_solver.display(out, n, es); }
/* check_sat_result interface */ /* check_sat_result interface */
virtual void collect_statistics(statistics &st) const ; void collect_statistics(statistics &st) const override ;
virtual void reset_statistics(); virtual void reset_statistics();
virtual void get_unsat_core(ptr_vector<expr> &r); void get_unsat_core(ptr_vector<expr> &r) override;
virtual void get_model(model_ref &m) {m_solver.get_model(m);} void get_model(model_ref &m) override {m_solver.get_model(m);}
virtual proof *get_proof() {return m_solver.get_proof();} proof *get_proof() override {return m_solver.get_proof();}
virtual std::string reason_unknown() const std::string reason_unknown() const override
{return m_solver.reason_unknown();} {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);} {m_solver.set_reason_unknown(msg);}
virtual void get_labels(svector<symbol> &r) void get_labels(svector<symbol> &r) override
{m_solver.get_labels(r);} {m_solver.get_labels(r);}
virtual ast_manager &get_manager() const {return m;} ast_manager &get_manager() const override {return m;}
virtual void refresh(); virtual void refresh();

View file

@ -190,14 +190,14 @@ namespace qe {
class is_relevant_default : public i_expr_pred { class is_relevant_default : public i_expr_pred {
public: public:
bool operator()(expr* e) { bool operator()(expr* e) override {
return true; return true;
} }
}; };
class mk_atom_default : public i_nnf_atom { class mk_atom_default : public i_nnf_atom {
public: 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; if (pol) result = e;
else result = result.get_manager().mk_not(e); else result = result.get_manager().mk_not(e);
} }

View file

@ -43,7 +43,7 @@ class unsat_core_plugin_lemma : public unsat_core_plugin {
public: public:
unsat_core_plugin_lemma(unsat_core_learner& learner) : unsat_core_plugin(learner){}; 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: private:
void add_lowest_split_to_core(proof* step) const; void add_lowest_split_to_core(proof* step) const;
@ -55,7 +55,7 @@ class unsat_core_plugin_farkas_lemma : public unsat_core_plugin {
public: 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) {}; 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: private:
bool m_split_literals; bool m_split_literals;
@ -71,8 +71,8 @@ private:
public: public:
unsat_core_plugin_farkas_lemma_optimized(unsat_core_learner& learner, ast_manager& m) : unsat_core_plugin(learner), m(m) {}; 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; void compute_partial_core(proof* step) override;
virtual void finalize() override; void finalize() override;
protected: protected:
vector<vector<std::pair<app*, rational> > > m_linear_combinations; vector<vector<std::pair<app*, rational> > > m_linear_combinations;
@ -88,7 +88,7 @@ private:
public: public:
unsat_core_plugin_farkas_lemma_bounded(unsat_core_learner& learner, ast_manager& m) : unsat_core_plugin_farkas_lemma_optimized(learner, m) {}; 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 { class unsat_core_plugin_min_cut : public unsat_core_plugin {
@ -96,8 +96,8 @@ private:
public: public:
unsat_core_plugin_min_cut(unsat_core_learner& learner, ast_manager& m); unsat_core_plugin_min_cut(unsat_core_learner& learner, ast_manager& m);
virtual void compute_partial_core(proof* step) override; void compute_partial_core(proof* step) override;
virtual void finalize() override; void finalize() override;
private: private:
ast_manager& m; ast_manager& m;

View file

@ -65,46 +65,46 @@ private:
void refresh(); void refresh();
public: public:
virtual ~virtual_solver(); ~virtual_solver() override;
virtual unsigned get_num_assumptions() const unsigned get_num_assumptions() const override
{ {
unsigned sz = solver_na2as::get_num_assumptions(); unsigned sz = solver_na2as::get_num_assumptions();
return m_virtual ? sz - 1 : sz; return m_virtual ? sz - 1 : sz;
} }
virtual expr* get_assumption(unsigned idx) const expr* get_assumption(unsigned idx) const override
{ {
if(m_virtual) { idx++; } if(m_virtual) { idx++; }
return solver_na2as::get_assumption(idx); return solver_na2as::get_assumption(idx);
} }
virtual void get_unsat_core(ptr_vector<expr> &r); void get_unsat_core(ptr_vector<expr> &r) override;
virtual void assert_expr(expr *e); void assert_expr(expr *e) override;
virtual void collect_statistics(statistics &st) const {} void collect_statistics(statistics &st) const override {}
virtual void get_model(model_ref &m) {m_context.get_model(m);} void get_model(model_ref &m) override {m_context.get_model(m);}
virtual proof* get_proof(); proof* get_proof() override;
virtual std::string reason_unknown() const std::string reason_unknown() const override
{return m_context.last_failure_as_string();} {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);} {m_context.set_reason_unknown(msg);}
virtual ast_manager& get_manager() const {return m;} ast_manager& get_manager() const override {return m;}
virtual void get_labels(svector<symbol> &r); void get_labels(svector<symbol> &r) override;
virtual void set_produce_models(bool f); void set_produce_models(bool f) override;
virtual bool get_produce_models(); virtual bool get_produce_models();
virtual smt_params &fparams(); virtual smt_params &fparams();
virtual void reset(); virtual void reset();
virtual void set_progress_callback(progress_callback *callback) void set_progress_callback(progress_callback *callback) override
{UNREACHABLE();} {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); void updt_params(params_ref const &p) override;
virtual void collect_param_descrs(param_descrs &r); void collect_param_descrs(param_descrs &r) override;
protected: protected:
virtual lbool check_sat_core(unsigned num_assumptions, expr *const * assumptions); lbool check_sat_core(unsigned num_assumptions, expr *const * assumptions) override;
virtual void push_core(); void push_core() override;
virtual void pop_core(unsigned n); void pop_core(unsigned n) override;
}; };
/// multi-solver abstraction on top of a single smt::kernel /// multi-solver abstraction on top of a single smt::kernel

View file

@ -32,13 +32,13 @@ namespace datalog {
imp* m_imp; imp* m_imp;
public: public:
tab(context& ctx); tab(context& ctx);
~tab(); ~tab() override;
virtual lbool query(expr* query); lbool query(expr* query) override;
virtual void cleanup(); void cleanup() override;
virtual void reset_statistics(); void reset_statistics() override;
virtual void collect_statistics(statistics& st) const; void collect_statistics(statistics& st) const override;
virtual void display_certificate(std::ostream& out) const; void display_certificate(std::ostream& out) const override;
virtual expr_ref get_answer(); expr_ref get_answer() override;
}; };
}; };

View file

@ -66,9 +66,9 @@ namespace datalog {
*/ */
mk_array_blast(context & ctx, unsigned priority); 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;
}; };

View file

@ -40,8 +40,8 @@ namespace datalog {
public: public:
mk_array_eq_rewrite(context & ctx, unsigned priority); mk_array_eq_rewrite(context & ctx, unsigned priority);
rule_set * operator()(rule_set const & source); rule_set * operator()(rule_set const & source) override;
virtual ~mk_array_eq_rewrite(){} ~mk_array_eq_rewrite() override{}
}; };

View file

@ -112,8 +112,8 @@ namespace datalog {
expr_ref_vector getId(app*old_pred, const expr_ref_vector& new_args); expr_ref_vector getId(app*old_pred, const expr_ref_vector& new_args);
public: public:
mk_array_instantiation(context & ctx, unsigned priority); mk_array_instantiation(context & ctx, unsigned priority);
rule_set * operator()(rule_set const & source); rule_set * operator()(rule_set const & source) override;
virtual ~mk_array_instantiation(){} ~mk_array_instantiation() override{}
}; };

View file

@ -28,8 +28,8 @@ namespace datalog {
context& m_ctx; context& m_ctx;
public: public:
mk_backwards(context & ctx, unsigned priority = 33000); mk_backwards(context & ctx, unsigned priority = 33000);
~mk_backwards(); ~mk_backwards() override;
rule_set * operator()(rule_set const & source); rule_set * operator()(rule_set const & source) override;
}; };
}; };

View file

@ -59,11 +59,11 @@ namespace datalog {
m_new_funcs.push_back(new_f); 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); 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) { for (unsigned i = 0; i < m_new_funcs.size(); ++i) {
func_decl* p = m_new_funcs[i].get(); func_decl* p = m_new_funcs[i].get();
func_decl* q = m_old_funcs[i].get(); func_decl* q = m_old_funcs[i].get();

View file

@ -28,8 +28,8 @@ namespace datalog {
impl* m_impl; impl* m_impl;
public: public:
mk_bit_blast(context & ctx, unsigned priority = 35000); mk_bit_blast(context & ctx, unsigned priority = 35000);
~mk_bit_blast(); ~mk_bit_blast() override;
rule_set * operator()(rule_set const & source); rule_set * operator()(rule_set const & source) override;
}; };
}; };

View file

@ -52,7 +52,7 @@ namespace datalog {
*/ */
mk_coalesce(context & ctx); mk_coalesce(context & ctx);
rule_set * operator()(rule_set const & source); rule_set * operator()(rule_set const & source) override;
}; };
}; };

View file

@ -42,7 +42,7 @@ namespace datalog {
m(ctx.get_manager()), m(ctx.get_manager()),
m_context(ctx) {} m_context(ctx) {}
rule_set * operator()(rule_set const & source); rule_set * operator()(rule_set const & source) override;
}; };
} }

View file

@ -73,11 +73,11 @@ namespace datalog {
public: public:
mk_filter_rules(context & ctx); 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. \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;
}; };
}; };

View file

@ -90,7 +90,7 @@ namespace datalog {
bool transform_rules(const rule_set & orig, rule_set & tgt); bool transform_rules(const rule_set & orig, rule_set & tgt);
public: public:
mk_interp_tail_simplifier(context & ctx, unsigned priority=40000); 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 should be retained, assign transformed version to res and return true;
if rule can be deleted, return false. if rule can be deleted, return false.
@ -100,7 +100,7 @@ namespace datalog {
*/ */
bool transform_rule(rule * r, rule_ref& res); bool transform_rule(rule * r, rule_ref& res);
rule_set * operator()(rule_set const & source); rule_set * operator()(rule_set const & source) override;
}; };
}; };

View file

@ -111,7 +111,7 @@ namespace datalog {
add_invariant_model_converter(ast_manager& m): m(m), a(m), m_funcs(m), m_invs(m) {} 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) { void add(func_decl* p, expr* inv) {
if (!m.is_true(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) { for (unsigned i = 0; i < m_funcs.size(); ++i) {
func_decl* p = m_funcs[i].get(); func_decl* p = m_funcs[i].get();
func_interp* f = mr->get_func_interp(p); 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); add_invariant_model_converter* mc = alloc(add_invariant_model_converter, m);
for (unsigned i = 0; i < m_funcs.size(); ++i) { for (unsigned i = 0; i < m_funcs.size(); ++i) {
mc->add(translator(m_funcs[i].get()), m_invs[i].get()); mc->add(translator(m_funcs[i].get()), m_invs[i].get());

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