mirror of
https://github.com/Z3Prover/z3
synced 2025-08-28 05:58:55 +00:00
merge with master
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
commit
c513f3ca09
883 changed files with 13979 additions and 16480 deletions
|
@ -176,7 +176,7 @@ namespace datalog {
|
|||
if (m_defs.find(e1, v)) {
|
||||
cache.insert(e, v);
|
||||
}
|
||||
else if (!insert_def(r, e1, 0)) {
|
||||
else if (!insert_def(r, e1, nullptr)) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
|
@ -320,7 +320,7 @@ namespace datalog {
|
|||
rule_set * mk_array_blast::operator()(rule_set const & source) {
|
||||
|
||||
if (!m_ctx.array_blast ()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
rule_set* rules = alloc(rule_set, m_ctx);
|
||||
rules->inherit_predicates(source);
|
||||
|
@ -331,7 +331,7 @@ namespace datalog {
|
|||
}
|
||||
if (!change) {
|
||||
dealloc(rules);
|
||||
rules = 0;
|
||||
rules = nullptr;
|
||||
}
|
||||
return rules;
|
||||
}
|
||||
|
|
|
@ -66,9 +66,9 @@ namespace datalog {
|
|||
*/
|
||||
mk_array_blast(context & ctx, unsigned priority);
|
||||
|
||||
virtual ~mk_array_blast();
|
||||
~mk_array_blast() override;
|
||||
|
||||
rule_set * operator()(rule_set const & source);
|
||||
rule_set * operator()(rule_set const & source) override;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -40,8 +40,8 @@ namespace datalog {
|
|||
|
||||
public:
|
||||
mk_array_eq_rewrite(context & ctx, unsigned priority);
|
||||
rule_set * operator()(rule_set const & source);
|
||||
virtual ~mk_array_eq_rewrite(){}
|
||||
rule_set * operator()(rule_set const & source) override;
|
||||
~mk_array_eq_rewrite() override{}
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ Implementation:
|
|||
|
||||
1) Dealing with multiple quantifiers -> The options fixedpoint.xform.instantiate_arrays.nb_quantifier gives the number of quantifiers per array.
|
||||
|
||||
2) Inforcing the instantiation -> We suggest an option (enforce_instantiation) to enforce this abstraction. This transforms
|
||||
2) Enforcing the instantiation -> We suggest an option (enforce_instantiation) to enforce this abstraction. This transforms
|
||||
P(a) into P(i, a[i]). This enforces the solver to limit the space search at the cost of imprecise results. This option
|
||||
corresponds to fixedpoint.xform.instantiate_arrays.enforce
|
||||
|
||||
|
@ -112,8 +112,8 @@ namespace datalog {
|
|||
expr_ref_vector getId(app*old_pred, const expr_ref_vector& new_args);
|
||||
public:
|
||||
mk_array_instantiation(context & ctx, unsigned priority);
|
||||
rule_set * operator()(rule_set const & source);
|
||||
virtual ~mk_array_instantiation(){}
|
||||
rule_set * operator()(rule_set const & source) override;
|
||||
~mk_array_instantiation() override{}
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -28,8 +28,8 @@ namespace datalog {
|
|||
context& m_ctx;
|
||||
public:
|
||||
mk_backwards(context & ctx, unsigned priority = 33000);
|
||||
~mk_backwards();
|
||||
rule_set * operator()(rule_set const & source);
|
||||
~mk_backwards() override;
|
||||
rule_set * operator()(rule_set const & source) override;
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
@ -59,15 +59,15 @@ namespace datalog {
|
|||
m_new_funcs.push_back(new_f);
|
||||
}
|
||||
|
||||
virtual model_converter * translate(ast_translation & translator) {
|
||||
model_converter * translate(ast_translation & translator) override {
|
||||
return alloc(bit_blast_model_converter, m);
|
||||
}
|
||||
|
||||
virtual void get_units(obj_map<expr, bool>& units) {}
|
||||
void get_units(obj_map<expr, bool>& units) override {}
|
||||
|
||||
virtual void display(std::ostream& out) { out << "(bit-blast-model-converter)\n"; }
|
||||
void display(std::ostream& out) override { out << "(bit-blast-model-converter)\n"; }
|
||||
|
||||
virtual void operator()(model_ref & model) {
|
||||
void operator()(model_ref & model) override {
|
||||
for (unsigned i = 0; i < m_new_funcs.size(); ++i) {
|
||||
func_decl* p = m_new_funcs[i].get();
|
||||
func_decl* q = m_old_funcs[i].get();
|
||||
|
@ -142,8 +142,8 @@ namespace datalog {
|
|||
m_g_vars(m),
|
||||
m_old_funcs(m),
|
||||
m_new_funcs(m),
|
||||
m_src(0),
|
||||
m_dst(0)
|
||||
m_src(nullptr),
|
||||
m_dst(nullptr)
|
||||
{}
|
||||
|
||||
~expand_mkbv_cfg() {}
|
||||
|
@ -190,7 +190,7 @@ namespace datalog {
|
|||
m_g_vars.push_back(m_f_vars.back());
|
||||
}
|
||||
}
|
||||
func_decl* g = 0;
|
||||
func_decl* g = nullptr;
|
||||
|
||||
if (!m_pred2blast.find(f, g)) {
|
||||
|
||||
|
@ -206,7 +206,7 @@ namespace datalog {
|
|||
m_dst->inherit_predicate(*m_src, f, g);
|
||||
}
|
||||
result = m.mk_app(g, m_args.size(), m_args.c_ptr());
|
||||
result_pr = 0;
|
||||
result_pr = nullptr;
|
||||
return BR_DONE;
|
||||
}
|
||||
};
|
||||
|
@ -266,7 +266,7 @@ namespace datalog {
|
|||
rule_set * operator()(rule_set const & source) {
|
||||
// TODO pc
|
||||
if (!m_context.xform_bit_blast()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
rule_manager& rm = m_context.get_rule_manager();
|
||||
unsigned sz = source.get_num_rules();
|
||||
|
|
|
@ -28,8 +28,8 @@ namespace datalog {
|
|||
impl* m_impl;
|
||||
public:
|
||||
mk_bit_blast(context & ctx, unsigned priority = 35000);
|
||||
~mk_bit_blast();
|
||||
rule_set * operator()(rule_set const & source);
|
||||
~mk_bit_blast() override;
|
||||
rule_set * operator()(rule_set const & source) override;
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace datalog {
|
|||
*/
|
||||
mk_coalesce(context & ctx);
|
||||
|
||||
rule_set * operator()(rule_set const & source);
|
||||
rule_set * operator()(rule_set const & source) override;
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
@ -22,6 +22,8 @@ Author:
|
|||
#include "muz/dataflow/reachability.h"
|
||||
#include "ast/ast_pp.h"
|
||||
#include "tactic/generic_model_converter.h"
|
||||
#include "ast/ast_util.h"
|
||||
#include "tactic/extension_model_converter.h"
|
||||
|
||||
namespace datalog {
|
||||
rule_set * mk_coi_filter::operator()(rule_set const & source) {
|
||||
|
@ -33,20 +35,28 @@ namespace datalog {
|
|||
rule_set * mk_coi_filter::bottom_up(rule_set const & source) {
|
||||
dataflow_engine<reachability_info> engine(source.get_manager(), source);
|
||||
engine.run_bottom_up();
|
||||
func_decl_set unreachable;
|
||||
scoped_ptr<rule_set> res = alloc(rule_set, m_context);
|
||||
res->inherit_predicates(source);
|
||||
for (rule_set::iterator it = source.begin(); it != source.end(); ++it) {
|
||||
rule * r = *it;
|
||||
|
||||
for (rule* r : source) {
|
||||
bool new_tail = false;
|
||||
bool contained = true;
|
||||
m_new_tail.reset();
|
||||
m_new_tail_neg.reset();
|
||||
for (unsigned i = 0; i < r->get_uninterpreted_tail_size(); ++i) {
|
||||
if (m_context.has_facts(r->get_decl(i))) {
|
||||
return 0;
|
||||
func_decl* decl_i = r->get_decl(i);
|
||||
if (m_context.has_facts(decl_i)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool reachable = engine.get_fact(decl_i).is_reachable();
|
||||
|
||||
if (!reachable) {
|
||||
unreachable.insert(decl_i);
|
||||
}
|
||||
|
||||
if (r->is_neg_tail(i)) {
|
||||
if (!engine.get_fact(r->get_decl(i)).is_reachable()) {
|
||||
if (!reachable) {
|
||||
if (!new_tail) {
|
||||
for (unsigned j = 0; j < i; ++j) {
|
||||
m_new_tail.push_back(r->get_tail(j));
|
||||
|
@ -60,10 +70,9 @@ namespace datalog {
|
|||
m_new_tail_neg.push_back(true);
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
SASSERT(!new_tail);
|
||||
if (!engine.get_fact(r->get_decl(i)).is_reachable()) {
|
||||
if (!reachable) {
|
||||
contained = false;
|
||||
break;
|
||||
}
|
||||
|
@ -71,6 +80,10 @@ namespace datalog {
|
|||
}
|
||||
if (contained) {
|
||||
if (new_tail) {
|
||||
for (unsigned i = r->get_uninterpreted_tail_size(); i < r->get_tail_size(); ++i) {
|
||||
m_new_tail.push_back(r->get_tail(i));
|
||||
m_new_tail_neg.push_back(false);
|
||||
}
|
||||
rule* new_r = m_context.get_rule_manager().mk(r->get_head(), m_new_tail.size(),
|
||||
m_new_tail.c_ptr(), m_new_tail_neg.c_ptr(), symbol::null, false);
|
||||
res->add_rule(new_r);
|
||||
|
@ -78,24 +91,26 @@ namespace datalog {
|
|||
res->add_rule(r);
|
||||
}
|
||||
}
|
||||
m_new_tail.reset();
|
||||
m_new_tail_neg.reset();
|
||||
}
|
||||
if (res->get_num_rules() == source.get_num_rules()) {
|
||||
TRACE("dl", tout << "No transformation\n";);
|
||||
res = 0;
|
||||
} else {
|
||||
res = nullptr;
|
||||
}
|
||||
else {
|
||||
res->close();
|
||||
}
|
||||
|
||||
|
||||
// set to false each unreached predicate
|
||||
if (m_context.get_model_converter()) {
|
||||
if (res && m_context.get_model_converter()) {
|
||||
generic_model_converter* mc0 = alloc(generic_model_converter, m, "dl_coi");
|
||||
for (auto const& kv : engine) {
|
||||
if (!kv.m_value.is_reachable()) {
|
||||
mc0->add(kv.m_key, m.mk_false());
|
||||
}
|
||||
}
|
||||
for (func_decl* f : unreachable) {
|
||||
mc0->add(f, m.mk_false());
|
||||
}
|
||||
m_context.add_model_converter(mc0);
|
||||
}
|
||||
CTRACE("dl", 0 != res, res->display(tout););
|
||||
|
@ -109,9 +124,7 @@ namespace datalog {
|
|||
scoped_ptr<rule_set> res = alloc(rule_set, m_context);
|
||||
res->inherit_predicates(source);
|
||||
|
||||
rule_set::iterator rend = source.end();
|
||||
for (rule_set::iterator rit = source.begin(); rit != rend; ++rit) {
|
||||
rule * r = *rit;
|
||||
for (rule * r : source) {
|
||||
func_decl * pred = r->get_decl();
|
||||
if (engine.get_fact(pred).is_reachable()) {
|
||||
res->add_rule(r);
|
||||
|
@ -122,17 +135,15 @@ namespace datalog {
|
|||
|
||||
if (res->get_num_rules() == source.get_num_rules()) {
|
||||
TRACE("dl", tout << "No transformation\n";);
|
||||
res = 0;
|
||||
res = nullptr;
|
||||
}
|
||||
if (res && m_context.get_model_converter()) {
|
||||
func_decl_set::iterator end = pruned_preds.end();
|
||||
func_decl_set::iterator it = pruned_preds.begin();
|
||||
generic_model_converter* mc0 = alloc(generic_model_converter, m, "dl_coi");
|
||||
for (; it != end; ++it) {
|
||||
const rule_vector& rules = source.get_predicate_rules(*it);
|
||||
for (func_decl* f : pruned_preds) {
|
||||
const rule_vector& rules = source.get_predicate_rules(f);
|
||||
expr_ref_vector fmls(m);
|
||||
for (unsigned i = 0; i < rules.size(); ++i) {
|
||||
app* head = rules[i]->get_head();
|
||||
for (rule * r : rules) {
|
||||
app* head = r->get_head();
|
||||
expr_ref_vector conj(m);
|
||||
for (unsigned j = 0; j < head->get_num_args(); ++j) {
|
||||
expr* arg = head->get_arg(j);
|
||||
|
@ -140,11 +151,11 @@ namespace datalog {
|
|||
conj.push_back(m.mk_eq(m.mk_var(j, m.get_sort(arg)), arg));
|
||||
}
|
||||
}
|
||||
fmls.push_back(m.mk_and(conj.size(), conj.c_ptr()));
|
||||
fmls.push_back(mk_and(conj));
|
||||
}
|
||||
expr_ref fml(m);
|
||||
fml = m.mk_or(fmls.size(), fmls.c_ptr());
|
||||
mc0->add(*it, fml);
|
||||
mc0->add(f, fml);
|
||||
}
|
||||
m_context.add_model_converter(mc0);
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace datalog {
|
|||
m(ctx.get_manager()),
|
||||
m_context(ctx) {}
|
||||
|
||||
rule_set * operator()(rule_set const & source);
|
||||
rule_set * operator()(rule_set const & source) override;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace datalog {
|
|||
m_context(ctx),
|
||||
m(ctx.get_manager()),
|
||||
rm(ctx.get_rule_manager()),
|
||||
m_result(0),
|
||||
m_result(nullptr),
|
||||
m_pinned(m) {
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ namespace datalog {
|
|||
app_ref filter_head(m);
|
||||
filter_head = m.mk_app(filter_decl, key->filter_args.size(), key->filter_args.c_ptr());
|
||||
app * filter_tail = key->new_pred;
|
||||
rule * filter_rule = m_context.get_rule_manager().mk(filter_head, 1, &filter_tail, (const bool *)0);
|
||||
rule * filter_rule = m_context.get_rule_manager().mk(filter_head, 1, &filter_tail, (const bool *)nullptr);
|
||||
filter_rule->set_accounting_parent_object(m_context, m_current);
|
||||
m_result->add_rule(filter_rule);
|
||||
m_context.get_rule_manager().mk_rule_asserted_proof(*filter_rule);
|
||||
|
@ -161,7 +161,7 @@ namespace datalog {
|
|||
}
|
||||
if(!m_modified) {
|
||||
dealloc(m_result);
|
||||
return static_cast<rule_set *>(0);
|
||||
return static_cast<rule_set *>(nullptr);
|
||||
}
|
||||
m_result->inherit_predicates(source);
|
||||
return m_result;
|
||||
|
|
|
@ -73,11 +73,11 @@ namespace datalog {
|
|||
|
||||
public:
|
||||
mk_filter_rules(context & ctx);
|
||||
~mk_filter_rules();
|
||||
~mk_filter_rules() override;
|
||||
/**
|
||||
\brief Return a new rule set where only filter rules contain atoms with repeated variables and/or values.
|
||||
*/
|
||||
rule_set * operator()(rule_set const & source);
|
||||
rule_set * operator()(rule_set const & source) override;
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
@ -222,20 +222,20 @@ namespace datalog {
|
|||
*/
|
||||
app * detect_equivalence(const arg_pair& p1, const arg_pair& p2, bool inside_disjunction)
|
||||
{
|
||||
if (m.is_not(p1.first)==m.is_not(p2.first)) { return 0; }
|
||||
if (m.is_not(p1.second)==m.is_not(p2.second)) { return 0; }
|
||||
if (m.is_not(p1.first)==m.is_not(p2.first)) { return nullptr; }
|
||||
if (m.is_not(p1.second)==m.is_not(p2.second)) { return nullptr; }
|
||||
|
||||
expr * first_bare = 0;
|
||||
if (m.is_not(p1.first, first_bare) && p2.first!=first_bare) { return 0; }
|
||||
if (m.is_not(p2.first, first_bare) && p1.first!=first_bare) { return 0; }
|
||||
expr * first_bare = nullptr;
|
||||
if (m.is_not(p1.first, first_bare) && p2.first!=first_bare) { return nullptr; }
|
||||
if (m.is_not(p2.first, first_bare) && p1.first!=first_bare) { return nullptr; }
|
||||
SASSERT(first_bare);
|
||||
|
||||
expr * second_bare = 0;
|
||||
if (m.is_not(p1.second, second_bare) && p2.second!=second_bare) { return 0; }
|
||||
if (m.is_not(p2.second, second_bare) && p1.second!=second_bare) { return 0; }
|
||||
expr * second_bare = nullptr;
|
||||
if (m.is_not(p1.second, second_bare) && p2.second!=second_bare) { return nullptr; }
|
||||
if (m.is_not(p2.second, second_bare) && p1.second!=second_bare) { return nullptr; }
|
||||
SASSERT(second_bare);
|
||||
|
||||
if (!m.is_bool(first_bare) || !m.is_bool(second_bare)) { return 0; }
|
||||
if (!m.is_bool(first_bare) || !m.is_bool(second_bare)) { return nullptr; }
|
||||
|
||||
//both negations are in the same pair
|
||||
bool negs_together = m.is_not(p1.first)==m.is_not(p1.second);
|
||||
|
@ -261,7 +261,7 @@ namespace datalog {
|
|||
|
||||
arg_pair new_ap;
|
||||
if (match_arg_pair(e, new_ap, inside_disjunction)) {
|
||||
app * neq = 0;
|
||||
app * neq = nullptr;
|
||||
if (have_pair) {
|
||||
neq = detect_equivalence(ap, new_ap, inside_disjunction);
|
||||
}
|
||||
|
@ -601,15 +601,18 @@ namespace datalog {
|
|||
|
||||
rule_set * mk_interp_tail_simplifier::operator()(rule_set const & source) {
|
||||
if (source.get_num_rules() == 0) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
rule_set * res = alloc(rule_set, m_context);
|
||||
if (transform_rules(source, *res)) {
|
||||
res->inherit_predicates(source);
|
||||
TRACE("dl",
|
||||
source.display(tout);
|
||||
res->display(tout););
|
||||
} else {
|
||||
dealloc(res);
|
||||
res = 0;
|
||||
res = nullptr;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace datalog {
|
|||
void apply(app * a, app_ref& res);
|
||||
public:
|
||||
rule_substitution(context & ctx)
|
||||
: m(ctx.get_manager()), m_context(ctx), m_subst(m), m_unif(m), m_head(m), m_tail(m), m_rule(0) {}
|
||||
: m(ctx.get_manager()), m_context(ctx), m_subst(m), m_unif(m), m_head(m), m_tail(m), m_rule(nullptr) {}
|
||||
|
||||
/**
|
||||
Reset substitution and get it ready for working with rule r.
|
||||
|
@ -53,7 +53,7 @@ namespace datalog {
|
|||
*/
|
||||
void reset(rule * r);
|
||||
|
||||
/** Reset subtitution and unify tail tgt_idx of the target rule and the head of the src rule */
|
||||
/** Reset substitution and unify tail tgt_idx of the target rule and the head of the src rule */
|
||||
bool unify(expr * e1, expr * e2);
|
||||
|
||||
void get_result(rule_ref & res);
|
||||
|
@ -90,7 +90,7 @@ namespace datalog {
|
|||
bool transform_rules(const rule_set & orig, rule_set & tgt);
|
||||
public:
|
||||
mk_interp_tail_simplifier(context & ctx, unsigned priority=40000);
|
||||
virtual ~mk_interp_tail_simplifier();
|
||||
~mk_interp_tail_simplifier() override;
|
||||
|
||||
/**If rule should be retained, assign transformed version to res and return true;
|
||||
if rule can be deleted, return false.
|
||||
|
@ -100,7 +100,7 @@ namespace datalog {
|
|||
*/
|
||||
bool transform_rule(rule * r, rule_ref& res);
|
||||
|
||||
rule_set * operator()(rule_set const & source);
|
||||
rule_set * operator()(rule_set const & source) override;
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
@ -111,7 +111,7 @@ namespace datalog {
|
|||
|
||||
add_invariant_model_converter(ast_manager& m): m(m), a(m), m_funcs(m), m_invs(m) {}
|
||||
|
||||
virtual ~add_invariant_model_converter() { }
|
||||
~add_invariant_model_converter() override { }
|
||||
|
||||
void add(func_decl* p, expr* inv) {
|
||||
if (!m.is_true(inv)) {
|
||||
|
@ -120,9 +120,9 @@ namespace datalog {
|
|||
}
|
||||
}
|
||||
|
||||
virtual void get_units(obj_map<expr, bool>& units) {}
|
||||
void get_units(obj_map<expr, bool>& units) override {}
|
||||
|
||||
virtual void operator()(model_ref & mr) {
|
||||
void operator()(model_ref & mr) override {
|
||||
for (unsigned i = 0; i < m_funcs.size(); ++i) {
|
||||
func_decl* p = m_funcs[i].get();
|
||||
func_interp* f = mr->get_func_interp(p);
|
||||
|
@ -144,7 +144,7 @@ namespace datalog {
|
|||
}
|
||||
}
|
||||
|
||||
virtual model_converter * translate(ast_translation & translator) {
|
||||
model_converter * translate(ast_translation & translator) override {
|
||||
add_invariant_model_converter* mc = alloc(add_invariant_model_converter, m);
|
||||
for (unsigned i = 0; i < m_funcs.size(); ++i) {
|
||||
mc->add(translator(m_funcs[i].get()), m_invs[i].get());
|
||||
|
@ -195,13 +195,13 @@ namespace datalog {
|
|||
|
||||
rule_set * mk_karr_invariants::operator()(rule_set const & source) {
|
||||
if (!m_ctx.karr()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
rule_set::iterator it = source.begin(), end = source.end();
|
||||
for (; it != end; ++it) {
|
||||
rule const& r = **it;
|
||||
if (r.has_negation()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
mk_loop_counter lc(m_ctx);
|
||||
|
@ -213,7 +213,7 @@ namespace datalog {
|
|||
get_invariants(*src_loop);
|
||||
|
||||
if (m.canceled()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// figure out whether to update same rules as used for saturation.
|
||||
|
@ -252,7 +252,7 @@ namespace datalog {
|
|||
func_decl* p = dit->m_key;
|
||||
expr_ref fml = rctx.try_get_formula(p);
|
||||
if (fml && !m.is_true(fml)) {
|
||||
expr* inv = 0;
|
||||
expr* inv = nullptr;
|
||||
if (m_fun2inv.find(p, inv)) {
|
||||
fml = m.mk_and(inv, fml);
|
||||
}
|
||||
|
@ -274,7 +274,7 @@ namespace datalog {
|
|||
rule_set::decl2rules::iterator gend = src.end_grouped_rules();
|
||||
for (; git != gend; ++git) {
|
||||
func_decl* p = git->m_key;
|
||||
expr* fml = 0;
|
||||
expr* fml = nullptr;
|
||||
if (m_fun2inv.find(p, fml)) {
|
||||
kmc->add(p, fml);
|
||||
}
|
||||
|
@ -296,7 +296,7 @@ namespace datalog {
|
|||
}
|
||||
for (unsigned i = 0; i < utsz; ++i) {
|
||||
func_decl* q = r.get_decl(i);
|
||||
expr* fml = 0;
|
||||
expr* fml = nullptr;
|
||||
if (m_fun2inv.find(q, fml)) {
|
||||
expr_safe_replace rep(m);
|
||||
for (unsigned j = 0; j < q->get_arity(); ++j) {
|
||||
|
@ -310,7 +310,7 @@ namespace datalog {
|
|||
}
|
||||
rule* new_rule = &r;
|
||||
if (tail.size() != tsz) {
|
||||
new_rule = rm.mk(r.get_head(), tail.size(), tail.c_ptr(), 0, r.name());
|
||||
new_rule = rm.mk(r.get_head(), tail.size(), tail.c_ptr(), nullptr, r.name());
|
||||
}
|
||||
rules.add_rule(new_rule);
|
||||
rm.mk_rule_rewrite_proof(r, *new_rule); // should be weakening rule.
|
||||
|
|
|
@ -65,9 +65,9 @@ namespace datalog {
|
|||
public:
|
||||
mk_karr_invariants(context & ctx, unsigned priority);
|
||||
|
||||
virtual ~mk_karr_invariants();
|
||||
~mk_karr_invariants() override;
|
||||
|
||||
rule_set * operator()(rule_set const & source);
|
||||
rule_set * operator()(rule_set const & source) override;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ namespace datalog {
|
|||
|
||||
app_ref mk_loop_counter::del_arg(app* fn) {
|
||||
expr_ref_vector args(m);
|
||||
func_decl* old_fn = 0, *new_fn = fn->get_decl();
|
||||
func_decl* old_fn = nullptr, *new_fn = fn->get_decl();
|
||||
SASSERT(fn->get_num_args() > 0);
|
||||
args.append(fn->get_num_args()-1, fn->get_args());
|
||||
VERIFY (m_new2old.find(new_fn, old_fn));
|
||||
|
|
|
@ -36,9 +36,9 @@ namespace datalog {
|
|||
app_ref del_arg(app* fn);
|
||||
public:
|
||||
mk_loop_counter(context & ctx, unsigned priority = 33000);
|
||||
~mk_loop_counter();
|
||||
~mk_loop_counter() override;
|
||||
|
||||
rule_set * operator()(rule_set const & source);
|
||||
rule_set * operator()(rule_set const & source) override;
|
||||
|
||||
func_decl* get_old(func_decl* f) const { return m_new2old.find(f); }
|
||||
|
||||
|
|
|
@ -129,9 +129,9 @@ namespace datalog {
|
|||
SASSERT(m.is_bool(old_pred->get_range()));
|
||||
adornment_desc adn(old_pred);
|
||||
adn.m_adornment.populate(lit, bound_vars);
|
||||
adornment_map::entry * e = m_adorned_preds.insert_if_not_there2(adn, 0);
|
||||
adornment_map::entry * e = m_adorned_preds.insert_if_not_there2(adn, nullptr);
|
||||
func_decl * new_pred = e->get_data().m_value;
|
||||
if (new_pred==0) {
|
||||
if (new_pred==nullptr) {
|
||||
std::string suffix = "ad_"+adn.m_adornment.to_string();
|
||||
new_pred = m_context.mk_fresh_head_predicate(
|
||||
old_pred->get_name(), symbol(suffix.c_str()),
|
||||
|
@ -163,7 +163,7 @@ namespace datalog {
|
|||
|
||||
pred2pred::obj_map_entry * e = m_magic_preds.insert_if_not_there2(l_pred, 0);
|
||||
func_decl * mag_pred = e->get_data().m_value;
|
||||
if (mag_pred==0) {
|
||||
if (mag_pred==nullptr) {
|
||||
unsigned mag_arity = bound_args.size();
|
||||
|
||||
ptr_vector<sort> mag_domain;
|
||||
|
@ -264,7 +264,7 @@ namespace datalog {
|
|||
}
|
||||
|
||||
|
||||
func_decl * new_head_pred = 0;
|
||||
func_decl * new_head_pred = nullptr;
|
||||
VERIFY( m_adorned_preds.find(adornment_desc(head->get_decl(), head_adornment), new_head_pred) );
|
||||
app * new_head = m.mk_app(new_head_pred, head->get_args());
|
||||
|
||||
|
@ -301,14 +301,14 @@ namespace datalog {
|
|||
|
||||
app * tail[] = {lit, mag_lit};
|
||||
|
||||
rule * r = m_context.get_rule_manager().mk(adn_lit, 2, tail, 0);
|
||||
rule * r = m_context.get_rule_manager().mk(adn_lit, 2, tail, nullptr);
|
||||
result.add_rule(r);
|
||||
}
|
||||
|
||||
rule_set * mk_magic_sets::operator()(rule_set const & source) {
|
||||
|
||||
if (!m_context.magic_sets_for_queries()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
SASSERT(source.contains(m_goal));
|
||||
SASSERT(source.get_predicate_rules(m_goal).size() == 1);
|
||||
|
@ -372,10 +372,10 @@ namespace datalog {
|
|||
app * adn_goal_head = adorn_literal(goal_head, empty_var_idx_set);
|
||||
app * mag_goal_head = create_magic_literal(adn_goal_head);
|
||||
SASSERT(mag_goal_head->is_ground());
|
||||
rule * mag_goal_rule = m_context.get_rule_manager().mk(mag_goal_head, 0, 0, 0);
|
||||
rule * mag_goal_rule = m_context.get_rule_manager().mk(mag_goal_head, 0, nullptr, nullptr);
|
||||
result->add_rule(mag_goal_rule);
|
||||
|
||||
rule * back_to_goal_rule = m_context.get_rule_manager().mk(goal_head, 1, &adn_goal_head, 0);
|
||||
rule * back_to_goal_rule = m_context.get_rule_manager().mk(goal_head, 1, &adn_goal_head, nullptr);
|
||||
result->add_rule(back_to_goal_rule);
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@ namespace datalog {
|
|||
*/
|
||||
mk_magic_sets(context & ctx, func_decl* goal);
|
||||
|
||||
rule_set * operator()(rule_set const & source);
|
||||
rule_set * operator()(rule_set const & source) override;
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
@ -68,7 +68,7 @@ namespace datalog {
|
|||
|
||||
rule_set * mk_magic_symbolic::operator()(rule_set const & source) {
|
||||
if (!m_ctx.magic()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
context& ctx = source.get_context();
|
||||
rule_manager& rm = source.get_rule_manager();
|
||||
|
@ -98,7 +98,7 @@ namespace datalog {
|
|||
result->add_rule(new_rule);
|
||||
if (source.is_output_predicate(r.get_decl())) {
|
||||
result->set_output_predicate(new_rule->get_decl());
|
||||
new_rule = rm.mk(mk_query(r.get_head()), 0, 0, 0, r.name(), true);
|
||||
new_rule = rm.mk(mk_query(r.get_head()), 0, nullptr, nullptr, r.name(), true);
|
||||
result->add_rule(new_rule);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,8 +30,8 @@ namespace datalog {
|
|||
app_ref mk_query(app* q);
|
||||
public:
|
||||
mk_magic_symbolic(context & ctx, unsigned priority = 33037);
|
||||
~mk_magic_symbolic();
|
||||
rule_set * operator()(rule_set const & source);
|
||||
~mk_magic_symbolic() override;
|
||||
rule_set * operator()(rule_set const & source) override;
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
@ -47,9 +47,9 @@ namespace datalog {
|
|||
qa_model_converter(ast_manager& m):
|
||||
m(m), m_old_funcs(m), m_new_funcs(m) {}
|
||||
|
||||
virtual ~qa_model_converter() {}
|
||||
~qa_model_converter() override {}
|
||||
|
||||
virtual model_converter * translate(ast_translation & translator) {
|
||||
model_converter * translate(ast_translation & translator) override {
|
||||
return alloc(qa_model_converter, m);
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ namespace datalog {
|
|||
m_sorts.push_back(sorts);
|
||||
}
|
||||
|
||||
virtual void operator()(model_ref & old_model) {
|
||||
void operator()(model_ref & old_model) override {
|
||||
model_ref new_model = alloc(model, m);
|
||||
for (unsigned i = 0; i < m_new_funcs.size(); ++i) {
|
||||
func_decl* p = m_new_funcs[i].get();
|
||||
|
@ -151,7 +151,7 @@ namespace datalog {
|
|||
m_ctx(ctx),
|
||||
a(m),
|
||||
m_refs(m),
|
||||
m_mc(NULL){
|
||||
m_mc(nullptr) {
|
||||
}
|
||||
|
||||
mk_quantifier_abstraction::~mk_quantifier_abstraction() {
|
||||
|
@ -161,7 +161,7 @@ namespace datalog {
|
|||
|
||||
if (rules.is_output_predicate(old_p)) {
|
||||
dst.inherit_predicate(rules, old_p, old_p);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
unsigned sz = old_p->get_arity();
|
||||
|
@ -172,10 +172,10 @@ namespace datalog {
|
|||
}
|
||||
}
|
||||
if (num_arrays == 0) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
func_decl* new_p = 0;
|
||||
func_decl* new_p = nullptr;
|
||||
if (!m_old2new.find(old_p, new_p)) {
|
||||
expr_ref_vector sub(m), vars(m);
|
||||
svector<bool> bound;
|
||||
|
@ -289,7 +289,7 @@ namespace datalog {
|
|||
}
|
||||
args.push_back(arg);
|
||||
}
|
||||
expr* pat = 0;
|
||||
expr* pat = nullptr;
|
||||
expr_ref pattern(m);
|
||||
pattern = m.mk_pattern(pats.size(), pats.c_ptr());
|
||||
pat = pattern.get();
|
||||
|
@ -309,13 +309,13 @@ namespace datalog {
|
|||
|
||||
rule_set * mk_quantifier_abstraction::operator()(rule_set const & source) {
|
||||
if (!m_ctx.quantify_arrays()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
unsigned sz = source.get_num_rules();
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
rule& r = *source.get_rule(i);
|
||||
if (r.has_negation()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -359,12 +359,12 @@ namespace datalog {
|
|||
if (m_old2new.empty()) {
|
||||
dealloc(result);
|
||||
dealloc(m_mc);
|
||||
result = 0;
|
||||
result = nullptr;
|
||||
}
|
||||
else {
|
||||
m_ctx.add_model_converter(m_mc);
|
||||
}
|
||||
m_mc = 0;
|
||||
m_mc = nullptr;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -51,9 +51,9 @@ namespace datalog {
|
|||
public:
|
||||
mk_quantifier_abstraction(context & ctx, unsigned priority);
|
||||
|
||||
virtual ~mk_quantifier_abstraction();
|
||||
~mk_quantifier_abstraction() override;
|
||||
|
||||
rule_set * operator()(rule_set const & source);
|
||||
rule_set * operator()(rule_set const & source) override;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ namespace datalog {
|
|||
return;
|
||||
}
|
||||
expr* arg = pat->get_arg(i);
|
||||
ptr_vector<expr>* terms = 0;
|
||||
ptr_vector<expr>* terms = nullptr;
|
||||
|
||||
if (m_funs.find(to_app(arg)->get_decl(), terms)) {
|
||||
for (unsigned k = 0; k < terms->size(); ++k) {
|
||||
|
@ -185,7 +185,7 @@ namespace datalog {
|
|||
}
|
||||
if (is_app(e)) {
|
||||
app* ap = to_app(e);
|
||||
ptr_vector<expr>* terms = 0;
|
||||
ptr_vector<expr>* terms = nullptr;
|
||||
if (!m_funs.find(ap->get_decl(), terms)) {
|
||||
terms = alloc(ptr_vector<expr>);
|
||||
m_funs.insert(ap->get_decl(), terms);
|
||||
|
@ -250,7 +250,7 @@ namespace datalog {
|
|||
|
||||
rule_set * mk_quantifier_instantiation::operator()(rule_set const & source) {
|
||||
if (!m_ctx.instantiate_quantifiers()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
bool has_quantifiers = false;
|
||||
unsigned sz = source.get_num_rules();
|
||||
|
@ -259,11 +259,11 @@ namespace datalog {
|
|||
rule& r = *source.get_rule(i);
|
||||
has_quantifiers = has_quantifiers || rm.has_quantifiers(r);
|
||||
if (r.has_negation()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
if (!has_quantifiers) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
expr_ref_vector conjs(m);
|
||||
|
@ -291,7 +291,7 @@ namespace datalog {
|
|||
}
|
||||
else {
|
||||
dealloc(result);
|
||||
result = 0;
|
||||
result = nullptr;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -61,9 +61,9 @@ namespace datalog {
|
|||
public:
|
||||
mk_quantifier_instantiation(context & ctx, unsigned priority);
|
||||
|
||||
virtual ~mk_quantifier_instantiation();
|
||||
~mk_quantifier_instantiation() override;
|
||||
|
||||
rule_set * operator()(rule_set const & source);
|
||||
rule_set * operator()(rule_set const & source) override;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -209,9 +209,7 @@ namespace datalog {
|
|||
rel->collect_non_empty_predicates(m_preds_with_facts);
|
||||
}
|
||||
|
||||
rule_set::iterator rend = orig.end();
|
||||
for (rule_set::iterator rit = orig.begin(); rit!=rend; ++rit) {
|
||||
rule * r = *rit;
|
||||
for (rule * r : orig) {
|
||||
func_decl * head_pred = r->get_decl();
|
||||
m_head_pred_ctr.inc(head_pred);
|
||||
|
||||
|
@ -258,9 +256,7 @@ namespace datalog {
|
|||
rule_set * mk_rule_inliner::create_allowed_rule_set(rule_set const & orig)
|
||||
{
|
||||
rule_set * res = alloc(rule_set, m_context);
|
||||
unsigned rcnt = orig.get_num_rules();
|
||||
for (unsigned i=0; i<rcnt; i++) {
|
||||
rule * r = orig.get_rule(i);
|
||||
for (rule * r : orig) {
|
||||
if (inlining_allowed(orig, r->get_decl())) {
|
||||
res->add_rule(r);
|
||||
}
|
||||
|
@ -283,13 +279,11 @@ namespace datalog {
|
|||
|
||||
const rule_stratifier::comp_vector& comps = r.get_stratifier().get_strats();
|
||||
|
||||
rule_stratifier::comp_vector::const_iterator cend = comps.end();
|
||||
for (rule_stratifier::comp_vector::const_iterator it = comps.begin(); it!=cend; ++it) {
|
||||
rule_stratifier::item_set * stratum = *it;
|
||||
if (stratum->size()==1) {
|
||||
for (rule_stratifier::item_set * stratum : comps) {
|
||||
if (stratum->size() == 1) {
|
||||
continue;
|
||||
}
|
||||
SASSERT(stratum->size()>1);
|
||||
SASSERT(stratum->size() > 1);
|
||||
func_decl * first_stratum_pred = *stratum->begin();
|
||||
|
||||
//we're trying to break cycles by removing one predicate from each of them
|
||||
|
@ -307,9 +301,7 @@ namespace datalog {
|
|||
const rule_stratifier::comp_vector& comps =
|
||||
proposed_inlined_rules.get_stratifier().get_strats();
|
||||
|
||||
rule_stratifier::comp_vector::const_iterator cend = comps.end();
|
||||
for (rule_stratifier::comp_vector::const_iterator it = comps.begin(); it!=cend; ++it) {
|
||||
rule_stratifier::item_set * stratum = *it;
|
||||
for (rule_stratifier::item_set * stratum : comps) {
|
||||
|
||||
SASSERT(stratum->size()==1);
|
||||
func_decl * head_pred = *stratum->begin();
|
||||
|
@ -318,10 +310,7 @@ namespace datalog {
|
|||
bool is_multi_occurrence_pred = m_tail_pred_ctr.get(head_pred)>1;
|
||||
|
||||
const rule_vector& pred_rules = proposed_inlined_rules.get_predicate_rules(head_pred);
|
||||
rule_vector::const_iterator iend = pred_rules.end();
|
||||
for (rule_vector::const_iterator iit = pred_rules.begin(); iit!=iend; ++iit) {
|
||||
rule * r = *iit;
|
||||
|
||||
for (rule * r : pred_rules) {
|
||||
unsigned pt_len = r->get_positive_tail_size();
|
||||
for (unsigned ti = 0; ti<pt_len; ++ti) {
|
||||
func_decl * tail_pred = r->get_decl(ti);
|
||||
|
@ -405,28 +394,22 @@ namespace datalog {
|
|||
// now we start filling in the set of the inlined rules in a topological order,
|
||||
// so that we inline rules into other rules
|
||||
|
||||
SASSERT(m_inlined_rules.get_num_rules()==0);
|
||||
SASSERT(m_inlined_rules.get_num_rules() == 0);
|
||||
|
||||
const rule_stratifier::comp_vector& comps = candidate_inlined_set->get_stratifier().get_strats();
|
||||
|
||||
rule_stratifier::comp_vector::const_iterator cend = comps.end();
|
||||
for (rule_stratifier::comp_vector::const_iterator it = comps.begin(); it!=cend; ++it) {
|
||||
rule_stratifier::item_set * stratum = *it;
|
||||
SASSERT(stratum->size()==1);
|
||||
for (rule_stratifier::item_set * stratum : comps) {
|
||||
SASSERT(stratum->size() == 1);
|
||||
func_decl * pred = *stratum->begin();
|
||||
|
||||
const rule_vector& pred_rules = candidate_inlined_set->get_predicate_rules(pred);
|
||||
rule_vector::const_iterator iend = pred_rules.end();
|
||||
for (rule_vector::const_iterator iit = pred_rules.begin(); iit!=iend; ++iit) {
|
||||
transform_rule(orig, *iit, m_inlined_rules);
|
||||
for (rule * r : candidate_inlined_set->get_predicate_rules(pred)) {
|
||||
transform_rule(orig, r, m_inlined_rules);
|
||||
}
|
||||
}
|
||||
|
||||
TRACE("dl", tout << "inlined rules after mutual inlining:\n" << m_inlined_rules; );
|
||||
|
||||
for (unsigned i = 0; i < m_inlined_rules.get_num_rules(); ++i) {
|
||||
rule* r = m_inlined_rules.get_rule(i);
|
||||
datalog::del_rule(m_mc, *r);
|
||||
for (rule * r : m_inlined_rules) {
|
||||
datalog::del_rule(m_mc, *r, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -439,9 +422,7 @@ namespace datalog {
|
|||
rule_ref r(todo.back(), m_rm);
|
||||
todo.pop_back();
|
||||
unsigned pt_len = r->get_positive_tail_size();
|
||||
|
||||
unsigned i = 0;
|
||||
|
||||
for (; i < pt_len && !inlining_allowed(orig, r->get_decl(i)); ++i) {};
|
||||
|
||||
SASSERT(!has_quantifier(*r.get()));
|
||||
|
@ -455,9 +436,7 @@ namespace datalog {
|
|||
|
||||
func_decl * pred = r->get_decl(i);
|
||||
const rule_vector& pred_rules = m_inlined_rules.get_predicate_rules(pred);
|
||||
rule_vector::const_iterator iend = pred_rules.end();
|
||||
for (rule_vector::const_iterator iit = pred_rules.begin(); iit!=iend; ++iit) {
|
||||
rule * inl_rule = *iit;
|
||||
for (rule * inl_rule : pred_rules) {
|
||||
rule_ref inl_result(m_rm);
|
||||
if (try_to_inline_rule(*r.get(), *inl_rule, i, inl_result)) {
|
||||
todo.push_back(inl_result);
|
||||
|
@ -465,7 +444,7 @@ namespace datalog {
|
|||
}
|
||||
}
|
||||
if (modified) {
|
||||
datalog::del_rule(m_mc, *r0);
|
||||
datalog::del_rule(m_mc, *r0, true);
|
||||
}
|
||||
|
||||
return modified;
|
||||
|
@ -475,9 +454,8 @@ namespace datalog {
|
|||
|
||||
bool something_done = false;
|
||||
|
||||
rule_set::iterator rend = orig.end();
|
||||
for (rule_set::iterator rit = orig.begin(); rit!=rend; ++rit) {
|
||||
rule_ref r(*rit, m_rm);
|
||||
for (rule* rl : orig) {
|
||||
rule_ref r(rl, m_rm);
|
||||
func_decl * pred = r->get_decl();
|
||||
|
||||
// if inlining is allowed, then we are eliminating
|
||||
|
@ -488,9 +466,9 @@ namespace datalog {
|
|||
}
|
||||
|
||||
if (something_done && m_mc) {
|
||||
for (rule_set::iterator rit = orig.begin(); rit!=rend; ++rit) {
|
||||
if (inlining_allowed(orig, (*rit)->get_decl())) {
|
||||
datalog::del_rule(m_mc, **rit);
|
||||
for (rule* r : orig) {
|
||||
if (inlining_allowed(orig, r->get_decl())) {
|
||||
datalog::del_rule(m_mc, *r, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -508,19 +486,14 @@ namespace datalog {
|
|||
bool mk_rule_inliner::is_oriented_rewriter(rule * r, rule_stratifier const& strat) {
|
||||
func_decl * head_pred = r->get_decl();
|
||||
unsigned head_strat = strat.get_predicate_strat(head_pred);
|
||||
|
||||
unsigned head_arity = head_pred->get_arity();
|
||||
|
||||
|
||||
unsigned pt_len = r->get_positive_tail_size();
|
||||
for (unsigned ti=0; ti<pt_len; ++ti) {
|
||||
|
||||
for (unsigned ti=0; ti < pt_len; ++ti) {
|
||||
func_decl * pred = r->get_decl(ti);
|
||||
|
||||
unsigned pred_strat = strat.get_predicate_strat(pred);
|
||||
SASSERT(pred_strat<=head_strat);
|
||||
SASSERT(pred_strat <= head_strat);
|
||||
|
||||
if (pred_strat==head_strat) {
|
||||
if (pred_strat == head_strat) {
|
||||
if (pred->get_arity()>head_arity
|
||||
|| (pred->get_arity()==head_arity && pred->get_id()>=head_pred->get_id()) ) {
|
||||
return false;
|
||||
|
@ -549,16 +522,16 @@ namespace datalog {
|
|||
|
||||
|
||||
const rule_vector& pred_rules = rules.get_predicate_rules(pred);
|
||||
rule * inlining_candidate = 0;
|
||||
rule * inlining_candidate = nullptr;
|
||||
unsigned rule_cnt = pred_rules.size();
|
||||
if (rule_cnt == 0) {
|
||||
inlining_candidate = 0;
|
||||
inlining_candidate = nullptr;
|
||||
}
|
||||
else if (rule_cnt == 1) {
|
||||
inlining_candidate = pred_rules[0];
|
||||
}
|
||||
else {
|
||||
inlining_candidate = 0;
|
||||
inlining_candidate = nullptr;
|
||||
|
||||
for (unsigned ri = 0; ri < rule_cnt; ++ri) {
|
||||
rule * pred_rule = pred_rules[ri];
|
||||
|
@ -566,7 +539,7 @@ namespace datalog {
|
|||
//we skip rules which don't unify with the tail atom
|
||||
continue;
|
||||
}
|
||||
if (inlining_candidate != 0) {
|
||||
if (inlining_candidate != nullptr) {
|
||||
// We have two rules that can be inlined into the current
|
||||
// tail predicate. In this situation we don't do inlinning
|
||||
// on this tail atom, as we don't want the overall number
|
||||
|
@ -576,11 +549,11 @@ namespace datalog {
|
|||
inlining_candidate = pred_rule;
|
||||
}
|
||||
}
|
||||
if (inlining_candidate == 0) {
|
||||
if (inlining_candidate == nullptr) {
|
||||
// nothing unifies with the tail atom, therefore the rule is unsatisfiable
|
||||
// (we can say this because relation pred doesn't have any ground facts either)
|
||||
res = 0;
|
||||
datalog::del_rule(m_mc, *r);
|
||||
res = nullptr;
|
||||
datalog::del_rule(m_mc, *r, false);
|
||||
return true;
|
||||
}
|
||||
if (!is_oriented_rewriter(inlining_candidate, strat)) {
|
||||
|
@ -590,8 +563,8 @@ namespace datalog {
|
|||
goto process_next_tail;
|
||||
}
|
||||
if (!try_to_inline_rule(*r, *inlining_candidate, ti, res)) {
|
||||
datalog::del_rule(m_mc, *r);
|
||||
res = 0;
|
||||
datalog::del_rule(m_mc, *r, false);
|
||||
res = nullptr;
|
||||
}
|
||||
return true;
|
||||
|
||||
|
@ -823,7 +796,7 @@ namespace datalog {
|
|||
if (num_tail_unifiers == 1) {
|
||||
TRACE("dl", tout << "setting invalid: " << j << "\n";);
|
||||
valid.set(j, false);
|
||||
datalog::del_rule(m_mc, *r2);
|
||||
datalog::del_rule(m_mc, *r2, true);
|
||||
del_rule(r2, j);
|
||||
}
|
||||
|
||||
|
@ -852,16 +825,12 @@ namespace datalog {
|
|||
ref<horn_subsume_model_converter> hsmc;
|
||||
|
||||
if (source.get_num_rules() == 0) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
rule_set::iterator end = source.end();
|
||||
for (rule_set::iterator it = source.begin(); it != end; ++ it) {
|
||||
if (has_quantifier(**it)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
for (rule const* r : source)
|
||||
if (has_quantifier(*r))
|
||||
return nullptr;
|
||||
|
||||
if (m_context.get_model_converter()) {
|
||||
hsmc = alloc(horn_subsume_model_converter, m);
|
||||
|
@ -893,7 +862,7 @@ namespace datalog {
|
|||
}
|
||||
|
||||
if (!something_done) {
|
||||
res = 0;
|
||||
res = nullptr;
|
||||
}
|
||||
else {
|
||||
m_context.add_model_converter(hsmc.get());
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace datalog {
|
|||
: m(ctx.get_manager()), m_rm(ctx.get_rule_manager()), m_context(ctx),
|
||||
m_interp_simplifier(ctx), m_subst(m), m_unif(m), m_ready(false), m_normalize(true) {}
|
||||
|
||||
/** Reset subtitution and unify tail tgt_idx of the target rule and the head of the src rule */
|
||||
/** Reset substitution and unify tail tgt_idx of the target rule and the head of the src rule */
|
||||
bool unify_rules(rule const& tgt, unsigned tgt_idx, rule const& src);
|
||||
|
||||
/**
|
||||
|
@ -89,7 +89,7 @@ namespace datalog {
|
|||
obj_map<expr, unsigned_vector> m_positions;
|
||||
public:
|
||||
visitor(context& c, substitution & s): st_visitor(s), m_context(c) { (void) m_context; }
|
||||
virtual bool operator()(expr* e);
|
||||
bool operator()(expr* e) override;
|
||||
void reset() { m_unifiers.reset(); }
|
||||
void reset(unsigned sz);
|
||||
svector<bool>& can_remove() { return m_can_remove; }
|
||||
|
@ -186,7 +186,7 @@ namespace datalog {
|
|||
m_simp(m_context.get_rewriter()),
|
||||
m_pinned(m_rm),
|
||||
m_inlined_rules(m_context),
|
||||
m_mc(0),
|
||||
m_mc(nullptr),
|
||||
m_unifier(ctx),
|
||||
m_head_index(m),
|
||||
m_tail_index(m),
|
||||
|
@ -194,9 +194,9 @@ namespace datalog {
|
|||
m_head_visitor(ctx, m_subst),
|
||||
m_tail_visitor(ctx, m_subst)
|
||||
{}
|
||||
virtual ~mk_rule_inliner() { }
|
||||
~mk_rule_inliner() override { }
|
||||
|
||||
rule_set * operator()(rule_set const & source);
|
||||
rule_set * operator()(rule_set const & source) override;
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace datalog {
|
|||
public:
|
||||
scale_model_converter(ast_manager& m): m(m), m_trail(m), a(m) {}
|
||||
|
||||
virtual ~scale_model_converter() {}
|
||||
~scale_model_converter() override {}
|
||||
|
||||
void add_new2old(func_decl* new_f, func_decl* old_f) {
|
||||
m_trail.push_back(old_f);
|
||||
|
@ -38,9 +38,9 @@ namespace datalog {
|
|||
m_new2old.insert(new_f, old_f);
|
||||
}
|
||||
|
||||
virtual void get_units(obj_map<expr, bool>& units) { units.reset(); }
|
||||
void get_units(obj_map<expr, bool>& units) override { units.reset(); }
|
||||
|
||||
virtual void operator()(model_ref& md) {
|
||||
void operator()(model_ref& md) override {
|
||||
model_ref old_model = alloc(model, m);
|
||||
for (auto const& kv : m_new2old) {
|
||||
func_decl* old_p = kv.m_value;
|
||||
|
@ -95,9 +95,9 @@ namespace datalog {
|
|||
//TRACE("dl", model_smt2_pp(tout, m, *md, 0); );
|
||||
}
|
||||
|
||||
virtual model_converter * translate(ast_translation & translator) {
|
||||
model_converter * translate(ast_translation & translator) override {
|
||||
UNREACHABLE();
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
virtual void display(std::ostream& out) { out << "(scale-model-converter)\n"; }
|
||||
|
@ -119,7 +119,7 @@ namespace datalog {
|
|||
|
||||
rule_set * mk_scale::operator()(rule_set const & source) {
|
||||
if (!m_ctx.scale()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
rule_manager& rm = source.get_rule_manager();
|
||||
rule_set * result = alloc(rule_set, m_ctx);
|
||||
|
|
|
@ -7,7 +7,7 @@ Module Name:
|
|||
|
||||
Abstract:
|
||||
|
||||
Add scale factor to linear (Real) arithemetic Horn clauses.
|
||||
Add scale factor to linear (Real) arithmetic Horn clauses.
|
||||
The transformation replaces occurrences of isolated constants by
|
||||
a scale multiplied to each constant.
|
||||
|
||||
|
@ -43,8 +43,8 @@ namespace datalog {
|
|||
app_ref mk_constraint(unsigned num_vars, app* q);
|
||||
public:
|
||||
mk_scale(context & ctx, unsigned priority = 33039);
|
||||
virtual ~mk_scale();
|
||||
rule_set * operator()(rule_set const & source);
|
||||
~mk_scale() override;
|
||||
rule_set * operator()(rule_set const & source) override;
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
@ -127,7 +127,7 @@ namespace datalog {
|
|||
}
|
||||
}
|
||||
if (!has_new_rule) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
else {
|
||||
result->inherit_predicates(src);
|
||||
|
|
|
@ -51,7 +51,7 @@ namespace datalog {
|
|||
|
||||
public:
|
||||
mk_separate_negated_tails(context& ctx, unsigned priority = 21000);
|
||||
rule_set * operator()(rule_set const & source);
|
||||
rule_set * operator()(rule_set const & source) override;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -155,8 +155,8 @@ namespace datalog {
|
|||
}
|
||||
|
||||
bool translate_asserted(proof* p) {
|
||||
expr* fact = 0;
|
||||
rule* r = 0;
|
||||
expr* fact = nullptr;
|
||||
rule* r = nullptr;
|
||||
if (!m.is_asserted(p, fact)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ namespace datalog {
|
|||
proof* p1_new = m_new_proof.find(p1);
|
||||
expr* fact1 = m.get_fact(p1);
|
||||
TRACE("dl", tout << "fact1: " << mk_pp(fact1, m) << "\n";);
|
||||
rule* orig1 = 0;
|
||||
rule* orig1 = nullptr;
|
||||
if (!m_sliceform2rule.find(fact1, orig1)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -282,7 +282,7 @@ namespace datalog {
|
|||
proof_converter * translate(ast_translation & translator) override {
|
||||
UNREACHABLE();
|
||||
// this would require implementing translation for the dl_context.
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void display(std::ostream& out) override { out << "(slice-proof-converter)\n"; }
|
||||
|
@ -398,7 +398,7 @@ namespace datalog {
|
|||
|
||||
model_converter * translate(ast_translation & translator) override {
|
||||
UNREACHABLE();
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void display(std::ostream& out) override { out << "(slice-model-converter)\n"; }
|
||||
|
@ -412,8 +412,8 @@ namespace datalog {
|
|||
rm(ctx.get_rule_manager()),
|
||||
m_solved_vars(m),
|
||||
m_pinned(m),
|
||||
m_pc(0),
|
||||
m_mc(0)
|
||||
m_pc(nullptr),
|
||||
m_mc(nullptr)
|
||||
{}
|
||||
|
||||
|
||||
|
@ -433,8 +433,8 @@ namespace datalog {
|
|||
bool change = true;
|
||||
while (change) {
|
||||
change = false;
|
||||
for (unsigned i = 0; i < src.get_num_rules(); ++i) {
|
||||
change = prune_rule(*src.get_rule(i)) || change;
|
||||
for (rule* r : src) {
|
||||
change = prune_rule(*r) || change;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -464,18 +464,19 @@ namespace datalog {
|
|||
|
||||
void mk_slice::solve_vars(rule& r, uint_set& used_vars, uint_set& parameter_vars) {
|
||||
expr_ref_vector conjs = get_tail_conjs(r);
|
||||
for (unsigned j = 0; j < conjs.size(); ++j) {
|
||||
expr* e = conjs[j].get();
|
||||
for (expr * e : conjs) {
|
||||
expr_ref r(m);
|
||||
unsigned v;
|
||||
if (is_eq(e, v, r) && is_output(v) && m_var_is_sliceable[v]) {
|
||||
TRACE("dl", tout << "is_eq: " << mk_pp(e, m) << " " << (m_solved_vars[v].get()?"solved":"new") << "\n";);
|
||||
add_var(v);
|
||||
if (!m_solved_vars[v].get()) {
|
||||
TRACE("dl", tout << v << " is solved\n";);
|
||||
add_free_vars(parameter_vars, r);
|
||||
m_solved_vars[v] = r;
|
||||
}
|
||||
else {
|
||||
TRACE("dl", tout << v << " is used\n";);
|
||||
// variables can only be solved once.
|
||||
add_free_vars(used_vars, e);
|
||||
add_free_vars(used_vars, m_solved_vars[v].get());
|
||||
|
@ -515,10 +516,9 @@ namespace datalog {
|
|||
//
|
||||
uint_set used_vars, parameter_vars;
|
||||
solve_vars(r, used_vars, parameter_vars);
|
||||
uint_set::iterator it = used_vars.begin(), end = used_vars.end();
|
||||
for (; it != end; ++it) {
|
||||
if (*it < m_var_is_sliceable.size()) {
|
||||
m_var_is_sliceable[*it] = false;
|
||||
for (unsigned uv : used_vars) {
|
||||
if (uv < m_var_is_sliceable.size()) {
|
||||
m_var_is_sliceable[uv] = false;
|
||||
}
|
||||
}
|
||||
//
|
||||
|
@ -540,6 +540,9 @@ namespace datalog {
|
|||
if (m_solved_vars[i].get()) {
|
||||
m_var_is_sliceable[i] = false;
|
||||
}
|
||||
if (parameter_vars.contains(i)) {
|
||||
m_var_is_sliceable[i] = false;
|
||||
}
|
||||
}
|
||||
else if (is_output) {
|
||||
if (parameter_vars.contains(i)) {
|
||||
|
@ -694,11 +697,9 @@ namespace datalog {
|
|||
}
|
||||
|
||||
void mk_slice::display(std::ostream& out) {
|
||||
obj_map<func_decl, bit_vector>::iterator it = m_sliceable.begin();
|
||||
obj_map<func_decl, bit_vector>::iterator end = m_sliceable.end();
|
||||
for (; it != end; ++it) {
|
||||
out << it->m_key->get_name() << " ";
|
||||
bit_vector const& bv = it->m_value;
|
||||
for (auto const& kv : m_sliceable) {
|
||||
out << kv.m_key->get_name() << " ";
|
||||
bit_vector const& bv = kv.m_value;
|
||||
for (unsigned i = 0; i < bv.size(); ++i) {
|
||||
out << (bv.get(i)?"1":"0");
|
||||
}
|
||||
|
@ -796,7 +797,7 @@ namespace datalog {
|
|||
tail.push_back(to_app(e));
|
||||
}
|
||||
|
||||
new_rule = rm.mk(head.get(), tail.size(), tail.c_ptr(), (const bool*) 0, r.name());
|
||||
new_rule = rm.mk(head.get(), tail.size(), tail.c_ptr(), (const bool*) nullptr, r.name());
|
||||
|
||||
rm.fix_unbound_vars(new_rule, false);
|
||||
|
||||
|
@ -811,7 +812,7 @@ namespace datalog {
|
|||
dst.add_rule(new_rule.get());
|
||||
|
||||
if (m_pc) {
|
||||
m_pc->insert(&r, new_rule.get(), 0, 0);
|
||||
m_pc->insert(&r, new_rule.get(), 0, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -825,7 +826,7 @@ namespace datalog {
|
|||
rule_manager& rm = m_ctx.get_rule_manager();
|
||||
for (unsigned i = 0; i < src.get_num_rules(); ++i) {
|
||||
if (rm.has_quantifiers(*src.get_rule(i))) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
ref<slice_proof_converter> spc;
|
||||
|
@ -845,7 +846,7 @@ namespace datalog {
|
|||
if (m_predicates.empty()) {
|
||||
// nothing could be sliced.
|
||||
dealloc(result);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
TRACE("dl", display(tout););
|
||||
update_rules(src, *result);
|
||||
|
|
|
@ -100,9 +100,9 @@ namespace datalog {
|
|||
*/
|
||||
mk_slice(context & ctx);
|
||||
|
||||
virtual ~mk_slice() { }
|
||||
~mk_slice() override { }
|
||||
|
||||
rule_set * operator()(rule_set const & source);
|
||||
rule_set * operator()(rule_set const & source) override;
|
||||
|
||||
func_decl* get_predicate(func_decl* p) { func_decl* q = p; m_predicates.find(p, q); return q; }
|
||||
|
||||
|
|
|
@ -24,8 +24,10 @@ Revision History:
|
|||
#include "ast/rewriter/rewriter.h"
|
||||
#include "ast/rewriter/rewriter_def.h"
|
||||
#include "muz/transforms/dl_mk_subsumption_checker.h"
|
||||
|
||||
#include "muz/base/fixedpoint_params.hpp"
|
||||
#include "tactic/generic_model_converter.h"
|
||||
|
||||
|
||||
namespace datalog {
|
||||
|
||||
|
||||
|
@ -37,26 +39,28 @@ namespace datalog {
|
|||
|
||||
|
||||
bool mk_subsumption_checker::is_total_rule(const rule * r) {
|
||||
if(r->get_tail_size()!=0) { return false; }
|
||||
if (r->get_tail_size() != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned pt_len = r->get_positive_tail_size();
|
||||
if(pt_len!=r->get_uninterpreted_tail_size()) {
|
||||
//we dont' expect rules with negative tails to be total
|
||||
if(pt_len != r->get_uninterpreted_tail_size()) {
|
||||
// we dont' expect rules with negative tails to be total
|
||||
return false;
|
||||
}
|
||||
|
||||
for(unsigned i=0; i<pt_len; i++) {
|
||||
for (unsigned i = 0; i < pt_len; i++) {
|
||||
func_decl * tail_pred = r->get_tail(i)->get_decl();
|
||||
if(!m_total_relations.contains(tail_pred)) {
|
||||
//this rule has a non-total predicate in the tail
|
||||
if (!m_total_relations.contains(tail_pred)) {
|
||||
// this rule has a non-total predicate in the tail
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned t_len = r->get_positive_tail_size();
|
||||
for(unsigned i=pt_len; i<t_len; i++) {
|
||||
for(unsigned i = pt_len; i < t_len; i++) {
|
||||
SASSERT(!r->is_neg_tail(i)); //we assume interpreted tail not to be negated
|
||||
if(!m.is_true(r->get_tail(i))) {
|
||||
if (!m.is_true(r->get_tail(i))) {
|
||||
//this rule has an interpreted tail which is not constant true
|
||||
return false;
|
||||
}
|
||||
|
@ -183,20 +187,15 @@ namespace datalog {
|
|||
rule_ref_vector orig_rules(m_context.get_rule_manager());
|
||||
orig_rules.append(orig.get_num_rules(), orig.begin());
|
||||
|
||||
rule * * rbegin = orig_rules.c_ptr();
|
||||
rule * * rend = rbegin + orig_rules.size();
|
||||
|
||||
//before traversing we sort rules so that the shortest are in the beginning.
|
||||
//this will help make subsumption checks more efficient
|
||||
std::sort(rbegin, rend, rule_size_comparator);
|
||||
std::sort(orig_rules.c_ptr(), orig_rules.c_ptr() + orig_rules.size(), rule_size_comparator);
|
||||
|
||||
for(rule_set::iterator rit = rbegin; rit!=rend; ++rit) {
|
||||
|
||||
rule * r = *rit;
|
||||
for (rule * r : orig_rules) {
|
||||
func_decl * head_pred = r->get_decl();
|
||||
|
||||
if(m_total_relations.contains(head_pred)) {
|
||||
if(!orig.is_output_predicate(head_pred) ||
|
||||
if (m_total_relations.contains(head_pred)) {
|
||||
if (!orig.is_output_predicate(head_pred) ||
|
||||
total_relations_with_included_rules.contains(head_pred)) {
|
||||
//We just skip definitions of total non-output relations as
|
||||
//we'll eliminate them from the problem.
|
||||
|
@ -205,8 +204,7 @@ namespace datalog {
|
|||
modified = true;
|
||||
continue;
|
||||
}
|
||||
rule * defining_rule;
|
||||
VERIFY(m_total_relation_defining_rules.find(head_pred, defining_rule));
|
||||
rule * defining_rule = m_total_relation_defining_rules.find(head_pred);
|
||||
if (defining_rule) {
|
||||
rule_ref totality_rule(m_context.get_rule_manager());
|
||||
VERIFY(transform_rule(defining_rule, subs_index, totality_rule));
|
||||
|
@ -224,24 +222,31 @@ namespace datalog {
|
|||
}
|
||||
|
||||
rule_ref new_rule(m_context.get_rule_manager());
|
||||
if(!transform_rule(r, subs_index, new_rule)) {
|
||||
if (!transform_rule(r, subs_index, new_rule)) {
|
||||
modified = true;
|
||||
continue;
|
||||
}
|
||||
if(m_new_total_relation_discovery_during_transformation && is_total_rule(new_rule)) {
|
||||
if (m_new_total_relation_discovery_during_transformation && is_total_rule(new_rule)) {
|
||||
on_discovered_total_relation(head_pred, new_rule.get());
|
||||
}
|
||||
if(subs_index.is_subsumed(new_rule)) {
|
||||
if (subs_index.is_subsumed(new_rule)) {
|
||||
modified = true;
|
||||
continue;
|
||||
}
|
||||
if(new_rule.get()!=r) {
|
||||
if (new_rule.get()!=r) {
|
||||
modified = true;
|
||||
}
|
||||
tgt.add_rule(new_rule);
|
||||
subs_index.add(new_rule);
|
||||
}
|
||||
tgt.inherit_predicates(orig);
|
||||
if (!m_total_relations.empty() && m_context.get_model_converter()) {
|
||||
generic_model_converter* mc0 = alloc(generic_model_converter, m, "dl-subsumption");
|
||||
for (func_decl* p : m_total_relations) {
|
||||
mc0->add(p, m.mk_true());
|
||||
}
|
||||
m_context.add_model_converter(mc0);
|
||||
}
|
||||
TRACE("dl",
|
||||
tout << "original set size: "<<orig.get_num_rules()<<"\n"
|
||||
<< "reduced set size: "<<tgt.get_num_rules()<<"\n"; );
|
||||
|
@ -292,7 +297,7 @@ namespace datalog {
|
|||
|
||||
SASSERT(total_size>=rel_sz);
|
||||
if(total_size==rel_sz) {
|
||||
on_discovered_total_relation(pred, 0);
|
||||
on_discovered_total_relation(pred, nullptr);
|
||||
}
|
||||
}
|
||||
next_pred:;
|
||||
|
@ -330,7 +335,7 @@ namespace datalog {
|
|||
rule_set * mk_subsumption_checker::operator()(rule_set const & source) {
|
||||
// TODO mc
|
||||
if (!m_context.get_params ().xform_subsumption_checker())
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
m_have_new_total_rule = false;
|
||||
collect_ground_unconditional_rule_heads(source);
|
||||
|
@ -343,7 +348,7 @@ namespace datalog {
|
|||
|
||||
if (!m_have_new_total_rule && !modified) {
|
||||
dealloc(res);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -80,11 +80,11 @@ namespace datalog {
|
|||
m_context(ctx),
|
||||
m_ref_holder(ctx.get_rule_manager()),
|
||||
m_new_total_relation_discovery_during_transformation(true) {}
|
||||
~mk_subsumption_checker() {
|
||||
~mk_subsumption_checker() override {
|
||||
reset_dealloc_values(m_ground_unconditional_rule_heads);
|
||||
}
|
||||
|
||||
virtual rule_set * operator()(rule_set const & source);
|
||||
rule_set * operator()(rule_set const & source) override;
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
@ -346,7 +346,7 @@ namespace datalog {
|
|||
// TODO mc
|
||||
|
||||
if (!m_context.compress_unbound()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
m_modified = false;
|
||||
|
@ -387,7 +387,7 @@ namespace datalog {
|
|||
}
|
||||
}
|
||||
|
||||
rule_set * result = static_cast<rule_set *>(0);
|
||||
rule_set * result = static_cast<rule_set *>(nullptr);
|
||||
if (m_modified) {
|
||||
result = alloc(rule_set, m_context);
|
||||
unsigned fin_rule_cnt = m_rules.size();
|
||||
|
|
|
@ -86,7 +86,7 @@ namespace datalog {
|
|||
public:
|
||||
mk_unbound_compressor(context & ctx);
|
||||
|
||||
rule_set * operator()(rule_set const & source);
|
||||
rule_set * operator()(rule_set const & source) override;
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace datalog {
|
|||
*/
|
||||
mk_unfold(context & ctx);
|
||||
|
||||
rule_set * operator()(rule_set const & source);
|
||||
rule_set * operator()(rule_set const & source) override;
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
@ -59,7 +59,7 @@ namespace datalog {
|
|||
transf.register_plugin(alloc(datalog::mk_quantifier_instantiation, ctx, 37000));
|
||||
|
||||
if (ctx.get_params().datalog_subsumption()) {
|
||||
transf.register_plugin(alloc(datalog::mk_subsumption_checker, ctx, 35005));
|
||||
transf.register_plugin(alloc(datalog::mk_subsumption_checker, ctx, 35005));
|
||||
}
|
||||
transf.register_plugin(alloc(datalog::mk_rule_inliner, ctx, 35000));
|
||||
transf.register_plugin(alloc(datalog::mk_coi_filter, ctx, 34990));
|
||||
|
@ -67,20 +67,20 @@ namespace datalog {
|
|||
|
||||
//and another round of inlining
|
||||
if (ctx.get_params().datalog_subsumption()) {
|
||||
transf.register_plugin(alloc(datalog::mk_subsumption_checker, ctx, 34975));
|
||||
transf.register_plugin(alloc(datalog::mk_subsumption_checker, ctx, 34975));
|
||||
}
|
||||
transf.register_plugin(alloc(datalog::mk_rule_inliner, ctx, 34970));
|
||||
transf.register_plugin(alloc(datalog::mk_coi_filter, ctx, 34960));
|
||||
transf.register_plugin(alloc(datalog::mk_interp_tail_simplifier, ctx, 34950));
|
||||
|
||||
|
||||
if (ctx.get_params().datalog_subsumption()) {
|
||||
transf.register_plugin(alloc(datalog::mk_subsumption_checker, ctx, 34940));
|
||||
transf.register_plugin(alloc(datalog::mk_rule_inliner, ctx, 34930));
|
||||
transf.register_plugin(alloc(datalog::mk_subsumption_checker, ctx, 34920));
|
||||
transf.register_plugin(alloc(datalog::mk_rule_inliner, ctx, 34910));
|
||||
transf.register_plugin(alloc(datalog::mk_subsumption_checker, ctx, 34900));
|
||||
transf.register_plugin(alloc(datalog::mk_rule_inliner, ctx, 34890));
|
||||
transf.register_plugin(alloc(datalog::mk_subsumption_checker, ctx, 34880));
|
||||
transf.register_plugin(alloc(datalog::mk_subsumption_checker, ctx, 34940));
|
||||
transf.register_plugin(alloc(datalog::mk_rule_inliner, ctx, 34930));
|
||||
transf.register_plugin(alloc(datalog::mk_subsumption_checker, ctx, 34920));
|
||||
transf.register_plugin(alloc(datalog::mk_rule_inliner, ctx, 34910));
|
||||
transf.register_plugin(alloc(datalog::mk_subsumption_checker, ctx, 34900));
|
||||
transf.register_plugin(alloc(datalog::mk_rule_inliner, ctx, 34890));
|
||||
transf.register_plugin(alloc(datalog::mk_subsumption_checker, ctx, 34880));
|
||||
}
|
||||
else {
|
||||
transf.register_plugin(alloc(datalog::mk_rule_inliner, ctx, 34930));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue