mirror of
https://github.com/Z3Prover/z3
synced 2025-08-30 23:10:08 +00:00
Use nullptr.
This commit is contained in:
parent
f01328c65f
commit
76eb7b9ede
625 changed files with 4639 additions and 4639 deletions
|
@ -82,7 +82,7 @@ namespace datalog {
|
|||
void get_labels(proof* p, labels&);
|
||||
|
||||
public:
|
||||
boogie_proof(ast_manager& m): m(m), m_proof(m), m_model(0) {}
|
||||
boogie_proof(ast_manager& m): m(m), m_proof(m), m_model(nullptr) {}
|
||||
|
||||
void set_proof(proof* p);
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ namespace datalog {
|
|||
rule_set* m_old_rules;
|
||||
void reset() {
|
||||
dealloc(m_old_rules);
|
||||
m_old_rules = 0;
|
||||
m_old_rules = nullptr;
|
||||
}
|
||||
public:
|
||||
restore_rules(rule_set& r): m_old_rules(alloc(rule_set, r)) {}
|
||||
|
@ -221,9 +221,9 @@ namespace datalog {
|
|||
m_rule_fmls_head(0),
|
||||
m_rule_fmls(m),
|
||||
m_background(m),
|
||||
m_mc(0),
|
||||
m_rel(0),
|
||||
m_engine(0),
|
||||
m_mc(nullptr),
|
||||
m_rel(nullptr),
|
||||
m_engine(nullptr),
|
||||
m_closed(false),
|
||||
m_saturation_was_run(false),
|
||||
m_enable_bind_variables(true),
|
||||
|
@ -251,8 +251,8 @@ namespace datalog {
|
|||
m_preds.reset();
|
||||
m_preds_by_name.reset();
|
||||
reset_dealloc_values(m_sorts);
|
||||
m_engine = 0;
|
||||
m_rel = 0;
|
||||
m_engine = nullptr;
|
||||
m_rel = nullptr;
|
||||
}
|
||||
|
||||
bool context::is_fact(app * head) const {
|
||||
|
@ -465,7 +465,7 @@ namespace datalog {
|
|||
scoped_proof_mode _scp(m, generate_proof_trace()?PGM_ENABLED:PGM_DISABLED);
|
||||
while (m_rule_fmls_head < m_rule_fmls.size()) {
|
||||
expr* fml = m_rule_fmls[m_rule_fmls_head].get();
|
||||
proof* p = generate_proof_trace()?m.mk_asserted(fml):0;
|
||||
proof* p = generate_proof_trace()?m.mk_asserted(fml):nullptr;
|
||||
rm.mk_rule(fml, p, m_rule_set, m_rule_names[m_rule_fmls_head]);
|
||||
++m_rule_fmls_head;
|
||||
}
|
||||
|
@ -478,7 +478,7 @@ namespace datalog {
|
|||
//
|
||||
void context::update_rule(expr* rl, symbol const& name) {
|
||||
datalog::rule_manager& rm = get_rule_manager();
|
||||
proof* p = 0;
|
||||
proof* p = nullptr;
|
||||
if (generate_proof_trace()) {
|
||||
p = m.mk_asserted(rl);
|
||||
}
|
||||
|
@ -493,7 +493,7 @@ namespace datalog {
|
|||
// The new rule is inserted last:
|
||||
rule_ref r(m_rule_set.get_rule(size_before), rm);
|
||||
rule_ref_vector const& rls = m_rule_set.get_rules();
|
||||
rule* old_rule = 0;
|
||||
rule* old_rule = nullptr;
|
||||
for (unsigned i = 0; i < size_before; ++i) {
|
||||
if (rls[i]->name() == name) {
|
||||
if (old_rule) {
|
||||
|
@ -861,8 +861,8 @@ namespace datalog {
|
|||
lbool context::query(expr* query) {
|
||||
m_mc = mk_skip_model_converter();
|
||||
m_last_status = OK;
|
||||
m_last_answer = 0;
|
||||
m_last_ground_answer = 0;
|
||||
m_last_answer = nullptr;
|
||||
m_last_ground_answer = nullptr;
|
||||
switch (get_engine()) {
|
||||
case DATALOG_ENGINE:
|
||||
case SPACER_ENGINE:
|
||||
|
@ -890,8 +890,8 @@ namespace datalog {
|
|||
lbool context::query_from_lvl (expr* query, unsigned lvl) {
|
||||
m_mc = mk_skip_model_converter();
|
||||
m_last_status = OK;
|
||||
m_last_answer = 0;
|
||||
m_last_ground_answer = 0;
|
||||
m_last_answer = nullptr;
|
||||
m_last_ground_answer = nullptr;
|
||||
switch (get_engine()) {
|
||||
case DATALOG_ENGINE:
|
||||
case SPACER_ENGINE:
|
||||
|
@ -933,7 +933,7 @@ namespace datalog {
|
|||
}
|
||||
|
||||
lbool context::rel_query(unsigned num_rels, func_decl * const* rels) {
|
||||
m_last_answer = 0;
|
||||
m_last_answer = nullptr;
|
||||
ensure_engine();
|
||||
return m_engine->query(num_rels, rels);
|
||||
}
|
||||
|
@ -1059,7 +1059,7 @@ namespace datalog {
|
|||
for (unsigned i = m_rule_fmls_head; i < m_rule_fmls.size(); ++i) {
|
||||
m_free_vars(m_rule_fmls[i].get());
|
||||
if (!m_free_vars.empty()) {
|
||||
rm.mk_rule(m_rule_fmls[i].get(), 0, m_rule_set, m_rule_names[i]);
|
||||
rm.mk_rule(m_rule_fmls[i].get(), nullptr, m_rule_set, m_rule_names[i]);
|
||||
m_rule_fmls[i] = m_rule_fmls.back();
|
||||
m_rule_names[i] = m_rule_names.back();
|
||||
m_rule_fmls.pop_back();
|
||||
|
|
|
@ -331,7 +331,7 @@ namespace datalog {
|
|||
names. Generally, the names coming from the parses are registered here.
|
||||
*/
|
||||
func_decl * try_get_predicate_decl(symbol const& pred_name) const {
|
||||
func_decl * res = 0;
|
||||
func_decl * res = nullptr;
|
||||
m_preds_by_name.find(pred_name, res);
|
||||
return res;
|
||||
}
|
||||
|
@ -341,7 +341,7 @@ namespace datalog {
|
|||
|
||||
*/
|
||||
func_decl * mk_fresh_head_predicate(symbol const & prefix, symbol const & suffix,
|
||||
unsigned arity, sort * const * domain, func_decl* orig_pred=0);
|
||||
unsigned arity, sort * const * domain, func_decl* orig_pred=nullptr);
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -128,7 +128,7 @@ namespace datalog {
|
|||
//
|
||||
// -----------------------------------
|
||||
|
||||
cost_recorder::cost_recorder() : m_obj(0) {
|
||||
cost_recorder::cost_recorder() : m_obj(nullptr) {
|
||||
m_stopwatch = alloc(stopwatch);
|
||||
m_stopwatch->start();
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ namespace datalog {
|
|||
c.milliseconds+=time_delta;
|
||||
m_obj->m_being_recorded = false;
|
||||
}
|
||||
m_running = obj!=0;
|
||||
m_running = obj!=nullptr;
|
||||
m_obj = obj;
|
||||
m_last_time = curr_time;
|
||||
if(obj) {
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace datalog {
|
|||
costs m_processed_cost;
|
||||
bool m_being_recorded;
|
||||
protected:
|
||||
accounted_object() : m_context(0), m_parent_object(0), m_being_recorded(false) {}
|
||||
accounted_object() : m_context(nullptr), m_parent_object(nullptr), m_being_recorded(false) {}
|
||||
~accounted_object();
|
||||
public:
|
||||
|
||||
|
@ -107,7 +107,7 @@ namespace datalog {
|
|||
before separately.
|
||||
*/
|
||||
void start(accounted_object *);
|
||||
void finish() { start(0); }
|
||||
void finish() { start(nullptr); }
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ namespace datalog {
|
|||
}
|
||||
|
||||
var_idx_set& rule_manager::collect_vars(expr* e) {
|
||||
return collect_vars(e, 0);
|
||||
return collect_vars(e, nullptr);
|
||||
}
|
||||
|
||||
var_idx_set& rule_manager::collect_vars(expr* e1, expr* e2) {
|
||||
|
@ -274,11 +274,11 @@ namespace datalog {
|
|||
bind_variables(query, false, q);
|
||||
|
||||
quantifier_hoister qh(m);
|
||||
qh.pull_quantifier(false, q, 0, &names);
|
||||
qh.pull_quantifier(false, q, nullptr, &names);
|
||||
// retrieve free variables.
|
||||
m_free_vars(q);
|
||||
vars.append(m_free_vars.size(), m_free_vars.c_ptr());
|
||||
if (vars.contains(static_cast<sort*>(0))) {
|
||||
if (vars.contains(static_cast<sort*>(nullptr))) {
|
||||
var_subst sub(m, false);
|
||||
expr_ref_vector args(m);
|
||||
// [s0, 0, s2, ..]
|
||||
|
@ -306,7 +306,7 @@ namespace datalog {
|
|||
}
|
||||
body.push_back(to_app(q));
|
||||
flatten_body(body);
|
||||
func_decl* body_pred = 0;
|
||||
func_decl* body_pred = nullptr;
|
||||
for (unsigned i = 0; i < body.size(); i++) {
|
||||
if (is_uninterp(body[i].get())) {
|
||||
body_pred = body[i]->get_decl();
|
||||
|
@ -472,7 +472,7 @@ namespace datalog {
|
|||
r->m_head = head;
|
||||
r->m_name = name;
|
||||
r->m_tail_size = n;
|
||||
r->m_proof = 0;
|
||||
r->m_proof = nullptr;
|
||||
m.inc_ref(r->m_head);
|
||||
|
||||
app * * uninterp_tail = r->m_tail; //grows upwards
|
||||
|
@ -482,7 +482,7 @@ namespace datalog {
|
|||
bool has_neg = false;
|
||||
|
||||
for (unsigned i = 0; i < n; i++) {
|
||||
bool is_neg = (is_negated != 0 && is_negated[i]);
|
||||
bool is_neg = (is_negated != nullptr && is_negated[i]);
|
||||
app * curr = tail[i];
|
||||
|
||||
if (is_neg && !m_ctx.is_predicate(curr)) {
|
||||
|
@ -548,7 +548,7 @@ namespace datalog {
|
|||
r->m_tail_size = n;
|
||||
r->m_positive_cnt = source->m_positive_cnt;
|
||||
r->m_uninterp_cnt = source->m_uninterp_cnt;
|
||||
r->m_proof = 0;
|
||||
r->m_proof = nullptr;
|
||||
m.inc_ref(r->m_head);
|
||||
for (unsigned i = 0; i < n; i++) {
|
||||
r->m_tail[i] = source->m_tail[i];
|
||||
|
@ -978,7 +978,7 @@ namespace datalog {
|
|||
subst_vals.push_back(m.mk_var(next_fresh_var++, var_srt));
|
||||
}
|
||||
else {
|
||||
subst_vals.push_back(0);
|
||||
subst_vals.push_back(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace datalog {
|
|||
bool m_found;
|
||||
func_decl* m_func;
|
||||
uninterpreted_function_finder_proc(ast_manager& m):
|
||||
m(m), m_dt(m), m_dl(m), m_found(false), m_func(0) {}
|
||||
m(m), m_dt(m), m_dl(m), m_found(false), m_func(nullptr) {}
|
||||
void operator()(var * n) { }
|
||||
void operator()(quantifier * n) { }
|
||||
void operator()(app * n) {
|
||||
|
@ -71,7 +71,7 @@ namespace datalog {
|
|||
}
|
||||
}
|
||||
}
|
||||
void reset() { m_found = false; m_func = 0; }
|
||||
void reset() { m_found = false; m_func = nullptr; }
|
||||
|
||||
bool found(func_decl*& f) const { f = m_func; return m_found; }
|
||||
};
|
||||
|
@ -209,7 +209,7 @@ namespace datalog {
|
|||
|
||||
\remark A tail may contain negation. tail[i] is assumed to be negated if is_neg != 0 && is_neg[i] == true
|
||||
*/
|
||||
rule * mk(app * head, unsigned n, app * const * tail, bool const * is_neg = 0,
|
||||
rule * mk(app * head, unsigned n, app * const * tail, bool const * is_neg = nullptr,
|
||||
symbol const& name = symbol::null, bool normalize = true);
|
||||
|
||||
/**
|
||||
|
|
|
@ -282,7 +282,7 @@ namespace datalog {
|
|||
m_rule_manager(ctx.get_rule_manager()),
|
||||
m_rules(m_rule_manager),
|
||||
m_deps(ctx),
|
||||
m_stratifier(0),
|
||||
m_stratifier(nullptr),
|
||||
m_refs(ctx.get_manager()) {
|
||||
}
|
||||
|
||||
|
@ -291,7 +291,7 @@ namespace datalog {
|
|||
m_rule_manager(other.m_rule_manager),
|
||||
m_rules(m_rule_manager),
|
||||
m_deps(other.m_context),
|
||||
m_stratifier(0),
|
||||
m_stratifier(nullptr),
|
||||
m_refs(m_context.get_manager()) {
|
||||
add_rules(other);
|
||||
if (other.m_stratifier) {
|
||||
|
@ -307,7 +307,7 @@ namespace datalog {
|
|||
m_rules.reset();
|
||||
reset_dealloc_values(m_head2rules);
|
||||
m_deps.reset();
|
||||
m_stratifier = 0;
|
||||
m_stratifier = nullptr;
|
||||
m_output_preds.reset();
|
||||
m_orig2pred.reset();
|
||||
m_pred2orig.reset();
|
||||
|
@ -401,7 +401,7 @@ namespace datalog {
|
|||
m_deps.populate(*this);
|
||||
m_stratifier = alloc(rule_stratifier, m_deps);
|
||||
if (!stratified_negation()) {
|
||||
m_stratifier = 0;
|
||||
m_stratifier = nullptr;
|
||||
m_deps.reset();
|
||||
return false;
|
||||
}
|
||||
|
@ -410,7 +410,7 @@ namespace datalog {
|
|||
|
||||
void rule_set::reopen() {
|
||||
if (is_closed()) {
|
||||
m_stratifier = 0;
|
||||
m_stratifier = nullptr;
|
||||
m_deps.reset();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ namespace datalog {
|
|||
(higher priority plugins will be applied first).
|
||||
*/
|
||||
plugin(unsigned priority, bool can_destratify_negation = false) : m_priority(priority),
|
||||
m_can_destratify_negation(can_destratify_negation), m_transformer(0) {}
|
||||
m_can_destratify_negation(can_destratify_negation), m_transformer(nullptr) {}
|
||||
|
||||
public:
|
||||
virtual ~plugin() {}
|
||||
|
|
|
@ -34,7 +34,7 @@ Revision History:
|
|||
|
||||
namespace datalog {
|
||||
|
||||
verbose_action::verbose_action(char const* msg, unsigned lvl): m_lvl(lvl), m_sw(0) {
|
||||
verbose_action::verbose_action(char const* msg, unsigned lvl): m_lvl(lvl), m_sw(nullptr) {
|
||||
IF_VERBOSE(m_lvl,
|
||||
(verbose_stream() << msg << "...").flush();
|
||||
m_sw = alloc(stopwatch);
|
||||
|
@ -87,7 +87,7 @@ namespace datalog {
|
|||
else {
|
||||
SASSERT(is_var(arg));
|
||||
int vidx = to_var(arg)->get_idx();
|
||||
var * new_var = 0;
|
||||
var * new_var = nullptr;
|
||||
if (!varidx2var.find(vidx, new_var)) {
|
||||
new_var = m.mk_var(next_idx, to_var(arg)->get_sort());
|
||||
next_idx++;
|
||||
|
@ -428,7 +428,7 @@ namespace datalog {
|
|||
|
||||
unsigned tgt_sz = max_var_idx+1;
|
||||
unsigned tgt_ofs = tgt_sz-1;
|
||||
tgt.resize(tgt_sz, 0);
|
||||
tgt.resize(tgt_sz, nullptr);
|
||||
for(unsigned i=0; i<src_sz; i++) {
|
||||
expr * e = src[src_ofs-i];
|
||||
if(!e) {
|
||||
|
@ -446,7 +446,7 @@ namespace datalog {
|
|||
out << "(";
|
||||
for(int i=len-1; i>=0; i--) {
|
||||
out << (len-1-i) <<"->";
|
||||
if(cont.get(i)==0) {
|
||||
if(cont.get(i)==nullptr) {
|
||||
out << "{none}";
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -153,7 +153,7 @@ public:
|
|||
m_fresh_predicates.reset();
|
||||
m_todo.push_back(n);
|
||||
m_proofs.push_back(p);
|
||||
m_produce_proofs = p != 0;
|
||||
m_produce_proofs = p != nullptr;
|
||||
while (!m_todo.empty() && checkpoint()) {
|
||||
fml = m_todo.back();
|
||||
pr = m_proofs.back();
|
||||
|
@ -269,7 +269,7 @@ private:
|
|||
expr* const* args = _or->get_args();
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
m_todo.push_back(bind_variables(m.mk_implies(args[i], head)));
|
||||
m_proofs.push_back(0);
|
||||
m_proofs.push_back(nullptr);
|
||||
}
|
||||
|
||||
if (premise) {
|
||||
|
@ -284,7 +284,7 @@ private:
|
|||
m_proofs[m_proofs.size()-sz+i] = m.mk_and_elim(p2, i);
|
||||
}
|
||||
}
|
||||
fml = 0;
|
||||
fml = nullptr;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -330,7 +330,7 @@ private:
|
|||
bool is_disj = false;
|
||||
expr_ref_vector _body(m);
|
||||
unsigned num_disj = 0;
|
||||
expr* const* disjs = 0;
|
||||
expr* const* disjs = nullptr;
|
||||
if (!contains_predicate(b)) {
|
||||
return;
|
||||
}
|
||||
|
@ -356,7 +356,7 @@ private:
|
|||
negate_args = false;
|
||||
}
|
||||
if (is_disj) {
|
||||
app* old_head = 0;
|
||||
app* old_head = nullptr;
|
||||
if (m_memoize_disj.find(b, old_head)) {
|
||||
body = old_head;
|
||||
}
|
||||
|
@ -369,7 +369,7 @@ private:
|
|||
e = m.mk_not(e);
|
||||
}
|
||||
m_todo.push_back(bind_variables(m.mk_implies(e, head)));
|
||||
m_proofs.push_back(0);
|
||||
m_proofs.push_back(nullptr);
|
||||
if (produce_proofs()) {
|
||||
defs.push_back(m.mk_def_intro(m_todo.back()));
|
||||
m_proofs[m_proofs.size()-1] = defs.back();
|
||||
|
@ -423,7 +423,7 @@ private:
|
|||
if (!is_predicate(e)) {
|
||||
app_ref head = mk_fresh_head(e);
|
||||
m_todo.push_back(bind_variables(m.mk_implies(e, head)));
|
||||
m_proofs.push_back(0);
|
||||
m_proofs.push_back(nullptr);
|
||||
body = m.update_quantifier(q, head);
|
||||
if (produce_proofs()) {
|
||||
proof* def_intro = m.mk_def_intro(m_todo.back());
|
||||
|
|
|
@ -270,7 +270,7 @@ namespace datalog {
|
|||
TRACE("bmc", tout << "Predicate: " << pred->get_name() << "\n";);
|
||||
expr_ref_vector sub(m);
|
||||
rule_vector const& rls = b.m_rules.get_predicate_rules(pred);
|
||||
rule* r = 0;
|
||||
rule* r = nullptr;
|
||||
unsigned i = 0;
|
||||
for (; i < rls.size(); ++i) {
|
||||
rule_i = m.mk_app(mk_q_rule(pred, i), mk_q_num(level).get());
|
||||
|
@ -489,7 +489,7 @@ namespace datalog {
|
|||
|
||||
proof_ref get_proof(model_ref& md, func_decl* pred, app* prop, unsigned level) {
|
||||
if (m.canceled()) {
|
||||
return proof_ref(0, m);
|
||||
return proof_ref(nullptr, m);
|
||||
}
|
||||
TRACE("bmc", tout << "Predicate: " << pred->get_name() << "\n";);
|
||||
rule_manager& rm = b.m_ctx.get_rule_manager();
|
||||
|
@ -500,7 +500,7 @@ namespace datalog {
|
|||
|
||||
// find the rule that was triggered by evaluating the arguments to prop.
|
||||
rule_vector const& rls = b.m_rules.get_predicate_rules(pred);
|
||||
rule* r = 0;
|
||||
rule* r = nullptr;
|
||||
for (unsigned i = 0; i < rls.size(); ++i) {
|
||||
func_decl_ref rule_i = mk_level_rule(pred, i, level);
|
||||
TRACE("bmc", rls[i]->display(b.m_ctx, tout << "Checking rule " << mk_pp(rule_i, m) << " "););
|
||||
|
@ -606,7 +606,7 @@ namespace datalog {
|
|||
binding.push_back(m.mk_app(f, args.size(), args.c_ptr()));
|
||||
}
|
||||
else {
|
||||
binding.push_back(0);
|
||||
binding.push_back(nullptr);
|
||||
}
|
||||
}
|
||||
return binding;
|
||||
|
@ -642,7 +642,7 @@ namespace datalog {
|
|||
names.push_back(symbol(i));
|
||||
}
|
||||
else {
|
||||
binding.push_back(0);
|
||||
binding.push_back(nullptr);
|
||||
}
|
||||
}
|
||||
sorts.reverse();
|
||||
|
@ -686,7 +686,7 @@ namespace datalog {
|
|||
}
|
||||
else {
|
||||
expr * const * no_pats = &new_body;
|
||||
result = n.m.update_quantifier(old_q, 0, 0, 1, no_pats, new_body);
|
||||
result = n.m.update_quantifier(old_q, 0, nullptr, 1, no_pats, new_body);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -986,7 +986,7 @@ namespace datalog {
|
|||
sort_ref_vector new_sorts(m);
|
||||
family_id dfid = m.mk_family_id("datatype");
|
||||
datatype_decl_plugin* dtp = static_cast<datatype_decl_plugin*>(m.get_plugin(dfid));
|
||||
VERIFY (dtp->mk_datatypes(dts.size(), dts.c_ptr(), 0, 0, new_sorts));
|
||||
VERIFY (dtp->mk_datatypes(dts.size(), dts.c_ptr(), 0, nullptr, new_sorts));
|
||||
|
||||
it = b.m_rules.begin_grouped_rules();
|
||||
for (unsigned i = 0; it != end; ++it, ++i) {
|
||||
|
@ -1012,7 +1012,7 @@ namespace datalog {
|
|||
unsigned sz = r->get_uninterpreted_tail_size();
|
||||
max_arity = std::max(sz, max_arity);
|
||||
}
|
||||
cnstrs.push_back(mk_constructor_decl(symbol("Z#"), symbol("Z#?"), 0, 0));
|
||||
cnstrs.push_back(mk_constructor_decl(symbol("Z#"), symbol("Z#?"), 0, nullptr));
|
||||
|
||||
for (unsigned i = 0; i + 1 < max_arity; ++i) {
|
||||
std::stringstream _name;
|
||||
|
@ -1028,7 +1028,7 @@ namespace datalog {
|
|||
cnstrs.push_back(mk_constructor_decl(name, is_name, accs.size(), accs.c_ptr()));
|
||||
}
|
||||
dts.push_back(mk_datatype_decl(dtu, symbol("Path"), 0, nullptr, cnstrs.size(), cnstrs.c_ptr()));
|
||||
VERIFY (dtp->mk_datatypes(dts.size(), dts.c_ptr(), 0, 0, new_sorts));
|
||||
VERIFY (dtp->mk_datatypes(dts.size(), dts.c_ptr(), 0, nullptr, new_sorts));
|
||||
m_path_sort = new_sorts[0].get();
|
||||
}
|
||||
}
|
||||
|
@ -1090,7 +1090,7 @@ namespace datalog {
|
|||
}
|
||||
}
|
||||
UNREACHABLE();
|
||||
return proof_ref(0, m);
|
||||
return proof_ref(nullptr, m);
|
||||
}
|
||||
|
||||
// instantiation of algebraic data-types takes care of the rest.
|
||||
|
@ -1201,7 +1201,7 @@ namespace datalog {
|
|||
TRACE("bmc", tout << "Predicate: " << pred->get_name() << "\n";);
|
||||
expr_ref_vector sub(m);
|
||||
rule_vector const& rls = b.m_rules.get_predicate_rules(pred);
|
||||
rule* r = 0;
|
||||
rule* r = nullptr;
|
||||
unsigned i = 0;
|
||||
for (; i < rls.size(); ++i) {
|
||||
expr_ref rule_i = mk_level_rule(pred, i, level);
|
||||
|
@ -1446,7 +1446,7 @@ namespace datalog {
|
|||
|
||||
lbool bmc::query(expr* query) {
|
||||
m_solver.reset();
|
||||
m_answer = 0;
|
||||
m_answer = nullptr;
|
||||
m_ctx.ensure_opened();
|
||||
m_rules.reset();
|
||||
datalog::rule_manager& rule_manager = m_ctx.get_rule_manager();
|
||||
|
|
|
@ -197,7 +197,7 @@ namespace datalog {
|
|||
|
||||
|
||||
proof_ref get_proof() const {
|
||||
return proof_ref(0, m);
|
||||
return proof_ref(nullptr, m);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -462,7 +462,7 @@ namespace datalog {
|
|||
private:
|
||||
|
||||
ddnf_mgr* insert(unsigned n) {
|
||||
ddnf_mgr* m = 0;
|
||||
ddnf_mgr* m = nullptr;
|
||||
if (!m_mgrs.find(n, m)) {
|
||||
m = alloc(ddnf_mgr, n);
|
||||
m_mgrs.insert(n, m);
|
||||
|
@ -673,7 +673,7 @@ namespace datalog {
|
|||
|
||||
void dump_rules(rule_set& rules) {
|
||||
init_ctx(rules);
|
||||
m_inner_ctx.display_smt2(0, 0, std::cout);
|
||||
m_inner_ctx.display_smt2(0, nullptr, std::cout);
|
||||
}
|
||||
|
||||
lbool execute_rules(rule_set& rules) {
|
||||
|
@ -715,7 +715,7 @@ namespace datalog {
|
|||
compile_expr(r.get_tail(i), tmp);
|
||||
body.push_back(to_app(tmp));
|
||||
}
|
||||
rule* r_new = rm.mk(head, body.size(), body.c_ptr(), 0, r.name(), false);
|
||||
rule* r_new = rm.mk(head, body.size(), body.c_ptr(), nullptr, r.name(), false);
|
||||
new_rules.add_rule(r_new);
|
||||
IF_VERBOSE(20, r_new->display(m_ctx, verbose_stream()););
|
||||
if (old_rules.is_output_predicate(r.get_decl())) {
|
||||
|
@ -775,11 +775,11 @@ namespace datalog {
|
|||
return bv.mk_sort(nb);
|
||||
}
|
||||
UNREACHABLE();
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void compile_expr(expr* e, expr_ref& result) {
|
||||
expr* r = 0;
|
||||
expr* r = nullptr;
|
||||
if (m_cache.find(e, r)) {
|
||||
result = r;
|
||||
return;
|
||||
|
@ -847,7 +847,7 @@ namespace datalog {
|
|||
}
|
||||
|
||||
void compile_eq(expr* e, expr_ref& result, var* v, unsigned hi, unsigned lo, expr* c) {
|
||||
tbv* t = 0;
|
||||
tbv* t = nullptr;
|
||||
// TBD: hi, lo are ignored.
|
||||
VERIFY(m_expr2tbv.find(e, t));
|
||||
var_ref w(m);
|
||||
|
|
10
src/muz/duality/duality_dl_interface.cpp
Executable file → Normal file
10
src/muz/duality/duality_dl_interface.cpp
Executable file → Normal file
|
@ -71,10 +71,10 @@ namespace Duality {
|
|||
Solver::Counterexample cex;
|
||||
|
||||
duality_data(ast_manager &_m) : ctx(_m,config(params_ref())) {
|
||||
ls = 0;
|
||||
rpfp = 0;
|
||||
ls = nullptr;
|
||||
rpfp = nullptr;
|
||||
status = StatusNull;
|
||||
old_rs = 0;
|
||||
old_rs = nullptr;
|
||||
}
|
||||
~duality_data(){
|
||||
if(old_rs)
|
||||
|
@ -92,7 +92,7 @@ namespace Duality {
|
|||
m_ctx(dl_ctx)
|
||||
|
||||
{
|
||||
_d = 0;
|
||||
_d = nullptr;
|
||||
// dl_ctx.get_manager().toggle_proof_mode(PGM_FINE);
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,7 @@ namespace Duality {
|
|||
|
||||
// if there is old data, get the cex and dispose (later)
|
||||
duality_data *old_data = _d;
|
||||
Solver *old_rs = 0;
|
||||
Solver *old_rs = nullptr;
|
||||
if(old_data){
|
||||
old_rs = old_data->old_rs;
|
||||
old_rs->GetCounterexample().swap(old_data->cex);
|
||||
|
|
|
@ -104,7 +104,7 @@ public:
|
|||
m_ok = (m_file != NULL) && (err == 0);
|
||||
#else
|
||||
m_file = fopen(fname, "rb");
|
||||
m_ok = (m_file != NULL);
|
||||
m_ok = (m_file != nullptr);
|
||||
#endif
|
||||
}
|
||||
~line_reader() {
|
||||
|
@ -171,7 +171,7 @@ class char_reader {
|
|||
public:
|
||||
char_reader(char const* file):
|
||||
m_line_reader(file),
|
||||
m_line(0)
|
||||
m_line(nullptr)
|
||||
{}
|
||||
|
||||
bool operator()() { return m_line_reader(); }
|
||||
|
@ -184,7 +184,7 @@ public:
|
|||
m_line = m_line_reader.get_line();
|
||||
}
|
||||
if (!(m_line[0])) {
|
||||
m_line = 0;
|
||||
m_line = nullptr;
|
||||
return '\n';
|
||||
}
|
||||
char result = m_line[0];
|
||||
|
@ -266,8 +266,8 @@ public:
|
|||
}
|
||||
|
||||
dlexer():
|
||||
m_input(0),
|
||||
m_reader(0),
|
||||
m_input(nullptr),
|
||||
m_reader(nullptr),
|
||||
m_prev_char(0),
|
||||
m_curr_char(0),
|
||||
m_line(1),
|
||||
|
@ -496,17 +496,17 @@ public:
|
|||
|
||||
bool parse_file(char const * filename) override {
|
||||
reset();
|
||||
if (filename != 0) {
|
||||
if (filename != nullptr) {
|
||||
set_path(filename);
|
||||
char_reader reader(filename);
|
||||
if (!reader()) {
|
||||
get_err() << "ERROR: could not open file '" << filename << "'.\n";
|
||||
return false;
|
||||
}
|
||||
return parse_stream(0, &reader);
|
||||
return parse_stream(nullptr, &reader);
|
||||
}
|
||||
else {
|
||||
return parse_stream(&std::cin, 0);
|
||||
return parse_stream(&std::cin, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -514,7 +514,7 @@ public:
|
|||
reset();
|
||||
std::string s(string);
|
||||
std::istringstream is(s);
|
||||
return parse_stream(&is, 0);
|
||||
return parse_stream(&is, nullptr);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
@ -701,7 +701,7 @@ protected:
|
|||
if(is_predicate_declaration) {
|
||||
return unexpected(tok, "predicate declaration should not end with '.'");
|
||||
}
|
||||
add_rule(pred, 0, 0, 0);
|
||||
add_rule(pred, 0, nullptr, nullptr);
|
||||
return m_lexer->next_token();
|
||||
case TK_LEFT_ARROW:
|
||||
return parse_body(pred);
|
||||
|
@ -777,7 +777,7 @@ protected:
|
|||
dtoken parse_infix(dtoken tok1, char const* td, app_ref& pred) {
|
||||
symbol td1(td);
|
||||
expr_ref v1(m_manager), v2(m_manager);
|
||||
sort* s = 0;
|
||||
sort* s = nullptr;
|
||||
dtoken tok2 = m_lexer->next_token();
|
||||
if (tok2 != TK_NEQ && tok2 != TK_GT && tok2 != TK_LT && tok2 != TK_EQ) {
|
||||
return unexpected(tok2, "built-in infix operator");
|
||||
|
@ -790,12 +790,12 @@ protected:
|
|||
symbol td2(td);
|
||||
|
||||
if (tok1 == TK_ID) {
|
||||
expr* _v1 = 0;
|
||||
expr* _v1 = nullptr;
|
||||
m_vars.find(td1.bare_str(), _v1);
|
||||
v1 = _v1;
|
||||
}
|
||||
if (tok3 == TK_ID) {
|
||||
expr* _v2 = 0;
|
||||
expr* _v2 = nullptr;
|
||||
m_vars.find(td2.bare_str(), _v2);
|
||||
v2 = _v2;
|
||||
}
|
||||
|
@ -842,8 +842,8 @@ protected:
|
|||
svector<symbol> arg_names;
|
||||
func_decl* f = m_context.try_get_predicate_decl(s);
|
||||
tok = parse_args(tok, f, args, arg_names);
|
||||
is_predicate_declaration = f==0;
|
||||
if (f==0) {
|
||||
is_predicate_declaration = f==nullptr;
|
||||
if (f==nullptr) {
|
||||
//we're in a declaration
|
||||
unsigned arity = args.size();
|
||||
ptr_vector<sort> domain;
|
||||
|
@ -884,7 +884,7 @@ protected:
|
|||
tok = m_lexer->next_token();
|
||||
while (tok != TK_EOS && tok != TK_ERROR) {
|
||||
symbol alias;
|
||||
sort* s = 0;
|
||||
sort* s = nullptr;
|
||||
|
||||
if(!f) {
|
||||
//we're in a predicate declaration
|
||||
|
@ -951,7 +951,7 @@ protected:
|
|||
symbol data (m_lexer->get_token_data());
|
||||
if (is_var(data.bare_str())) {
|
||||
unsigned idx = 0;
|
||||
expr* v = 0;
|
||||
expr* v = nullptr;
|
||||
if (!m_vars.find(data.bare_str(), v)) {
|
||||
idx = m_num_vars++;
|
||||
v = m_manager.mk_var(idx, s);
|
||||
|
@ -1014,7 +1014,7 @@ protected:
|
|||
dlexer lexer;
|
||||
{
|
||||
flet<dlexer*> lexer_let(m_lexer, &lexer);
|
||||
m_lexer->set_stream(0, &stream);
|
||||
m_lexer->set_stream(nullptr, &stream);
|
||||
tok = m_lexer->next_token();
|
||||
if(parsing_domain) {
|
||||
tok = parse_domains(tok);
|
||||
|
@ -1186,7 +1186,7 @@ class wpa_parser_impl : public wpa_parser, dparser {
|
|||
bool m_use_map_names;
|
||||
|
||||
uint64_set& ensure_sort_content(symbol sort_name) {
|
||||
sym2nums::entry * e = m_sort_contents.insert_if_not_there2(sort_name, 0);
|
||||
sym2nums::entry * e = m_sort_contents.insert_if_not_there2(sort_name, nullptr);
|
||||
if(!e->get_data().m_value) {
|
||||
e->get_data().m_value = alloc(uint64_set);
|
||||
}
|
||||
|
@ -1312,10 +1312,10 @@ private:
|
|||
|
||||
dlexer lexer;
|
||||
m_lexer = &lexer;
|
||||
m_lexer->set_stream(&stm, 0);
|
||||
m_lexer->set_stream(&stm, nullptr);
|
||||
dtoken tok = m_lexer->next_token();
|
||||
tok = parse_decls(tok);
|
||||
m_lexer = 0;
|
||||
m_lexer = nullptr;
|
||||
}
|
||||
|
||||
bool parse_rel_line(char * full_line, uint64_vector & args) {
|
||||
|
|
|
@ -56,7 +56,7 @@ struct dl_context {
|
|||
m_cmd(ctx),
|
||||
m_collected_cmds(collected_cmds),
|
||||
m_ref_count(0),
|
||||
m_decl_plugin(0),
|
||||
m_decl_plugin(nullptr),
|
||||
m_trail(*this) {}
|
||||
|
||||
void inc_ref() {
|
||||
|
@ -88,7 +88,7 @@ struct dl_context {
|
|||
}
|
||||
|
||||
void reset() {
|
||||
m_context = 0;
|
||||
m_context = nullptr;
|
||||
}
|
||||
|
||||
void register_predicate(func_decl* pred, unsigned num_kinds, symbol const* kinds) {
|
||||
|
@ -164,7 +164,7 @@ public:
|
|||
cmd("rule"),
|
||||
m_dl_ctx(dl_ctx),
|
||||
m_arg_idx(0),
|
||||
m_t(0),
|
||||
m_t(nullptr),
|
||||
m_bound(UINT_MAX) {}
|
||||
char const * get_usage() const override { return "(forall (q) (=> (and body) head)) :optional-name :optional-recursion-bound"; }
|
||||
char const * get_descr(cmd_context & ctx) const override { return "add a Horn rule."; }
|
||||
|
@ -206,7 +206,7 @@ public:
|
|||
dl_query_cmd(dl_context * dl_ctx):
|
||||
parametric_cmd("query"),
|
||||
m_dl_ctx(dl_ctx),
|
||||
m_target(0) {
|
||||
m_target(nullptr) {
|
||||
}
|
||||
char const * get_usage() const override { return "predicate"; }
|
||||
char const * get_main_descr() const override {
|
||||
|
@ -214,7 +214,7 @@ public:
|
|||
}
|
||||
|
||||
cmd_arg_kind next_arg_kind(cmd_context & ctx) const override {
|
||||
if (m_target == 0) return CPK_FUNC_DECL;
|
||||
if (m_target == nullptr) return CPK_FUNC_DECL;
|
||||
return parametric_cmd::next_arg_kind(ctx);
|
||||
}
|
||||
|
||||
|
@ -232,11 +232,11 @@ public:
|
|||
void prepare(cmd_context & ctx) override {
|
||||
ctx.m(); // ensure manager is initialized.
|
||||
parametric_cmd::prepare(ctx);
|
||||
m_target = 0;
|
||||
m_target = nullptr;
|
||||
}
|
||||
|
||||
void execute(cmd_context& ctx) override {
|
||||
if (m_target == 0) {
|
||||
if (m_target == nullptr) {
|
||||
throw cmd_exception("invalid query command, argument expected");
|
||||
}
|
||||
if (m_dl_ctx->collect_query(m_target)) {
|
||||
|
@ -318,7 +318,7 @@ public:
|
|||
}
|
||||
dlctx.cleanup();
|
||||
print_statistics(ctx);
|
||||
m_target = 0;
|
||||
m_target = nullptr;
|
||||
}
|
||||
|
||||
void init_pdescrs(cmd_context & ctx, param_descrs & p) override {
|
||||
|
@ -472,7 +472,7 @@ public:
|
|||
|
||||
void execute(cmd_context & ctx) override {
|
||||
ast_manager& m = ctx.m();
|
||||
func_decl_ref var(m.mk_func_decl(m_var_name, 0, static_cast<sort*const*>(0), m_var_sort), m);
|
||||
func_decl_ref var(m.mk_func_decl(m_var_name, 0, static_cast<sort*const*>(nullptr), m_var_sort), m);
|
||||
ctx.insert(var);
|
||||
m_dl_ctx->dlctx().register_variable(var);
|
||||
}
|
||||
|
@ -528,7 +528,7 @@ static void install_dl_cmds_aux(cmd_context& ctx, dl_collected_cmds* collected_c
|
|||
}
|
||||
|
||||
void install_dl_cmds(cmd_context & ctx) {
|
||||
install_dl_cmds_aux(ctx, 0);
|
||||
install_dl_cmds_aux(ctx, nullptr);
|
||||
}
|
||||
|
||||
void install_dl_collect_cmds(dl_collected_cmds& collected_cmds, cmd_context & ctx) {
|
||||
|
|
|
@ -27,7 +27,7 @@ Revision History:
|
|||
#include "muz/spacer/spacer_dl_interface.h"
|
||||
|
||||
namespace datalog {
|
||||
register_engine::register_engine(): m_ctx(0) {}
|
||||
register_engine::register_engine(): m_ctx(nullptr) {}
|
||||
|
||||
engine_base* register_engine::mk_engine(DL_ENGINE engine_type) {
|
||||
switch(engine_type) {
|
||||
|
@ -51,10 +51,10 @@ namespace datalog {
|
|||
return alloc(ddnf, *m_ctx);
|
||||
case LAST_ENGINE:
|
||||
UNREACHABLE();
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
UNREACHABLE();
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ class horn_tactic : public tactic {
|
|||
|
||||
void normalize(expr_ref& f) {
|
||||
bool is_positive = true;
|
||||
expr* e = 0;
|
||||
expr* e = nullptr;
|
||||
while (true) {
|
||||
if (is_forall(f) && is_positive) {
|
||||
f = to_quantifier(f)->get_expr();
|
||||
|
@ -141,7 +141,7 @@ class horn_tactic : public tactic {
|
|||
ast_mark mark;
|
||||
expr_ref_vector args(m), body(m);
|
||||
expr_ref head(m);
|
||||
expr* a = 0, *a1 = 0;
|
||||
expr* a = nullptr, *a1 = nullptr;
|
||||
flatten_or(tmp, args);
|
||||
for (unsigned i = 0; i < args.size(); ++i) {
|
||||
a = args[i].get();
|
||||
|
@ -182,7 +182,7 @@ class horn_tactic : public tactic {
|
|||
proof_converter_ref & pc,
|
||||
expr_dependency_ref & core) {
|
||||
SASSERT(g->is_well_sorted());
|
||||
mc = 0; pc = 0; core = 0;
|
||||
mc = nullptr; pc = nullptr; core = nullptr;
|
||||
tactic_report report("horn", *g);
|
||||
bool produce_proofs = g->proofs_enabled();
|
||||
|
||||
|
@ -270,7 +270,7 @@ class horn_tactic : public tactic {
|
|||
if (produce_proofs) {
|
||||
proof_ref proof = m_ctx.get_proof();
|
||||
pc = proof2proof_converter(m, proof);
|
||||
g->assert_expr(m.mk_false(), proof, 0);
|
||||
g->assert_expr(m.mk_false(), proof, nullptr);
|
||||
}
|
||||
else {
|
||||
g->assert_expr(m.mk_false());
|
||||
|
|
|
@ -35,8 +35,8 @@ namespace pdr {
|
|||
expr* m_k;
|
||||
obj_map<func_decl, expr*>* m_translate;
|
||||
public:
|
||||
scaler(ast_manager& m): m(m), a(m), m_translate(0) {}
|
||||
expr_ref operator()(expr* e, expr* k, obj_map<func_decl, expr*>* translate = 0);
|
||||
scaler(ast_manager& m): m(m), a(m), m_translate(nullptr) {}
|
||||
expr_ref operator()(expr* e, expr* k, obj_map<func_decl, expr*>* translate = nullptr);
|
||||
expr_ref undo_k(expr* e, expr* k);
|
||||
private:
|
||||
expr_ref scale(expr* e, bool is_mul);
|
||||
|
|
|
@ -128,7 +128,7 @@ namespace pdr {
|
|||
std::stringstream name_stm;
|
||||
name_stm << m_head->get_name() << '_' << i;
|
||||
func_decl_ref stm(m);
|
||||
stm = m.mk_func_decl(symbol(name_stm.str().c_str()), 0, (sort*const*)0, arg_sort);
|
||||
stm = m.mk_func_decl(symbol(name_stm.str().c_str()), 0, (sort*const*)nullptr, arg_sort);
|
||||
m_sig.push_back(pm.get_o_pred(stm, 0));
|
||||
}
|
||||
}
|
||||
|
@ -443,7 +443,7 @@ namespace pdr {
|
|||
else if (is_sat == l_false) {
|
||||
uses_level = m_solver.assumes_level();
|
||||
}
|
||||
m_solver.set_model(0);
|
||||
m_solver.set_model(nullptr);
|
||||
return is_sat;
|
||||
}
|
||||
|
||||
|
@ -459,7 +459,7 @@ namespace pdr {
|
|||
tmp = pm.mk_and(conj);
|
||||
prop_solver::scoped_level _sl(m_solver, level);
|
||||
m_solver.set_core(core);
|
||||
m_solver.set_model(0);
|
||||
m_solver.set_model(nullptr);
|
||||
lbool r = m_solver.check_conjunction_as_assumptions(tmp);
|
||||
if (r == l_false) {
|
||||
assumes_level = m_solver.assumes_level();
|
||||
|
@ -477,7 +477,7 @@ namespace pdr {
|
|||
prop_solver::scoped_level _sl(m_solver, level);
|
||||
m_solver.set_core(&core);
|
||||
m_solver.set_subset_based_core(true);
|
||||
m_solver.set_model(0);
|
||||
m_solver.set_model(nullptr);
|
||||
lbool res = m_solver.check_assumptions_and_formula(lits, fml);
|
||||
if (res == l_false) {
|
||||
lits.reset();
|
||||
|
@ -649,7 +649,7 @@ namespace pdr {
|
|||
expr_free_vars fv;
|
||||
fv(e);
|
||||
while (vars.size() < fv.size()) {
|
||||
vars.push_back(0);
|
||||
vars.push_back(nullptr);
|
||||
}
|
||||
for (unsigned i = 0; i < fv.size(); ++i) {
|
||||
if (fv[i] && !vars[i].get()) {
|
||||
|
@ -821,7 +821,7 @@ namespace pdr {
|
|||
datalog::rule const& rl2 = pt().find_rule(*mdl);
|
||||
SASSERT(is_ini(rl2));
|
||||
set_rule(&rl2);
|
||||
pt().get_solver().set_model(0);
|
||||
pt().get_solver().set_model(nullptr);
|
||||
return const_cast<datalog::rule*>(m_rule);
|
||||
}
|
||||
|
||||
|
@ -899,7 +899,7 @@ namespace pdr {
|
|||
if (this == m_next) {
|
||||
SASSERT(m_prev == this);
|
||||
if (root == this) {
|
||||
root = 0;
|
||||
root = nullptr;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -910,8 +910,8 @@ namespace pdr {
|
|||
}
|
||||
}
|
||||
TRACE("pdr", tout << "new root: " << root << "\n";);
|
||||
m_prev = 0;
|
||||
m_next = 0;
|
||||
m_prev = nullptr;
|
||||
m_next = nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
@ -938,7 +938,7 @@ namespace pdr {
|
|||
*/
|
||||
model_node* model_search::next() {
|
||||
if (!m_goal) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
else {
|
||||
model_node* result = m_goal;
|
||||
|
@ -1161,7 +1161,7 @@ namespace pdr {
|
|||
todo.push_back(m_root);
|
||||
while (!todo.empty()) {
|
||||
model_node* n = todo.back();
|
||||
model* md = 0;
|
||||
model* md = nullptr;
|
||||
if (!n->get_model_ptr()) {
|
||||
if (models.find(n->state(), md)) {
|
||||
TRACE("pdr", tout << n->state() << "\n";);
|
||||
|
@ -1300,7 +1300,7 @@ namespace pdr {
|
|||
ptr_vector<model_node> todo;
|
||||
proof_ref_vector trail(m);
|
||||
datalog::rule_ref_vector rules_trail(rm);
|
||||
proof* pr = 0;
|
||||
proof* pr = nullptr;
|
||||
unif.set_normalize(true);
|
||||
todo.push_back(m_root);
|
||||
update_models();
|
||||
|
@ -1416,7 +1416,7 @@ namespace pdr {
|
|||
erase_children(*m_root, false);
|
||||
remove_node(*m_root, false);
|
||||
dealloc(m_root);
|
||||
m_root = 0;
|
||||
m_root = nullptr;
|
||||
}
|
||||
m_cache.reset();
|
||||
}
|
||||
|
@ -1448,10 +1448,10 @@ namespace pdr {
|
|||
: m_fparams(fparams),
|
||||
m_params(params),
|
||||
m(m),
|
||||
m_context(0),
|
||||
m_context(nullptr),
|
||||
m_pm(m_fparams, params.pdr_max_num_contexts(), m),
|
||||
m_query_pred(m),
|
||||
m_query(0),
|
||||
m_query(nullptr),
|
||||
m_search(m_params.pdr_bfs_model_search()),
|
||||
m_last_result(l_undef),
|
||||
m_inductive_lvl(0),
|
||||
|
@ -1479,7 +1479,7 @@ namespace pdr {
|
|||
reset(m_rels_tmp);
|
||||
}
|
||||
m_search.reset();
|
||||
m_query = 0;
|
||||
m_query = nullptr;
|
||||
m_last_result = l_undef;
|
||||
m_inductive_lvl = 0;
|
||||
}
|
||||
|
@ -1546,7 +1546,7 @@ namespace pdr {
|
|||
init_rules(rules, m_rels_tmp);
|
||||
decl2rel::iterator it = m_rels_tmp.begin(), end = m_rels_tmp.end();
|
||||
for (; it != end; ++it) {
|
||||
pred_transformer* pt = 0;
|
||||
pred_transformer* pt = nullptr;
|
||||
if (m_rels.find(it->m_key, pt)) {
|
||||
it->m_value->inherit_properties(*pt);
|
||||
}
|
||||
|
@ -1561,7 +1561,7 @@ namespace pdr {
|
|||
}
|
||||
|
||||
unsigned context::get_num_levels(func_decl* p) {
|
||||
pred_transformer* pt = 0;
|
||||
pred_transformer* pt = nullptr;
|
||||
if (m_rels.find(p, pt)) {
|
||||
return pt->get_num_levels();
|
||||
}
|
||||
|
@ -1572,7 +1572,7 @@ namespace pdr {
|
|||
}
|
||||
|
||||
expr_ref context::get_cover_delta(int level, func_decl* p_orig, func_decl* p) {
|
||||
pred_transformer* pt = 0;
|
||||
pred_transformer* pt = nullptr;
|
||||
if (m_rels.find(p, pt)) {
|
||||
return pt->get_cover_delta(p_orig, level);
|
||||
}
|
||||
|
@ -1583,7 +1583,7 @@ namespace pdr {
|
|||
}
|
||||
|
||||
void context::add_cover(int level, func_decl* p, expr* property) {
|
||||
pred_transformer* pt = 0;
|
||||
pred_transformer* pt = nullptr;
|
||||
if (!m_rels.find(p, pt)) {
|
||||
pt = alloc(pred_transformer, *this, get_pdr_manager(), p);
|
||||
m_rels.insert(p, pt);
|
||||
|
@ -2026,7 +2026,7 @@ namespace pdr {
|
|||
//
|
||||
bool context::check_reachability(unsigned level) {
|
||||
expr_ref state(m.mk_true(), m);
|
||||
model_node* root = alloc(model_node, 0, state, *m_query, level);
|
||||
model_node* root = alloc(model_node, nullptr, state, *m_query, level);
|
||||
m_search.set_root(root);
|
||||
|
||||
while (model_node* node = m_search.next()) {
|
||||
|
@ -2403,7 +2403,7 @@ namespace pdr {
|
|||
if (m_params.print_boogie_certificate()) {
|
||||
datalog::boogie_proof bp(m);
|
||||
bp.set_proof(get_proof());
|
||||
bp.set_model(0);
|
||||
bp.set_model(nullptr);
|
||||
bp.pp(strm);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -143,7 +143,7 @@ namespace pdr {
|
|||
void add_property(expr * lemma, unsigned lvl); // add property 'p' to state at level.
|
||||
|
||||
lbool is_reachable(model_node& n, expr_ref_vector* core, bool& uses_level);
|
||||
bool is_invariant(unsigned level, expr* co_state, bool inductive, bool& assumes_level, expr_ref_vector* core = 0);
|
||||
bool is_invariant(unsigned level, expr* co_state, bool inductive, bool& assumes_level, expr_ref_vector* core = nullptr);
|
||||
bool check_inductive(unsigned level, expr_ref_vector& state, bool& assumes_level);
|
||||
|
||||
expr_ref get_formulas(unsigned level, bool add_axioms);
|
||||
|
@ -199,8 +199,8 @@ namespace pdr {
|
|||
datalog::rule const* m_rule;
|
||||
public:
|
||||
model_node(model_node* parent, expr_ref& state, pred_transformer& pt, unsigned level):
|
||||
m_parent(parent), m_next(0), m_prev(0), m_pt(pt), m_state(state), m_model(0),
|
||||
m_level(level), m_orig_level(level), m_depth(0), m_closed(false), m_rule(0) {
|
||||
m_parent(parent), m_next(nullptr), m_prev(nullptr), m_pt(pt), m_state(state), m_model(nullptr),
|
||||
m_level(level), m_orig_level(level), m_depth(0), m_closed(false), m_rule(nullptr) {
|
||||
model_node* p = m_parent;
|
||||
if (p) {
|
||||
p->m_children.push_back(this);
|
||||
|
@ -253,7 +253,7 @@ namespace pdr {
|
|||
void dequeue(model_node*& root);
|
||||
void enqueue(model_node* n);
|
||||
model_node* next() const { return m_next; }
|
||||
bool is_goal() const { return 0 != next(); }
|
||||
bool is_goal() const { return nullptr != next(); }
|
||||
};
|
||||
|
||||
class model_search {
|
||||
|
@ -271,7 +271,7 @@ namespace pdr {
|
|||
unsigned num_goals() const;
|
||||
|
||||
public:
|
||||
model_search(bool bfs): m_bfs(bfs), m_root(0), m_goal(0) {}
|
||||
model_search(bool bfs): m_bfs(bfs), m_root(nullptr), m_goal(nullptr) {}
|
||||
~model_search();
|
||||
|
||||
void reset();
|
||||
|
|
|
@ -38,7 +38,7 @@ dl_interface::dl_interface(datalog::context& ctx) :
|
|||
m_ctx(ctx),
|
||||
m_pdr_rules(ctx),
|
||||
m_old_rules(ctx),
|
||||
m_context(0),
|
||||
m_context(nullptr),
|
||||
m_refs(ctx.get_manager()) {
|
||||
m_context = alloc(pdr::context, ctx.get_fparams(), ctx.get_params(), ctx.get_manager());
|
||||
}
|
||||
|
|
|
@ -373,7 +373,7 @@ namespace pdr {
|
|||
farkas_learner::farkas_learner(smt_params& params, ast_manager& outer_mgr)
|
||||
: m_proof_params(get_proof_params(params)),
|
||||
m_pr(PGM_ENABLED),
|
||||
m_constr(0),
|
||||
m_constr(nullptr),
|
||||
m_combine_farkas_coefficients(true),
|
||||
p2o(m_pr, outer_mgr),
|
||||
o2p(outer_mgr, m_pr)
|
||||
|
|
|
@ -189,7 +189,7 @@ namespace pdr {
|
|||
expr_ref fml1 = mk_and(core);
|
||||
expr_ref fml2 = n.pt().get_formulas(n.level(), false);
|
||||
fml1_2.push_back(fml1);
|
||||
fml1_2.push_back(0);
|
||||
fml1_2.push_back(nullptr);
|
||||
flatten_and(fml2, fmls);
|
||||
for (unsigned i = 0; i < fmls.size(); ++i) {
|
||||
fml2 = m.mk_not(fmls[i].get());
|
||||
|
@ -199,7 +199,7 @@ namespace pdr {
|
|||
tout << "Check states:\n" << mk_pp(state, m) << "\n";
|
||||
tout << "Old states:\n" << mk_pp(fml2, m) << "\n";
|
||||
);
|
||||
model_node nd(0, state, n.pt(), n.level());
|
||||
model_node nd(nullptr, state, n.pt(), n.level());
|
||||
pred_transformer::scoped_farkas sf(n.pt(), true);
|
||||
bool uses_level1 = uses_level;
|
||||
if (l_false == n.pt().is_reachable(nd, &conv2, uses_level1)) {
|
||||
|
@ -236,7 +236,7 @@ namespace pdr {
|
|||
n.pt().get_solver().set_consequences(&consequences);
|
||||
pred_transformer::scoped_farkas sf (n.pt(), true);
|
||||
VERIFY(l_false == n.pt().is_reachable(n, &core1, uses_level1));
|
||||
n.pt().get_solver().set_consequences(0);
|
||||
n.pt().get_solver().set_consequences(nullptr);
|
||||
}
|
||||
IF_VERBOSE(0,
|
||||
verbose_stream() << "Consequences: " << consequences.size() << "\n";
|
||||
|
@ -257,7 +257,7 @@ namespace pdr {
|
|||
cstate.push_back(m.mk_not(consequences[i].get()));
|
||||
}
|
||||
tmp = m.mk_and(cstate.size(), cstate.c_ptr());
|
||||
model_node nd(0, tmp, n.pt(), n.level());
|
||||
model_node nd(nullptr, tmp, n.pt(), n.level());
|
||||
pred_transformer::scoped_farkas sf (n.pt(), false);
|
||||
VERIFY(l_false == n.pt().is_reachable(nd, &core1, uses_level1));
|
||||
}
|
||||
|
@ -752,7 +752,7 @@ namespace pdr {
|
|||
//
|
||||
void core_induction_generalizer::operator()(model_node& n, expr_ref_vector& core, bool& uses_level) {
|
||||
model_node* p = n.parent();
|
||||
if (p == 0) {
|
||||
if (p == nullptr) {
|
||||
return;
|
||||
}
|
||||
unsigned depth = 2;
|
||||
|
|
|
@ -289,7 +289,7 @@ namespace pdr {
|
|||
|
||||
bg is background knowledge and can be null
|
||||
*/
|
||||
bool implication_surely_holds(expr * lhs, expr * rhs, expr * bg=0);
|
||||
bool implication_surely_holds(expr * lhs, expr * rhs, expr * bg=nullptr);
|
||||
|
||||
unsigned get_unique_num() { return m_next_unique_num++; }
|
||||
|
||||
|
|
|
@ -234,9 +234,9 @@ namespace pdr {
|
|||
m_pos_level_atoms(m),
|
||||
m_neg_level_atoms(m),
|
||||
m_proxies(m),
|
||||
m_core(0),
|
||||
m_model(0),
|
||||
m_consequences(0),
|
||||
m_core(nullptr),
|
||||
m_model(nullptr),
|
||||
m_consequences(nullptr),
|
||||
m_subset_based_core(false),
|
||||
m_use_farkas(false),
|
||||
m_in_level(false),
|
||||
|
@ -249,7 +249,7 @@ namespace pdr {
|
|||
unsigned idx = level_cnt();
|
||||
std::stringstream name;
|
||||
name << m_name << "#level_" << idx;
|
||||
func_decl * lev_pred = m.mk_fresh_func_decl(name.str().c_str(), 0, 0,m.mk_bool_sort());
|
||||
func_decl * lev_pred = m.mk_fresh_func_decl(name.str().c_str(), 0, nullptr,m.mk_bool_sort());
|
||||
m_aux_symbols.insert(lev_pred);
|
||||
m_level_preds.push_back(lev_pred);
|
||||
|
||||
|
@ -301,7 +301,7 @@ namespace pdr {
|
|||
safe_assumptions& safe,
|
||||
const expr_ref_vector& atoms)
|
||||
{
|
||||
flet<bool> _model(m_fparams.m_model, m_model != 0);
|
||||
flet<bool> _model(m_fparams.m_model, m_model != nullptr);
|
||||
expr_ref_vector expr_atoms(m);
|
||||
expr_atoms.append(atoms.size(), atoms.c_ptr());
|
||||
|
||||
|
@ -342,8 +342,8 @@ namespace pdr {
|
|||
extract_subset_core(safe);
|
||||
SASSERT(expr_atoms.size() >= m_core->size());
|
||||
}
|
||||
m_core = 0;
|
||||
m_model = 0;
|
||||
m_core = nullptr;
|
||||
m_model = nullptr;
|
||||
m_subset_based_core = false;
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace pdr {
|
|||
reachable_cache::reachable_cache(pdr::manager & pm, datalog::PDR_CACHE_MODE cm)
|
||||
: m(pm.get_manager()),
|
||||
m_pm(pm),
|
||||
m_ctx(0),
|
||||
m_ctx(nullptr),
|
||||
m_ref_holder(m),
|
||||
m_disj_connector(m),
|
||||
m_cache_mode(cm) {
|
||||
|
|
|
@ -130,7 +130,7 @@ namespace pdr {
|
|||
smt_context* smt_context_manager::mk_fresh() {
|
||||
++m_num_contexts;
|
||||
app_ref pred(m);
|
||||
smt::kernel * ctx = 0;
|
||||
smt::kernel * ctx = nullptr;
|
||||
if (m_max_num_contexts == 0) {
|
||||
m_contexts.push_back(alloc(smt::kernel, m, m_fparams));
|
||||
pred = m.mk_true();
|
||||
|
|
|
@ -122,7 +122,7 @@ public:
|
|||
func_decl * try_get_primary_by_prefix(func_decl* prefix) const {
|
||||
func_decl * res;
|
||||
if(!m_prefix2prim.find(prefix, res)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ public:
|
|||
func_decl * try_get_by_prefix(func_decl* prefix, unsigned idx) {
|
||||
func_decl * prim = try_get_primary_by_prefix(prefix);
|
||||
if(!prim) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return conv(prim, 0, idx);
|
||||
}
|
||||
|
|
|
@ -244,7 +244,7 @@ namespace pdr {
|
|||
}
|
||||
|
||||
bool test_eq(expr* e) const {
|
||||
expr* lhs = 0, *rhs = 0;
|
||||
expr* lhs = nullptr, *rhs = nullptr;
|
||||
VERIFY(m.is_eq(e, lhs, rhs));
|
||||
if (!a.is_int_real(lhs)) {
|
||||
return true;
|
||||
|
|
|
@ -118,7 +118,7 @@ namespace datalog {
|
|||
}
|
||||
|
||||
exprs.reset();
|
||||
assert_pred_id(numqs ? r->get_tail(0)->get_decl() : 0, m_ruleid_var_set, exprs);
|
||||
assert_pred_id(numqs ? r->get_tail(0)->get_decl() : nullptr, m_ruleid_var_set, exprs);
|
||||
assert_pred_id(r->get_head()->get_decl(), m_ruleid_varp_set, exprs);
|
||||
|
||||
subst.reset();
|
||||
|
@ -141,7 +141,7 @@ namespace datalog {
|
|||
if (m_facts) {
|
||||
for (fact_vector::const_iterator I = m_facts->begin(), E = m_facts->end(); I != E; ++I) {
|
||||
exprs.reset();
|
||||
assert_pred_id(0, m_ruleid_var_set, exprs);
|
||||
assert_pred_id(nullptr, m_ruleid_var_set, exprs);
|
||||
assert_pred_id(I->first, m_ruleid_varp_set, exprs);
|
||||
|
||||
for (unsigned i = 0; i < I->second.size(); ++i) {
|
||||
|
|
|
@ -23,7 +23,7 @@ Abstract:
|
|||
namespace datalog {
|
||||
class aig_exporter {
|
||||
public:
|
||||
aig_exporter(const rule_set& rules, context& ctx, const fact_vector *facts = 0);
|
||||
aig_exporter(const rule_set& rules, context& ctx, const fact_vector *facts = nullptr);
|
||||
void operator()(std::ostream& out);
|
||||
|
||||
private:
|
||||
|
@ -60,7 +60,7 @@ namespace datalog {
|
|||
unsigned mk_or(unsigned id1, unsigned id2);
|
||||
unsigned get_var(const expr *e);
|
||||
unsigned mk_var(const expr *e);
|
||||
unsigned mk_input_var(const expr *e = 0);
|
||||
unsigned mk_input_var(const expr *e = nullptr);
|
||||
unsigned mk_expr_id();
|
||||
};
|
||||
}
|
||||
|
|
|
@ -150,7 +150,7 @@ namespace datalog {
|
|||
check_relation_plugin::check_relation_plugin(relation_manager& rm):
|
||||
relation_plugin(check_relation_plugin::get_name(), rm),
|
||||
m(rm.get_context().get_manager()),
|
||||
m_base(0) {
|
||||
m_base(nullptr) {
|
||||
}
|
||||
check_relation_plugin::~check_relation_plugin() {
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ namespace datalog {
|
|||
return dynamic_cast<check_relation&>(r);
|
||||
}
|
||||
check_relation* check_relation_plugin::get(relation_base* r) {
|
||||
return r?dynamic_cast<check_relation*>(r):0;
|
||||
return r?dynamic_cast<check_relation*>(r):nullptr;
|
||||
}
|
||||
check_relation const & check_relation_plugin::get(relation_base const& r) {
|
||||
return dynamic_cast<check_relation const&>(r);
|
||||
|
@ -207,7 +207,7 @@ namespace datalog {
|
|||
const relation_base & t1, const relation_base & t2,
|
||||
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) {
|
||||
relation_join_fn* j = m_base->mk_join_fn(get(t1).rb(), get(t2).rb(), col_cnt, cols1, cols2);
|
||||
return j?alloc(join_fn, j, t1.get_signature(), t2.get_signature(), col_cnt, cols1, cols2):0;
|
||||
return j?alloc(join_fn, j, t1.get_signature(), t2.get_signature(), col_cnt, cols1, cols2):nullptr;
|
||||
}
|
||||
|
||||
class check_relation_plugin::join_project_fn : public convenient_relation_join_project_fn {
|
||||
|
@ -239,7 +239,7 @@ namespace datalog {
|
|||
relation_join_fn* j = m_base->mk_join_project_fn(get(t1).rb(), get(t2).rb(), col_cnt, cols1, cols2,
|
||||
removed_col_cnt, removed_cols);
|
||||
return j?alloc(join_project_fn, j, t1.get_signature(), t2.get_signature(), col_cnt, cols1, cols2,
|
||||
removed_col_cnt, removed_cols):0;
|
||||
removed_col_cnt, removed_cols):nullptr;
|
||||
}
|
||||
|
||||
void check_relation_plugin::verify_filter_project(
|
||||
|
@ -499,8 +499,8 @@ namespace datalog {
|
|||
expr_ref fml0 = r.m_fml;
|
||||
expr_ref delta0(r.m_fml.get_manager());
|
||||
if (d) d->to_formula(delta0);
|
||||
(*m_union)(r.rb(), src.rb(), d?(&d->rb()):0);
|
||||
r.get_plugin().verify_union(fml0, src.rb(), r.rb(), delta0, d?(&d->rb()):0);
|
||||
(*m_union)(r.rb(), src.rb(), d?(&d->rb()):nullptr);
|
||||
r.get_plugin().verify_union(fml0, src.rb(), r.rb(), delta0, d?(&d->rb()):nullptr);
|
||||
r.rb().to_formula(r.m_fml);
|
||||
if (d) d->rb().to_formula(d->m_fml);
|
||||
}
|
||||
|
@ -508,16 +508,16 @@ namespace datalog {
|
|||
relation_union_fn * check_relation_plugin::mk_union_fn(
|
||||
const relation_base & tgt, const relation_base & src,
|
||||
const relation_base * delta) {
|
||||
relation_base const* d1 = delta?(&(get(*delta).rb())):0;
|
||||
relation_base const* d1 = delta?(&(get(*delta).rb())):nullptr;
|
||||
relation_union_fn* u = m_base->mk_union_fn(get(tgt).rb(), get(src).rb(), d1);
|
||||
return u?alloc(union_fn, u):0;
|
||||
return u?alloc(union_fn, u):nullptr;
|
||||
}
|
||||
relation_union_fn * check_relation_plugin::mk_widen_fn(
|
||||
const relation_base & tgt, const relation_base & src,
|
||||
const relation_base * delta) {
|
||||
relation_base const* d1 = delta?(&(get(*delta).rb())):0;
|
||||
relation_base const* d1 = delta?(&(get(*delta).rb())):nullptr;
|
||||
relation_union_fn* u = m_base->mk_widen_fn(get(tgt).rb(), get(src).rb(), d1);
|
||||
return u?alloc(union_fn, u):0;
|
||||
return u?alloc(union_fn, u):nullptr;
|
||||
}
|
||||
|
||||
class check_relation_plugin::filter_identical_fn : public relation_mutator_fn {
|
||||
|
@ -553,7 +553,7 @@ namespace datalog {
|
|||
relation_mutator_fn * check_relation_plugin::mk_filter_identical_fn(
|
||||
const relation_base & t, unsigned col_cnt, const unsigned * identical_cols) {
|
||||
relation_mutator_fn* r = m_base->mk_filter_identical_fn(get(t).rb(), col_cnt, identical_cols);
|
||||
return r?alloc(filter_identical_fn, r, col_cnt, identical_cols):0;
|
||||
return r?alloc(filter_identical_fn, r, col_cnt, identical_cols):nullptr;
|
||||
}
|
||||
|
||||
class check_relation_plugin::filter_interpreted_fn : public relation_mutator_fn {
|
||||
|
@ -579,7 +579,7 @@ namespace datalog {
|
|||
relation_mutator_fn * check_relation_plugin::mk_filter_interpreted_fn(const relation_base & t, app * condition) {
|
||||
relation_mutator_fn* r = m_base->mk_filter_interpreted_fn(get(t).rb(), condition);
|
||||
app_ref cond(condition, m);
|
||||
return r?alloc(filter_interpreted_fn, r, cond):0;
|
||||
return r?alloc(filter_interpreted_fn, r, cond):nullptr;
|
||||
}
|
||||
|
||||
class check_relation_plugin::project_fn : public convenient_relation_project_fn {
|
||||
|
@ -608,7 +608,7 @@ namespace datalog {
|
|||
const relation_base & t, unsigned col_cnt,
|
||||
const unsigned * removed_cols) {
|
||||
relation_transformer_fn* p = m_base->mk_project_fn(get(t).rb(), col_cnt, removed_cols);
|
||||
return p?alloc(project_fn, p, t, col_cnt, removed_cols):0;
|
||||
return p?alloc(project_fn, p, t, col_cnt, removed_cols):nullptr;
|
||||
}
|
||||
|
||||
class check_relation_plugin::rename_fn : public convenient_relation_rename_fn {
|
||||
|
@ -635,7 +635,7 @@ namespace datalog {
|
|||
const relation_base & r,
|
||||
unsigned cycle_len, const unsigned * permutation_cycle) {
|
||||
relation_transformer_fn* p = m_base->mk_rename_fn(get(r).rb(), cycle_len, permutation_cycle);
|
||||
return p?alloc(rename_fn, p, r, cycle_len, permutation_cycle):0;
|
||||
return p?alloc(rename_fn, p, r, cycle_len, permutation_cycle):nullptr;
|
||||
}
|
||||
|
||||
class check_relation_plugin::filter_equal_fn : public relation_mutator_fn {
|
||||
|
@ -663,7 +663,7 @@ namespace datalog {
|
|||
relation_mutator_fn * check_relation_plugin::mk_filter_equal_fn(
|
||||
const relation_base & t, const relation_element & value, unsigned col) {
|
||||
relation_mutator_fn* r = m_base->mk_filter_equal_fn(get(t).rb(), value, col);
|
||||
return r?alloc(filter_equal_fn, r, t, value, col):0;
|
||||
return r?alloc(filter_equal_fn, r, t, value, col):nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
@ -700,7 +700,7 @@ namespace datalog {
|
|||
const relation_base& neg, unsigned joined_col_cnt, const unsigned *t_cols,
|
||||
const unsigned *negated_cols) {
|
||||
relation_intersection_filter_fn* f = m_base->mk_filter_by_negation_fn(get(t).rb(), get(neg).rb(), joined_col_cnt, t_cols, negated_cols);
|
||||
return f?alloc(negation_filter_fn, f, joined_col_cnt, t_cols, negated_cols):0;
|
||||
return f?alloc(negation_filter_fn, f, joined_col_cnt, t_cols, negated_cols):nullptr;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -779,7 +779,7 @@ namespace datalog {
|
|||
unsigned removed_col_cnt, const unsigned * removed_cols) {
|
||||
relation_transformer_fn* r = m_base->mk_filter_interpreted_and_project_fn(get(t).rb(), condition, removed_col_cnt, removed_cols);
|
||||
app_ref cond(condition, m);
|
||||
return r?alloc(filter_proj_fn, r, t, cond, removed_col_cnt, removed_cols):0;
|
||||
return r?alloc(filter_proj_fn, r, t, cond, removed_col_cnt, removed_cols):nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ namespace datalog {
|
|||
ast_manager & m = renaming_arg.get_manager();
|
||||
unsigned sz = map.size();
|
||||
unsigned ofs = sz-1;
|
||||
renaming_arg.resize(sz, static_cast<expr *>(0));
|
||||
renaming_arg.resize(sz, static_cast<expr *>(nullptr));
|
||||
for(unsigned i=0; i<sz; i++) {
|
||||
if(map[i]!=UINT_MAX) {
|
||||
renaming_arg.set(ofs-i, m.mk_var(map[i], orig_sig[i]));
|
||||
|
@ -127,7 +127,7 @@ namespace datalog {
|
|||
|
||||
unsigned func_cnt = src.functional_columns();
|
||||
|
||||
if(removed_cols==0) {
|
||||
if(removed_cols==nullptr) {
|
||||
result.set_functional_columns(func_cnt);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -41,20 +41,20 @@ namespace datalog {
|
|||
public:
|
||||
scoped_rel(T* t) : m_t(t) {}
|
||||
~scoped_rel() { if (m_t) { universal_delete(m_t); } }
|
||||
scoped_rel() : m_t(0) {}
|
||||
scoped_rel() : m_t(nullptr) {}
|
||||
scoped_rel& operator=(T* t) { if (m_t && t != m_t) { universal_delete(m_t); } m_t = t; return *this; }
|
||||
T* operator->() { return m_t; }
|
||||
const T* operator->() const { return m_t; }
|
||||
T& operator*() { return *m_t; }
|
||||
const T& operator*() const { return *m_t; }
|
||||
operator bool() const { return m_t!=0; }
|
||||
operator bool() const { return m_t!=nullptr; }
|
||||
T* get() const { return m_t; }
|
||||
/**
|
||||
\brief Remove object from \c scoped_rel without deleting it.
|
||||
*/
|
||||
T* release() {
|
||||
T* res = m_t;
|
||||
m_t = 0;
|
||||
m_t = nullptr;
|
||||
return res;
|
||||
}
|
||||
};
|
||||
|
@ -202,7 +202,7 @@ namespace datalog {
|
|||
virtual void operator()(base_object & tgt, const base_object & src, base_object * delta) = 0;
|
||||
|
||||
void operator()(base_object & tgt, const base_object & src) {
|
||||
(*this)(tgt, src, static_cast<base_object *>(0));
|
||||
(*this)(tgt, src, static_cast<base_object *>(nullptr));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -335,55 +335,55 @@ namespace datalog {
|
|||
|
||||
|
||||
virtual join_fn * mk_join_fn(const base_object & t1, const base_object & t2,
|
||||
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) { return 0; }
|
||||
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) { return nullptr; }
|
||||
|
||||
virtual transformer_fn * mk_project_fn(const base_object & t, unsigned col_cnt,
|
||||
const unsigned * removed_cols) { return 0; }
|
||||
const unsigned * removed_cols) { return nullptr; }
|
||||
|
||||
virtual join_fn * mk_join_project_fn(const base_object & t1, const base_object & t2,
|
||||
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) { return nullptr; }
|
||||
|
||||
virtual transformer_fn * mk_rename_fn(const base_object & t, unsigned permutation_cycle_len,
|
||||
const unsigned * permutation_cycle) { return 0; }
|
||||
const unsigned * permutation_cycle) { return nullptr; }
|
||||
|
||||
virtual transformer_fn * mk_permutation_rename_fn(const base_object & t,
|
||||
const unsigned * permutation) { return 0; }
|
||||
const unsigned * permutation) { return nullptr; }
|
||||
|
||||
public:
|
||||
virtual union_fn * mk_union_fn(const base_object & tgt, const base_object & src,
|
||||
const base_object * delta) { return 0; }
|
||||
const base_object * delta) { return nullptr; }
|
||||
protected:
|
||||
|
||||
virtual union_fn * mk_widen_fn(const base_object & tgt, const base_object & src,
|
||||
const base_object * delta) { return 0; }
|
||||
const base_object * delta) { return nullptr; }
|
||||
|
||||
virtual mutator_fn * mk_filter_identical_fn(const base_object & t, unsigned col_cnt,
|
||||
const unsigned * identical_cols) { return 0; }
|
||||
const unsigned * identical_cols) { return nullptr; }
|
||||
|
||||
virtual mutator_fn * mk_filter_equal_fn(const base_object & t, const element & value,
|
||||
unsigned col) { return 0; }
|
||||
unsigned col) { return nullptr; }
|
||||
|
||||
virtual mutator_fn * mk_filter_interpreted_fn(const base_object & t, app * condition)
|
||||
{ return 0; }
|
||||
{ return nullptr; }
|
||||
|
||||
virtual transformer_fn * mk_filter_interpreted_and_project_fn(const base_object & t,
|
||||
app * condition, unsigned removed_col_cnt, const unsigned * removed_cols)
|
||||
{ return 0; }
|
||||
{ return nullptr; }
|
||||
|
||||
virtual transformer_fn * mk_select_equal_and_project_fn(const base_object & t,
|
||||
const element & value, unsigned col) { return 0; }
|
||||
const element & value, unsigned col) { return nullptr; }
|
||||
|
||||
virtual intersection_filter_fn * mk_filter_by_intersection_fn(const base_object & t,
|
||||
const base_object & src, unsigned joined_col_cnt,
|
||||
const unsigned * t_cols, const unsigned * src_cols)
|
||||
{ return 0; }
|
||||
{ return nullptr; }
|
||||
|
||||
|
||||
virtual intersection_filter_fn * mk_filter_by_negation_fn(const base_object & t,
|
||||
const base_object & negated_obj, unsigned joined_col_cnt,
|
||||
const unsigned * t_cols, const unsigned * negated_cols)
|
||||
{ return 0; }
|
||||
{ return nullptr; }
|
||||
|
||||
virtual intersection_join_filter_fn * mk_filter_by_negated_join_fn(
|
||||
const base_object & t,
|
||||
|
@ -393,7 +393,7 @@ namespace datalog {
|
|||
unsigned_vector const& src_cols,
|
||||
unsigned_vector const& src1_cols,
|
||||
unsigned_vector const& src2_cols)
|
||||
{ return 0; }
|
||||
{ return nullptr; }
|
||||
|
||||
};
|
||||
|
||||
|
@ -1029,14 +1029,14 @@ namespace datalog {
|
|||
If the returned value is non-zero, the returned object must take ownership of \c mapper.
|
||||
Otherwise \c mapper must remain unmodified.
|
||||
*/
|
||||
virtual table_mutator_fn * mk_map_fn(const table_base & t, table_row_mutator_fn * mapper) { return 0; }
|
||||
virtual table_mutator_fn * mk_map_fn(const table_base & t, table_row_mutator_fn * mapper) { return nullptr; }
|
||||
|
||||
/**
|
||||
If the returned value is non-zero, the returned object must take ownership of \c reducer.
|
||||
Otherwise \c reducer must remain unmodified.
|
||||
*/
|
||||
virtual table_transformer_fn * mk_project_with_reduce_fn(const table_base & t, unsigned col_cnt,
|
||||
const unsigned * removed_cols, table_row_pair_reduce_fn * reducer) { return 0; }
|
||||
const unsigned * removed_cols, table_row_pair_reduce_fn * reducer) { return nullptr; }
|
||||
|
||||
};
|
||||
|
||||
|
@ -1047,7 +1047,7 @@ namespace datalog {
|
|||
~table_base() override {}
|
||||
public:
|
||||
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 = nullptr) const;
|
||||
bool empty() const override;
|
||||
|
||||
/**
|
||||
|
|
|
@ -83,7 +83,7 @@ namespace datalog {
|
|||
bound_relation const& r1 = get(_r1);
|
||||
bound_relation const& r2 = get(_r2);
|
||||
bound_relation_plugin& p = r1.get_plugin();
|
||||
bound_relation* result = dynamic_cast<bound_relation*>(p.mk_full(0, get_result_signature()));
|
||||
bound_relation* result = dynamic_cast<bound_relation*>(p.mk_full(nullptr, get_result_signature()));
|
||||
result->mk_join(r1, r2, m_cols1.size(), m_cols1.c_ptr(), m_cols2.c_ptr());
|
||||
return result;
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ namespace datalog {
|
|||
relation_join_fn * bound_relation_plugin::mk_join_fn(const relation_base & r1, const relation_base & r2,
|
||||
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) {
|
||||
if (!check_kind(r1) || !check_kind(r2)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(join_fn, r1.get_signature(), r2.get_signature(), col_cnt, cols1, cols2);
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ namespace datalog {
|
|||
relation_base * operator()(const relation_base & _r) override {
|
||||
bound_relation const& r = get(_r);
|
||||
bound_relation_plugin& p = r.get_plugin();
|
||||
bound_relation* result = get(p.mk_full(0, get_result_signature()));
|
||||
bound_relation* result = get(p.mk_full(nullptr, get_result_signature()));
|
||||
result->mk_project(r, m_removed_cols.size(), m_removed_cols.c_ptr());
|
||||
return result;
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ namespace datalog {
|
|||
relation_base * operator()(const relation_base & _r) override {
|
||||
bound_relation const& r = get(_r);
|
||||
bound_relation_plugin& p = r.get_plugin();
|
||||
bound_relation* result = get(p.mk_full(0, get_result_signature()));
|
||||
bound_relation* result = get(p.mk_full(nullptr, get_result_signature()));
|
||||
result->mk_rename(r, m_cycle.size(), m_cycle.c_ptr());
|
||||
return result;
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ namespace datalog {
|
|||
if(check_kind(r)) {
|
||||
return alloc(rename_fn, r.get_signature(), cycle_len, permutation_cycle);
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
@ -176,7 +176,7 @@ namespace datalog {
|
|||
if (check_kind(tgt) && check_kind(src) && (!delta || check_kind(*delta))) {
|
||||
return alloc(union_fn, false);
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
relation_union_fn * bound_relation_plugin::mk_widen_fn(
|
||||
|
@ -188,7 +188,7 @@ namespace datalog {
|
|||
if (check_kind(tgt) && check_kind(src) && (!delta || check_kind(*delta))) {
|
||||
return alloc(union_fn, true);
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
class bound_relation_plugin::filter_identical_fn : public relation_mutator_fn {
|
||||
|
@ -209,7 +209,7 @@ namespace datalog {
|
|||
if(check_kind(t)) {
|
||||
return alloc(filter_identical_fn, col_cnt, identical_cols);
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
class bound_relation_plugin::filter_equal_fn : public relation_mutator_fn {
|
||||
|
@ -224,7 +224,7 @@ namespace datalog {
|
|||
if (check_kind(r)) {
|
||||
return alloc(filter_equal_fn, value, col);
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
class bound_relation_plugin::filter_interpreted_fn : public relation_mutator_fn {
|
||||
|
@ -280,7 +280,7 @@ namespace datalog {
|
|||
|
||||
filter_interpreted_fn(ast_manager& m, app* cond) :
|
||||
m_cond(cond, m),
|
||||
m_lt(m), m_arith(m), m_interval(0), m_kind(NOT_APPLICABLE) {
|
||||
m_lt(m), m_arith(m), m_interval(nullptr), m_kind(NOT_APPLICABLE) {
|
||||
expr* l, *r, *r1, *r2, *c2;
|
||||
rational n1;
|
||||
if ((m_arith.is_lt(cond, l, r) || m_arith.is_gt(cond, r, l)) &&
|
||||
|
@ -592,7 +592,7 @@ namespace datalog {
|
|||
scoped_ptr<relation_mutator_fn> fe = get_plugin().mk_filter_equal_fn(r, f[i], i);
|
||||
(*fe)(r);
|
||||
}
|
||||
mk_union(r, 0, false);
|
||||
mk_union(r, nullptr, false);
|
||||
}
|
||||
|
||||
bool bound_relation::contains_fact(const relation_fact & f) const {
|
||||
|
@ -604,12 +604,12 @@ namespace datalog {
|
|||
}
|
||||
|
||||
bound_relation * bound_relation::clone() const {
|
||||
bound_relation* result = 0;
|
||||
bound_relation* result = nullptr;
|
||||
if (empty()) {
|
||||
result = bound_relation_plugin::get(get_plugin().mk_empty(get_signature()));
|
||||
}
|
||||
else {
|
||||
result = bound_relation_plugin::get(get_plugin().mk_full(0, get_signature()));
|
||||
result = bound_relation_plugin::get(get_plugin().mk_full(nullptr, get_signature()));
|
||||
result->copy(*this);
|
||||
}
|
||||
return result;
|
||||
|
@ -647,7 +647,7 @@ namespace datalog {
|
|||
|
||||
bound_relation * bound_relation::complement(func_decl* p) const {
|
||||
UNREACHABLE();
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void bound_relation::to_formula(expr_ref& fml) const {
|
||||
|
|
|
@ -69,7 +69,7 @@ namespace datalog {
|
|||
|
||||
relation_join_fn * mk_join_project_fn(const relation_base & t1, const relation_base & t2,
|
||||
unsigned joined_col_cnt, const unsigned * cols1, const unsigned * cols2,
|
||||
unsigned removed_col_cnt, const unsigned * removed_cols) override { return 0; }
|
||||
unsigned removed_col_cnt, const unsigned * removed_cols) override { return nullptr; }
|
||||
|
||||
|
||||
#if 0
|
||||
|
|
|
@ -40,12 +40,12 @@ namespace datalog {
|
|||
|
||||
table_base& check_table_plugin::checker(table_base& r) { return *get(r).m_checker; }
|
||||
table_base const& check_table_plugin::checker(table_base const& r) { return *get(r).m_checker; }
|
||||
table_base* check_table_plugin::checker(table_base* r) { return r?(get(*r).m_checker):0; }
|
||||
table_base const* check_table_plugin::checker(table_base const* r) { return r?(get(*r).m_checker):0; }
|
||||
table_base* check_table_plugin::checker(table_base* r) { return r?(get(*r).m_checker):nullptr; }
|
||||
table_base const* check_table_plugin::checker(table_base const* r) { return r?(get(*r).m_checker):nullptr; }
|
||||
table_base& check_table_plugin::tocheck(table_base& r) { return *get(r).m_tocheck; }
|
||||
table_base const& check_table_plugin::tocheck(table_base const& r) { return *get(r).m_tocheck; }
|
||||
table_base* check_table_plugin::tocheck(table_base* r) { return r?(get(*r).m_tocheck):0; }
|
||||
table_base const* check_table_plugin::tocheck(table_base const* r) { return r?(get(*r).m_tocheck):0; }
|
||||
table_base* check_table_plugin::tocheck(table_base* r) { return r?(get(*r).m_tocheck):nullptr; }
|
||||
table_base const* check_table_plugin::tocheck(table_base const* r) { return r?(get(*r).m_tocheck):nullptr; }
|
||||
|
||||
table_base * check_table_plugin::mk_empty(const table_signature & s) {
|
||||
IF_VERBOSE(1, verbose_stream() << __FUNCTION__ << "\n";);
|
||||
|
@ -77,7 +77,7 @@ namespace datalog {
|
|||
table_join_fn * check_table_plugin::mk_join_fn(const table_base & t1, const table_base & t2,
|
||||
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) {
|
||||
if (!check_kind(t1) || !check_kind(t2)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(join_fn, *this, t1, t2, col_cnt, cols1, cols2);
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ namespace datalog {
|
|||
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2, unsigned removed_col_cnt,
|
||||
const unsigned * removed_cols) {
|
||||
if (!check_kind(t1) || !check_kind(t2)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(join_project_fn, *this, t1, t2, col_cnt, cols1, cols2, removed_col_cnt, removed_cols);
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ namespace datalog {
|
|||
|
||||
table_union_fn * check_table_plugin::mk_union_fn(const table_base & tgt, const table_base & src, const table_base * delta) {
|
||||
if (!check_kind(tgt) || !check_kind(src) || (delta && !check_kind(*delta))) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(union_fn, *this, tgt, src, delta);
|
||||
|
||||
|
@ -157,7 +157,7 @@ namespace datalog {
|
|||
|
||||
table_transformer_fn * check_table_plugin::mk_project_fn(const table_base & t, unsigned col_cnt, const unsigned * removed_cols) {
|
||||
if (!check_kind(t)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(project_fn, *this, t, col_cnt, removed_cols);
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ namespace datalog {
|
|||
table_transformer_fn * check_table_plugin::mk_select_equal_and_project_fn(const table_base & t,
|
||||
const table_element & value, unsigned col) {
|
||||
if (!check_kind(t)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(select_equal_and_project_fn, *this, t, value, col);
|
||||
}
|
||||
|
@ -207,7 +207,7 @@ namespace datalog {
|
|||
|
||||
table_transformer_fn * check_table_plugin::mk_rename_fn(const table_base & t, unsigned len, const unsigned * cycle) {
|
||||
if (!check_kind(t)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(rename_fn, *this, t, len, cycle);
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ namespace datalog {
|
|||
if (check_kind(t)) {
|
||||
return alloc(filter_identical_fn, *this, t, col_cnt, identical_cols);
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
class check_table_plugin::filter_equal_fn : public table_mutator_fn {
|
||||
|
@ -258,7 +258,7 @@ namespace datalog {
|
|||
if (check_kind(t)) {
|
||||
return alloc(filter_equal_fn, *this, t, value, col);
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
class check_table_plugin::filter_interpreted_fn : public table_mutator_fn {
|
||||
|
@ -282,7 +282,7 @@ namespace datalog {
|
|||
if (check_kind(t)) {
|
||||
return alloc(filter_interpreted_fn, *this, t, condition);
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
class check_table_plugin::filter_interpreted_and_project_fn : public table_transformer_fn {
|
||||
|
@ -309,7 +309,7 @@ namespace datalog {
|
|||
if (check_kind(t)) {
|
||||
return alloc(filter_interpreted_and_project_fn, *this, t, condition, removed_col_cnt, removed_cols);
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
class check_table_plugin::filter_by_negation_fn : public table_intersection_filter_fn {
|
||||
|
@ -340,7 +340,7 @@ namespace datalog {
|
|||
if (check_kind(t) && check_kind(negated_obj)) {
|
||||
return alloc(filter_by_negation_fn, *this, t, negated_obj, joined_col_cnt, t_cols, negated_cols);
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ------------------
|
||||
|
|
|
@ -120,7 +120,7 @@ namespace datalog {
|
|||
void add_fact(const table_fact & f) override;
|
||||
void remove_fact(const table_element* fact) override;
|
||||
bool contains_fact(const table_fact & f) const override;
|
||||
table_base * complement(func_decl* p, const table_element * func_columns = 0) const override;
|
||||
table_base * complement(func_decl* p, const table_element * func_columns = nullptr) const override;
|
||||
table_base * clone() const override;
|
||||
|
||||
iterator begin() const override { SASSERT(well_formed()); return m_tocheck->begin(); }
|
||||
|
|
|
@ -1120,7 +1120,7 @@ namespace datalog {
|
|||
//and clear local deltas
|
||||
make_inloop_delta_transition(global_head_deltas, global_tail_deltas, local_deltas, *loop_body);
|
||||
|
||||
loop_body->set_observer(0);
|
||||
loop_body->set_observer(nullptr);
|
||||
acc.push_back(instruction::mk_while_loop(loop_control_regs.size(),
|
||||
loop_control_regs.c_ptr(), loop_body));
|
||||
}
|
||||
|
@ -1316,7 +1316,7 @@ namespace datalog {
|
|||
|
||||
pred2idx empty_pred2idx_map;
|
||||
|
||||
compile_strats(m_rule_set.get_stratifier(), static_cast<pred2idx *>(0),
|
||||
compile_strats(m_rule_set.get_stratifier(), static_cast<pred2idx *>(nullptr),
|
||||
empty_pred2idx_map, true, execution_code);
|
||||
|
||||
|
||||
|
@ -1331,7 +1331,7 @@ namespace datalog {
|
|||
termination_code.push_back(instruction::mk_store(m_context.get_manager(), pred, reg));
|
||||
}
|
||||
|
||||
acc.set_observer(0);
|
||||
acc.set_observer(nullptr);
|
||||
|
||||
TRACE("dl", execution_code.display(execution_context(m_context), tout););
|
||||
}
|
||||
|
|
|
@ -93,10 +93,10 @@ namespace datalog {
|
|||
compiler & m_parent;
|
||||
rule * m_current;
|
||||
public:
|
||||
instruction_observer(compiler & parent) : m_parent(parent), m_current(0) {}
|
||||
instruction_observer(compiler & parent) : m_parent(parent), m_current(nullptr) {}
|
||||
|
||||
void start_rule(rule * r) { SASSERT(!m_current); m_current=r; }
|
||||
void finish_rule() { m_current = 0; }
|
||||
void finish_rule() { m_current = nullptr; }
|
||||
void notify(instruction * i) override {
|
||||
if(m_current) {
|
||||
i->set_accounting_parent_object(m_parent.m_context, m_current);
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace datalog {
|
|||
args.push_back(f[i]);
|
||||
}
|
||||
if (!fn.get()) {
|
||||
fn = m.mk_func_decl(fid, k, 0, 0, args.size(), args.c_ptr());
|
||||
fn = m.mk_func_decl(fid, k, 0, nullptr, args.size(), args.c_ptr());
|
||||
}
|
||||
if (destructive) {
|
||||
get_plugin().reduce_assign(fn, args.size(), args.c_ptr(), 1, args.c_ptr());
|
||||
|
@ -63,7 +63,7 @@ namespace datalog {
|
|||
expr_ref res(m);
|
||||
if (!m_is_empty_fn.get()) {
|
||||
family_id fid = get_plugin().get_family_id();
|
||||
const_cast<func_decl_ref&>(m_is_empty_fn) = m.mk_func_decl(fid, OP_RA_IS_EMPTY, 0, 0, 1, &r);
|
||||
const_cast<func_decl_ref&>(m_is_empty_fn) = m.mk_func_decl(fid, OP_RA_IS_EMPTY, 0, nullptr, 1, &r);
|
||||
}
|
||||
get_plugin().reduce(m_is_empty_fn, 1, &r, res);
|
||||
return m.is_true(res);
|
||||
|
@ -86,7 +86,7 @@ namespace datalog {
|
|||
expr* rel = m_rel.get();
|
||||
expr_ref res(m.mk_fresh_const("T", m.get_sort(rel)), m);
|
||||
expr* rel_out = res.get();
|
||||
func_decl_ref fn(m.mk_func_decl(fid, OP_RA_CLONE,0,0, 1, &rel), m);
|
||||
func_decl_ref fn(m.mk_func_decl(fid, OP_RA_CLONE,0,nullptr, 1, &rel), m);
|
||||
get_plugin().reduce_assign(fn, 1, &rel, 1, &rel_out);
|
||||
return alloc(external_relation, get_plugin(), get_signature(), res);
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ namespace datalog {
|
|||
family_id fid = get_plugin().get_family_id();
|
||||
expr_ref res(m);
|
||||
expr* rel = m_rel;
|
||||
func_decl_ref fn(m.mk_func_decl(fid, OP_RA_COMPLEMENT,0,0, 1, &rel), m);
|
||||
func_decl_ref fn(m.mk_func_decl(fid, OP_RA_COMPLEMENT,0,nullptr, 1, &rel), m);
|
||||
get_plugin().reduce(fn, 1, &rel, res);
|
||||
return alloc(external_relation, get_plugin(), get_signature(), res);
|
||||
}
|
||||
|
@ -140,8 +140,8 @@ namespace datalog {
|
|||
family_id fid = get_family_id();
|
||||
expr_ref e(m.mk_fresh_const("T", r_sort), m);
|
||||
expr* args[1] = { e.get() };
|
||||
func_decl_ref empty_decl(m.mk_func_decl(fid, OP_RA_EMPTY, 1, ¶m, 0, (sort*const*)0), m);
|
||||
reduce_assign(empty_decl, 0, 0, 1, args);
|
||||
func_decl_ref empty_decl(m.mk_func_decl(fid, OP_RA_EMPTY, 1, ¶m, 0, (sort*const*)nullptr), m);
|
||||
reduce_assign(empty_decl, 0, nullptr, 1, args);
|
||||
return alloc(external_relation, *this, s, e);
|
||||
}
|
||||
|
||||
|
@ -207,7 +207,7 @@ namespace datalog {
|
|||
relation_join_fn * external_relation_plugin::mk_join_fn(const relation_base & r1, const relation_base & r2,
|
||||
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) {
|
||||
if (!check_kind(r1) || !check_kind(r2)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(join_fn, *this, r1.get_signature(), r2.get_signature() , col_cnt, cols1, cols2);
|
||||
}
|
||||
|
@ -277,7 +277,7 @@ namespace datalog {
|
|||
relation_transformer_fn * external_relation_plugin::mk_rename_fn(const relation_base & r,
|
||||
unsigned cycle_len, const unsigned * permutation_cycle) {
|
||||
if(!check_kind(r)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(rename_fn, *this, get(r).get_sort(), r.get_signature(), cycle_len, permutation_cycle);
|
||||
}
|
||||
|
@ -295,7 +295,7 @@ namespace datalog {
|
|||
m_union_fn(p.get_ast_manager()) {
|
||||
ast_manager& m = p.get_ast_manager();
|
||||
sort* domain[2] = { relation_sort, relation_sort };
|
||||
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, nullptr, 2, domain);
|
||||
}
|
||||
|
||||
void operator()(relation_base & r, const relation_base & src, relation_base * delta) override {
|
||||
|
@ -316,7 +316,7 @@ namespace datalog {
|
|||
relation_union_fn * external_relation_plugin::mk_union_fn(const relation_base & tgt, const relation_base & src,
|
||||
const relation_base * delta) {
|
||||
if (!check_kind(tgt) || !check_kind(src) || (delta && !check_kind(*delta))) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(union_fn, *this, OP_RA_UNION, get(src).get_sort());
|
||||
}
|
||||
|
@ -324,7 +324,7 @@ namespace datalog {
|
|||
relation_union_fn * external_relation_plugin::mk_widen_fn(const relation_base & tgt, const relation_base & src,
|
||||
const relation_base * delta) {
|
||||
if (!check_kind(tgt) || !check_kind(src) || (delta && !check_kind(*delta))) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(union_fn, *this, OP_RA_WIDEN, get(src).get_sort());
|
||||
}
|
||||
|
@ -351,7 +351,7 @@ namespace datalog {
|
|||
|
||||
relation_mutator_fn * external_relation_plugin::mk_filter_interpreted_fn(const relation_base & r, app * condition) {
|
||||
if(!check_kind(r)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(filter_interpreted_fn, *this, get(r).get_sort(), condition);
|
||||
}
|
||||
|
@ -359,7 +359,7 @@ namespace datalog {
|
|||
relation_mutator_fn * external_relation_plugin::mk_filter_equal_fn(const relation_base & r,
|
||||
const relation_element & value, unsigned col) {
|
||||
if(!check_kind(r)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
ast_manager& m = get_ast_manager();
|
||||
app_ref condition(m);
|
||||
|
@ -407,7 +407,7 @@ namespace datalog {
|
|||
relation_mutator_fn * external_relation_plugin::mk_filter_identical_fn(const relation_base & r,
|
||||
unsigned col_cnt, const unsigned * identical_cols) {
|
||||
if (!check_kind(r)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(filter_identical_fn, *this, get(r).get_sort(), col_cnt, identical_cols);
|
||||
}
|
||||
|
@ -447,7 +447,7 @@ namespace datalog {
|
|||
const relation_base & negated_obj, unsigned joined_col_cnt,
|
||||
const unsigned * t_cols, const unsigned * negated_cols) {
|
||||
if (!check_kind(t) || !check_kind(negated_obj)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(negation_filter_fn, *this, t, negated_obj, joined_col_cnt, t_cols, negated_cols);
|
||||
}
|
||||
|
|
|
@ -245,14 +245,14 @@ namespace datalog {
|
|||
}
|
||||
|
||||
finite_product_relation * finite_product_relation_plugin::mk_from_table_relation(const table_relation & r) {
|
||||
func_decl* pred = 0;
|
||||
func_decl* pred = nullptr;
|
||||
const relation_signature & sig = r.get_signature();
|
||||
const table_base & t = r.get_table();
|
||||
table_plugin & tplugin = r.get_table().get_plugin();
|
||||
|
||||
relation_signature inner_sig; //empty signature for the inner relation
|
||||
if(!get_inner_plugin().can_handle_signature(inner_sig)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
table_signature idx_singleton_sig;
|
||||
|
@ -270,7 +270,7 @@ namespace datalog {
|
|||
idx_singleton_fact.push_back(0);
|
||||
idx_singleton->add_fact(idx_singleton_fact);
|
||||
|
||||
scoped_ptr<table_join_fn> join_fun = get_manager().mk_join_fn(t, *idx_singleton, 0, 0, 0);
|
||||
scoped_ptr<table_join_fn> join_fun = get_manager().mk_join_fn(t, *idx_singleton, 0, nullptr, nullptr);
|
||||
SASSERT(join_fun);
|
||||
scoped_rel<table_base> res_table = (*join_fun)(t, *idx_singleton);
|
||||
|
||||
|
@ -513,7 +513,7 @@ namespace datalog {
|
|||
return alloc(converting_join_fn, *this, rb1.get_signature(), rb2.get_signature(), col_cnt, cols1,
|
||||
cols2);
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
const finite_product_relation & r1 = get(rb1);
|
||||
const finite_product_relation & r2 = get(rb2);
|
||||
|
@ -590,7 +590,7 @@ namespace datalog {
|
|||
unsigned orig_rel_cnt = r.m_others.size();
|
||||
for(unsigned i=0; i<orig_rel_cnt; i++) {
|
||||
relation_base * orig_rel = r.m_others[i];
|
||||
res_relations.push_back(orig_rel ? orig_rel->clone() : 0);
|
||||
res_relations.push_back(orig_rel ? orig_rel->clone() : nullptr);
|
||||
}
|
||||
SASSERT(res_relations.size()==orig_rel_cnt);
|
||||
|
||||
|
@ -608,7 +608,7 @@ namespace datalog {
|
|||
res_table = (*tproject)(rtable);
|
||||
}
|
||||
|
||||
relation_plugin * res_oplugin = 0;
|
||||
relation_plugin * res_oplugin = nullptr;
|
||||
|
||||
if(!m_removed_rel_cols.empty()) {
|
||||
unsigned res_rel_cnt = res_relations.size();
|
||||
|
@ -651,7 +651,7 @@ namespace datalog {
|
|||
relation_transformer_fn * finite_product_relation_plugin::mk_project_fn(const relation_base & rb, unsigned col_cnt,
|
||||
const unsigned * removed_cols) {
|
||||
if(&rb.get_plugin()!=this) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(project_fn, get(rb), col_cnt, removed_cols);
|
||||
}
|
||||
|
@ -705,7 +705,7 @@ namespace datalog {
|
|||
unsigned orig_rel_cnt = r.m_others.size();
|
||||
for(unsigned i=0; i<orig_rel_cnt; i++) {
|
||||
relation_base * orig_rel = r.m_others[i];
|
||||
res_relations.push_back(orig_rel ? orig_rel->clone() : 0);
|
||||
res_relations.push_back(orig_rel ? orig_rel->clone() : nullptr);
|
||||
}
|
||||
|
||||
if(!m_rel_identity) {
|
||||
|
@ -746,7 +746,7 @@ namespace datalog {
|
|||
unsigned permutation_cycle_len, const unsigned * permutation_cycle) {
|
||||
|
||||
if(&rb.get_plugin()!=this) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
const finite_product_relation & r = get(rb);
|
||||
return alloc(rename_fn, r, permutation_cycle_len, permutation_cycle);
|
||||
|
@ -771,7 +771,7 @@ namespace datalog {
|
|||
|
||||
relation_union_fn & get_inner_rel_union_op(relation_base & r) {
|
||||
if(!m_rel_union) {
|
||||
m_rel_union = r.get_manager().mk_union_fn(r, r, m_use_delta ? &r : 0);
|
||||
m_rel_union = r.get_manager().mk_union_fn(r, r, m_use_delta ? &r : nullptr);
|
||||
}
|
||||
return *m_rel_union;
|
||||
}
|
||||
|
@ -1104,19 +1104,19 @@ namespace datalog {
|
|||
relation_union_fn * finite_product_relation_plugin::mk_union_fn(const relation_base & tgtb, const relation_base & srcb,
|
||||
const relation_base * deltab) {
|
||||
if(&srcb.get_plugin()!=this) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
const finite_product_relation & src = get(srcb);
|
||||
if(&tgtb.get_plugin()!=this || (deltab && &deltab->get_plugin()!=this) ) {
|
||||
if(can_convert_to_table_relation(src)) {
|
||||
return alloc(converting_union_fn);
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const finite_product_relation * delta = get(deltab);
|
||||
|
||||
return alloc(union_fn, get(tgtb), delta!=0);
|
||||
return alloc(union_fn, get(tgtb), delta!=nullptr);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1131,7 +1131,7 @@ namespace datalog {
|
|||
scoped_ptr<relation_mutator_fn> m_tr_filter;
|
||||
public:
|
||||
filter_identical_fn(const finite_product_relation & r, unsigned col_cnt, const unsigned * identical_cols)
|
||||
: m_table_filter(0), m_rel_filter(0), m_tr_filter(0) {
|
||||
: m_table_filter(nullptr), m_rel_filter(nullptr), m_tr_filter(nullptr) {
|
||||
finite_product_relation_plugin & plugin = r.get_plugin();
|
||||
for(unsigned i=0; i<col_cnt; i++) {
|
||||
unsigned col = identical_cols[i];
|
||||
|
@ -1192,7 +1192,7 @@ namespace datalog {
|
|||
relation_mutator_fn * finite_product_relation_plugin::mk_filter_identical_fn(const relation_base & rb,
|
||||
unsigned col_cnt, const unsigned * identical_cols) {
|
||||
if(&rb.get_plugin()!=this) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(filter_identical_fn, get(rb), col_cnt, identical_cols);
|
||||
}
|
||||
|
@ -1238,7 +1238,7 @@ namespace datalog {
|
|||
relation_mutator_fn * finite_product_relation_plugin::mk_filter_equal_fn(const relation_base & rb,
|
||||
const relation_element & value, unsigned col) {
|
||||
if(&rb.get_plugin()!=this) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(filter_equal_fn, get(rb), value, col);
|
||||
}
|
||||
|
@ -1357,7 +1357,7 @@ namespace datalog {
|
|||
unsigned rel_cnt = r.m_others.size();
|
||||
for(unsigned i=0; i<rel_cnt; i++) {
|
||||
relation_base * inner = r.m_others[i];
|
||||
if(inner==0) {
|
||||
if(inner==nullptr) {
|
||||
continue;
|
||||
}
|
||||
if(!m_rel_filter) {
|
||||
|
@ -1451,7 +1451,7 @@ namespace datalog {
|
|||
relation_mutator_fn * finite_product_relation_plugin::mk_filter_interpreted_fn(const relation_base & rb,
|
||||
app * condition) {
|
||||
if(&rb.get_plugin()!=this) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(filter_interpreted_fn, get(rb), condition);
|
||||
}
|
||||
|
@ -1626,7 +1626,7 @@ namespace datalog {
|
|||
const relation_base & negb, unsigned joined_col_cnt,
|
||||
const unsigned * r_cols, const unsigned * negated_cols) {
|
||||
if(&rb.get_plugin()!=this || &negb.get_plugin()!=this) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return alloc(negation_filter_fn, get(rb), get(negb), joined_col_cnt, r_cols, negated_cols);
|
||||
|
@ -1852,8 +1852,8 @@ namespace datalog {
|
|||
m_others.swap(r.m_others);
|
||||
m_available_rel_indexes.swap(r.m_available_rel_indexes);
|
||||
std::swap(m_full_rel_idx,r.m_full_rel_idx);
|
||||
m_live_rel_collection_project=0;
|
||||
m_empty_rel_removal_filter=0;
|
||||
m_live_rel_collection_project=nullptr;
|
||||
m_empty_rel_removal_filter=nullptr;
|
||||
|
||||
relation_base::swap(r0);
|
||||
}
|
||||
|
@ -1896,7 +1896,7 @@ namespace datalog {
|
|||
unsigned finite_product_relation::get_full_rel_idx() {
|
||||
if(m_full_rel_idx==UINT_MAX) {
|
||||
m_full_rel_idx = get_next_rel_idx();
|
||||
relation_base * full_other = mk_full_inner(0);
|
||||
relation_base * full_other = mk_full_inner(nullptr);
|
||||
m_others[m_full_rel_idx] = full_other;
|
||||
}
|
||||
return m_full_rel_idx;
|
||||
|
@ -2027,9 +2027,9 @@ namespace datalog {
|
|||
table_element full_rel_idx = get_full_rel_idx();
|
||||
scoped_rel<table_base> complement_table = m_table->complement(p, &full_rel_idx);
|
||||
|
||||
scoped_ptr<table_union_fn> u_fn = get_manager().mk_union_fn(*m_table, *complement_table, 0);
|
||||
scoped_ptr<table_union_fn> u_fn = get_manager().mk_union_fn(*m_table, *complement_table, nullptr);
|
||||
SASSERT(u_fn);
|
||||
(*u_fn)(*m_table, *complement_table, 0);
|
||||
(*u_fn)(*m_table, *complement_table, nullptr);
|
||||
}
|
||||
|
||||
finite_product_relation * finite_product_relation::complement(func_decl* p) const {
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace datalog {
|
|||
|
||||
execution_context::execution_context(context & context)
|
||||
: m_context(context),
|
||||
m_stopwatch(0),
|
||||
m_stopwatch(nullptr),
|
||||
m_timelimit_ms(0) {}
|
||||
|
||||
execution_context::~execution_context() {
|
||||
|
@ -271,10 +271,10 @@ namespace datalog {
|
|||
bool perform(execution_context & ctx) override {
|
||||
if (ctx.reg(m_src)) log_verbose(ctx);
|
||||
if (m_clone) {
|
||||
ctx.set_reg(m_tgt, ctx.reg(m_src) ? ctx.reg(m_src)->clone() : 0);
|
||||
ctx.set_reg(m_tgt, ctx.reg(m_src) ? ctx.reg(m_src)->clone() : nullptr);
|
||||
}
|
||||
else {
|
||||
ctx.set_reg(m_tgt, ctx.reg(m_src) ? ctx.release_reg(m_src) : 0);
|
||||
ctx.set_reg(m_tgt, ctx.reg(m_src) ? ctx.release_reg(m_src) : nullptr);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -662,7 +662,7 @@ namespace datalog {
|
|||
relation_base * new_delta = r_tgt.get_plugin().mk_empty(r_tgt);
|
||||
ctx.set_reg(m_delta, new_delta);
|
||||
}
|
||||
relation_base * r_delta = (m_delta!=execution_context::void_register) ? ctx.reg(m_delta) : 0;
|
||||
relation_base * r_delta = (m_delta!=execution_context::void_register) ? ctx.reg(m_delta) : nullptr;
|
||||
|
||||
relation_union_fn * fn;
|
||||
|
||||
|
@ -687,10 +687,10 @@ namespace datalog {
|
|||
else {
|
||||
if (!find_fn(r_tgt, r_src, fn)) {
|
||||
if (m_widen) {
|
||||
fn = r_src.get_manager().mk_widen_fn(r_tgt, r_src, 0);
|
||||
fn = r_src.get_manager().mk_widen_fn(r_tgt, r_src, nullptr);
|
||||
}
|
||||
else {
|
||||
fn = r_src.get_manager().mk_union_fn(r_tgt, r_src, 0);
|
||||
fn = r_src.get_manager().mk_union_fn(r_tgt, r_src, nullptr);
|
||||
}
|
||||
if (!fn) {
|
||||
std::stringstream sstm;
|
||||
|
@ -1135,7 +1135,7 @@ namespace datalog {
|
|||
dealloc(*it);
|
||||
}
|
||||
m_data.reset();
|
||||
m_observer = 0;
|
||||
m_observer = nullptr;
|
||||
}
|
||||
|
||||
bool instruction_block::perform(execution_context & ctx) const {
|
||||
|
|
|
@ -107,7 +107,7 @@ namespace datalog {
|
|||
*/
|
||||
reg_type reg(reg_idx i) const {
|
||||
if (i >= m_registers.size()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return m_registers[i];
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ namespace datalog {
|
|||
|
||||
void make_empty(reg_idx i) {
|
||||
if (reg(i)) {
|
||||
set_reg(i, 0);
|
||||
set_reg(i, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -326,7 +326,7 @@ namespace datalog {
|
|||
instr_seq_type m_data;
|
||||
instruction_observer* m_observer;
|
||||
public:
|
||||
instruction_block() : m_observer(0) {}
|
||||
instruction_block() : m_observer(nullptr) {}
|
||||
~instruction_block();
|
||||
void reset();
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace datalog {
|
|||
interval_relation const& r1 = get(_r1);
|
||||
interval_relation const& r2 = get(_r2);
|
||||
interval_relation_plugin& p = r1.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(nullptr, get_result_signature()));
|
||||
result->mk_join(r1, r2, m_cols1.size(), m_cols1.c_ptr(), m_cols2.c_ptr());
|
||||
return result;
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ namespace datalog {
|
|||
relation_join_fn * interval_relation_plugin::mk_join_fn(const relation_base & r1, const relation_base & r2,
|
||||
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) {
|
||||
if (!check_kind(r1) || !check_kind(r2)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(join_fn, r1.get_signature(), r2.get_signature(), col_cnt, cols1, cols2);
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ namespace datalog {
|
|||
relation_base * operator()(const relation_base & _r) override {
|
||||
interval_relation const& r = get(_r);
|
||||
interval_relation_plugin& p = r.get_plugin();
|
||||
interval_relation* result = dynamic_cast<interval_relation*>(p.mk_full(0, get_result_signature()));
|
||||
interval_relation* result = dynamic_cast<interval_relation*>(p.mk_full(nullptr, get_result_signature()));
|
||||
result->mk_project(r, m_removed_cols.size(), m_removed_cols.c_ptr());
|
||||
return result;
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ namespace datalog {
|
|||
relation_base * operator()(const relation_base & _r) override {
|
||||
interval_relation const& r = get(_r);
|
||||
interval_relation_plugin& p = r.get_plugin();
|
||||
interval_relation* result = dynamic_cast<interval_relation*>(p.mk_full(0, get_result_signature()));
|
||||
interval_relation* result = dynamic_cast<interval_relation*>(p.mk_full(nullptr, get_result_signature()));
|
||||
result->mk_rename(r, m_cycle.size(), m_cycle.c_ptr());
|
||||
return result;
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ namespace datalog {
|
|||
relation_transformer_fn * interval_relation_plugin::mk_rename_fn(const relation_base & r,
|
||||
unsigned cycle_len, const unsigned * permutation_cycle) {
|
||||
if(!check_kind(r)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(rename_fn, r.get_signature(), cycle_len, permutation_cycle);
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ namespace datalog {
|
|||
high = src2.sup();
|
||||
r_open = src2.is_upper_open();
|
||||
}
|
||||
return interval(dep(), low, l_open, 0, high, r_open, 0);
|
||||
return interval(dep(), low, l_open, nullptr, high, r_open, nullptr);
|
||||
}
|
||||
|
||||
interval interval_relation_plugin::widen(interval const& src1, interval const& src2) {
|
||||
|
@ -151,7 +151,7 @@ namespace datalog {
|
|||
high = ext_numeral(true);
|
||||
r_open = true;
|
||||
}
|
||||
return interval(dep(), low, l_open, 0, high, r_open, 0);
|
||||
return interval(dep(), low, l_open, nullptr, high, r_open, nullptr);
|
||||
}
|
||||
|
||||
interval interval_relation_plugin::meet(interval const& src1, interval const& src2, bool& isempty) {
|
||||
|
@ -179,7 +179,7 @@ namespace datalog {
|
|||
return interval(dep());
|
||||
}
|
||||
else {
|
||||
return interval(dep(), low, l_open, 0, high, r_open, 0);
|
||||
return interval(dep(), low, l_open, nullptr, high, r_open, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -209,7 +209,7 @@ namespace datalog {
|
|||
r.mk_union(src, &d, m_is_widen);
|
||||
}
|
||||
else {
|
||||
r.mk_union(src, 0, m_is_widen);
|
||||
r.mk_union(src, nullptr, m_is_widen);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -217,7 +217,7 @@ namespace datalog {
|
|||
relation_union_fn * interval_relation_plugin::mk_union_fn(const relation_base & tgt, const relation_base & src,
|
||||
const relation_base * delta) {
|
||||
if (!check_kind(tgt) || !check_kind(src) || (delta && !check_kind(*delta))) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(union_fn, false);
|
||||
}
|
||||
|
@ -226,7 +226,7 @@ namespace datalog {
|
|||
const relation_base & tgt, const relation_base & src,
|
||||
const relation_base * delta) {
|
||||
if (!check_kind(tgt) || !check_kind(src) || (delta && !check_kind(*delta))) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(union_fn, true);
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ namespace datalog {
|
|||
relation_mutator_fn * interval_relation_plugin::mk_filter_identical_fn(
|
||||
const relation_base & t, unsigned col_cnt, const unsigned * identical_cols) {
|
||||
if(!check_kind(t)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(filter_identical_fn, col_cnt, identical_cols);
|
||||
}
|
||||
|
@ -279,7 +279,7 @@ namespace datalog {
|
|||
if(check_kind(r)) {
|
||||
return alloc(filter_equal_fn, get_manager(), value, col);
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
@ -300,7 +300,7 @@ namespace datalog {
|
|||
if (check_kind(t)) {
|
||||
return alloc(filter_interpreted_fn, get(t), condition);
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
interval_relation& interval_relation_plugin::get(relation_base& r) {
|
||||
|
@ -329,7 +329,7 @@ namespace datalog {
|
|||
eq = m.mk_eq(m.mk_var(i, m.get_sort(e)), e);
|
||||
r.filter_interpreted(eq.get());
|
||||
}
|
||||
mk_union(r, 0, false);
|
||||
mk_union(r, nullptr, false);
|
||||
}
|
||||
|
||||
bool interval_relation::contains_fact(const relation_fact & f) const {
|
||||
|
@ -365,7 +365,7 @@ namespace datalog {
|
|||
|
||||
interval_relation * interval_relation::complement(func_decl*) const {
|
||||
UNREACHABLE();
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void interval_relation::to_formula(expr_ref& fml) const {
|
||||
|
@ -434,22 +434,22 @@ namespace datalog {
|
|||
// 0 < x - y + k
|
||||
if (x == UINT_MAX) {
|
||||
// y < k
|
||||
mk_intersect(y, interval(p.dep(), k, true, false, 0));
|
||||
mk_intersect(y, interval(p.dep(), k, true, false, nullptr));
|
||||
return;
|
||||
}
|
||||
if (y == UINT_MAX) {
|
||||
// -k < x
|
||||
mk_intersect(x, interval(p.dep(), -k, true, true, 0));
|
||||
mk_intersect(x, interval(p.dep(), -k, true, true, nullptr));
|
||||
return;
|
||||
}
|
||||
// y < x + k
|
||||
ext_numeral x_hi = (*this)[x].sup();
|
||||
ext_numeral y_lo = (*this)[y].inf();
|
||||
if (!x_hi.is_infinite()) {
|
||||
mk_intersect(y, interval(p.dep(), k + x_hi.to_rational(), true, false, 0));
|
||||
mk_intersect(y, interval(p.dep(), k + x_hi.to_rational(), true, false, nullptr));
|
||||
}
|
||||
if (!y_lo.is_infinite()) {
|
||||
mk_intersect(x, interval(p.dep(), y_lo.to_rational() - k, true, true, 0));
|
||||
mk_intersect(x, interval(p.dep(), y_lo.to_rational() - k, true, true, nullptr));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -458,21 +458,21 @@ namespace datalog {
|
|||
// 0 <= x - y + k
|
||||
if (x == UINT_MAX) {
|
||||
// y <= k
|
||||
mk_intersect(y, interval(p.dep(), k, false, false, 0));
|
||||
mk_intersect(y, interval(p.dep(), k, false, false, nullptr));
|
||||
return;
|
||||
}
|
||||
if (y == UINT_MAX) {
|
||||
// -k <= x
|
||||
mk_intersect(x, interval(p.dep(), -k, false, true, 0));
|
||||
mk_intersect(x, interval(p.dep(), -k, false, true, nullptr));
|
||||
return;
|
||||
}
|
||||
ext_numeral x_hi = (*this)[x].sup();
|
||||
ext_numeral y_lo = (*this)[y].inf();
|
||||
if (!x_hi.is_infinite()) {
|
||||
mk_intersect(y, interval(p.dep(), k + x_hi.to_rational(), false, false, 0));
|
||||
mk_intersect(y, interval(p.dep(), k + x_hi.to_rational(), false, false, nullptr));
|
||||
}
|
||||
if (!y_lo.is_infinite()) {
|
||||
mk_intersect(x, interval(p.dep(), y_lo.to_rational() - k, false, true, 0));
|
||||
mk_intersect(x, interval(p.dep(), y_lo.to_rational() - k, false, true, nullptr));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ namespace datalog {
|
|||
return alloc(join_fn, t1.get_signature(), t2.get_signature(), col_cnt, cols1, cols2);
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ namespace datalog {
|
|||
lazy_table* delta = get(_delta);
|
||||
table_base const* t_src = src.eval();
|
||||
table_base * t_tgt = tgt.eval();
|
||||
table_base * t_delta = delta?delta->eval():0;
|
||||
table_base * t_delta = delta?delta->eval():nullptr;
|
||||
verbose_action _t("union");
|
||||
table_union_fn* m = tgt.get_lplugin().get_manager().mk_union_fn(*t_tgt, *t_src, t_delta);
|
||||
SASSERT(m);
|
||||
|
@ -98,7 +98,7 @@ namespace datalog {
|
|||
return alloc(union_fn);
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,7 @@ namespace datalog {
|
|||
return alloc(project_fn, t.get_signature(), col_cnt, removed_cols);
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -150,7 +150,7 @@ namespace datalog {
|
|||
return alloc(rename_fn, t.get_signature(), col_cnt, removed_cols);
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -175,7 +175,7 @@ namespace datalog {
|
|||
return alloc(filter_identical_fn, col_cnt, identical_cols);
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -201,7 +201,7 @@ namespace datalog {
|
|||
return alloc(filter_interpreted_fn, cond);
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -229,7 +229,7 @@ namespace datalog {
|
|||
return alloc(filter_by_negation_fn, joined_col_cnt, t_cols, negated_cols);
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -258,7 +258,7 @@ namespace datalog {
|
|||
return alloc(filter_equal_fn, value, col);
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -269,7 +269,7 @@ namespace datalog {
|
|||
return alloc(lazy_table_plugin, *sp);
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -397,7 +397,7 @@ namespace datalog {
|
|||
SASSERT(!m_table);
|
||||
m_table = m_src->eval();
|
||||
m_src->release_table();
|
||||
m_src = 0;
|
||||
m_src = nullptr;
|
||||
verbose_action _t("filter_identical");
|
||||
table_mutator_fn* m = rm().mk_filter_identical_fn(*m_table, m_cols.size(), m_cols.c_ptr());
|
||||
SASSERT(m);
|
||||
|
@ -410,7 +410,7 @@ namespace datalog {
|
|||
SASSERT(!m_table);
|
||||
m_table = m_src->eval();
|
||||
m_src->release_table();
|
||||
m_src = 0;
|
||||
m_src = nullptr;
|
||||
verbose_action _t("filter_equal");
|
||||
table_mutator_fn* m = rm().mk_filter_equal_fn(*m_table, m_value, m_col);
|
||||
SASSERT(m);
|
||||
|
@ -423,7 +423,7 @@ namespace datalog {
|
|||
SASSERT(!m_table);
|
||||
m_table = m_src->eval();
|
||||
m_src->release_table();
|
||||
m_src = 0;
|
||||
m_src = nullptr;
|
||||
verbose_action _t("filter_interpreted");
|
||||
table_mutator_fn* m = rm().mk_filter_interpreted_fn(*m_table, m_condition);
|
||||
SASSERT(m);
|
||||
|
@ -436,7 +436,7 @@ namespace datalog {
|
|||
SASSERT(!m_table);
|
||||
m_table = m_tgt->eval();
|
||||
m_tgt->release_table();
|
||||
m_tgt = 0;
|
||||
m_tgt = nullptr;
|
||||
|
||||
switch(m_src->kind()) {
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ namespace datalog {
|
|||
}
|
||||
|
||||
table_base * clone() const override;
|
||||
table_base * complement(func_decl* p, const table_element * func_columns = 0) const override;
|
||||
table_base * complement(func_decl* p, const table_element * func_columns = nullptr) const override;
|
||||
bool empty() const override;
|
||||
bool contains_fact(const table_fact & f) const override;
|
||||
void remove_fact(table_element const* fact) override;
|
||||
|
|
|
@ -189,7 +189,7 @@ namespace datalog {
|
|||
}
|
||||
|
||||
bool is_undefined(unsigned col_idx) const {
|
||||
return m_data[col_idx]==0;
|
||||
return m_data[col_idx]==nullptr;
|
||||
}
|
||||
bool no_undefined() const {
|
||||
if (empty()) {
|
||||
|
@ -296,7 +296,7 @@ namespace datalog {
|
|||
class explanation_relation_plugin::join_fn : public convenient_relation_join_fn {
|
||||
public:
|
||||
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, nullptr, nullptr) {}
|
||||
|
||||
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);
|
||||
|
@ -317,10 +317,10 @@ namespace datalog {
|
|||
relation_join_fn * explanation_relation_plugin::mk_join_fn(const relation_base & r1, const relation_base & r2,
|
||||
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) {
|
||||
if (&r1.get_plugin()!=this || &r2.get_plugin()!=this) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
if (col_cnt!=0) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(join_fn, r1.get_signature(), r2.get_signature());
|
||||
}
|
||||
|
@ -348,7 +348,7 @@ namespace datalog {
|
|||
relation_transformer_fn * explanation_relation_plugin::mk_project_fn(const relation_base & r, unsigned col_cnt,
|
||||
const unsigned * removed_cols) {
|
||||
if (&r.get_plugin()!=this) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(project_fn, r.get_signature(), col_cnt, removed_cols);
|
||||
}
|
||||
|
@ -385,7 +385,7 @@ namespace datalog {
|
|||
void operator()(relation_base & tgt0, const relation_base & src0, relation_base * delta0) override {
|
||||
explanation_relation & tgt = static_cast<explanation_relation &>(tgt0);
|
||||
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) : nullptr;
|
||||
explanation_relation_plugin & plugin = tgt.get_plugin();
|
||||
|
||||
if (!src.no_undefined() || !tgt.no_undefined() || (delta && !delta->no_undefined())) {
|
||||
|
@ -420,7 +420,7 @@ namespace datalog {
|
|||
public:
|
||||
void operator()(relation_base & tgt0, const relation_base & src, relation_base * delta0) override {
|
||||
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) : nullptr;
|
||||
|
||||
if (src.empty()) {
|
||||
return;
|
||||
|
@ -435,7 +435,7 @@ namespace datalog {
|
|||
relation_union_fn * explanation_relation_plugin::mk_union_fn(const relation_base & tgt, const relation_base & src,
|
||||
const relation_base * delta) {
|
||||
if (!check_kind(tgt) || (delta && !check_kind(*delta))) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
if (!check_kind(src)) {
|
||||
//this is to handle the product relation
|
||||
|
@ -480,11 +480,11 @@ namespace datalog {
|
|||
relation_mutator_fn * explanation_relation_plugin::mk_filter_interpreted_fn(const relation_base & r,
|
||||
app * cond) {
|
||||
if (&r.get_plugin()!=this) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
ast_manager & m = get_ast_manager();
|
||||
if (!m.is_eq(cond)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
expr * arg1 = cond->get_arg(0);
|
||||
expr * arg2 = cond->get_arg(1);
|
||||
|
@ -494,12 +494,12 @@ namespace datalog {
|
|||
}
|
||||
|
||||
if (!is_var(arg1) || !is_app(arg2)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
var * col_var = to_var(arg1);
|
||||
app * new_rule = to_app(arg2);
|
||||
if (!get_context().get_decl_util().is_rule_sort(col_var->get_sort())) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
unsigned col_idx = col_var->get_idx();
|
||||
|
||||
|
@ -520,7 +520,7 @@ namespace datalog {
|
|||
const relation_base & neg, unsigned joined_col_cnt, const unsigned * t_cols,
|
||||
const unsigned * negated_cols) {
|
||||
if (&r.get_plugin()!=this || &neg.get_plugin()!=this) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(negation_filter_fn);
|
||||
}
|
||||
|
@ -569,18 +569,18 @@ namespace datalog {
|
|||
const relation_base & tgt, const relation_base & src, unsigned joined_col_cnt,
|
||||
const unsigned * tgt_cols, const unsigned * src_cols) {
|
||||
if (&tgt.get_plugin()!=this || &src.get_plugin()!=this) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
//this checks the join is one to one on all columns
|
||||
if (tgt.get_signature()!=src.get_signature()
|
||||
|| joined_col_cnt!=tgt.get_signature().size()
|
||||
|| !containers_equal(tgt_cols, tgt_cols+joined_col_cnt, src_cols, src_cols+joined_col_cnt)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
counter ctr;
|
||||
ctr.count(joined_col_cnt, tgt_cols);
|
||||
if (ctr.get_max_counter_value()>1 || (joined_col_cnt && ctr.get_max_positive()!=joined_col_cnt-1)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(intersection_filter_fn, *this);
|
||||
}
|
||||
|
@ -776,7 +776,7 @@ namespace datalog {
|
|||
app_ref orig_lit(m_manager.mk_app(orig_decl, lit_args.c_ptr()), m_manager);
|
||||
app_ref e_lit(get_e_lit(orig_lit, arity), m_manager);
|
||||
app * tail[] = { e_lit.get() };
|
||||
dst.add_rule(m_context.get_rule_manager().mk(orig_lit, 1, tail, 0));
|
||||
dst.add_rule(m_context.get_rule_manager().mk(orig_lit, 1, tail, nullptr));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -852,7 +852,7 @@ namespace datalog {
|
|||
translate_rel_level_relation(rmgr, orig_rel, e_rel);
|
||||
}
|
||||
else {
|
||||
scoped_ptr<relation_join_fn> product_fun = rmgr.mk_join_fn(orig_rel, *m_e_fact_relation, 0, 0, 0);
|
||||
scoped_ptr<relation_join_fn> product_fun = rmgr.mk_join_fn(orig_rel, *m_e_fact_relation, 0, nullptr, nullptr);
|
||||
SASSERT(product_fun);
|
||||
scoped_rel<relation_base> aux_extended_rel = (*product_fun)(orig_rel, *m_e_fact_relation);
|
||||
TRACE("dl", tout << aux_extended_rel << " " << aux_extended_rel->get_plugin().get_name() << "\n";
|
||||
|
@ -868,10 +868,10 @@ namespace datalog {
|
|||
rule_set * mk_explanations::operator()(rule_set const & source) {
|
||||
|
||||
if (source.empty()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
if (!m_context.generate_explanations()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
rule_set * res = alloc(rule_set, m_context);
|
||||
transform_facts(m_context.get_rel_context()->get_rmanager(), source, *res);
|
||||
|
|
|
@ -531,7 +531,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_result_rules.size();
|
||||
|
|
|
@ -165,7 +165,7 @@ namespace datalog {
|
|||
SASSERT(is_var(t->get_arg(i)));
|
||||
var * v = to_var(t->get_arg(i));
|
||||
unsigned var_idx = v->get_idx();
|
||||
if (result[res_ofs-var_idx]==0) {
|
||||
if (result[res_ofs-var_idx]==nullptr) {
|
||||
result[res_ofs-var_idx]=m.mk_var(next_var, v->get_sort());
|
||||
next_var++;
|
||||
}
|
||||
|
@ -235,7 +235,7 @@ namespace datalog {
|
|||
//so the order should not matter
|
||||
}
|
||||
|
||||
result.resize(max_var_idx+1, static_cast<expr *>(0));
|
||||
result.resize(max_var_idx+1, static_cast<expr *>(nullptr));
|
||||
unsigned next_var = 0;
|
||||
get_normalizer(t1, next_var, result);
|
||||
get_normalizer(t2, next_var, result);
|
||||
|
@ -268,9 +268,9 @@ namespace datalog {
|
|||
*/
|
||||
void register_pair(app * t1, app * t2, rule * r, const var_idx_set & non_local_vars) {
|
||||
SASSERT(t1!=t2);
|
||||
cost_map::entry * e = m_costs.insert_if_not_there2(get_key(t1, t2), 0);
|
||||
cost_map::entry * e = m_costs.insert_if_not_there2(get_key(t1, t2), nullptr);
|
||||
pair_info * & ptr_inf = e->get_data().m_value;
|
||||
if (ptr_inf==0) {
|
||||
if (ptr_inf==nullptr) {
|
||||
ptr_inf = alloc(pair_info);
|
||||
}
|
||||
pair_info & inf = *ptr_inf;
|
||||
|
@ -297,7 +297,7 @@ namespace datalog {
|
|||
}
|
||||
|
||||
void remove_rule_from_pair(app_pair key, rule * r, unsigned original_len) {
|
||||
pair_info * ptr = 0;
|
||||
pair_info * ptr = nullptr;
|
||||
if (m_costs.find(key, ptr) && ptr &&
|
||||
ptr->remove_rule(r, original_len)) {
|
||||
SASSERT(ptr->m_rules.empty());
|
||||
|
@ -354,7 +354,7 @@ namespace datalog {
|
|||
void join_pair(app_pair pair_key) {
|
||||
app * t1 = pair_key.first;
|
||||
app * t2 = pair_key.second;
|
||||
pair_info* infp = 0;
|
||||
pair_info* infp = nullptr;
|
||||
if (!m_costs.find(pair_key, infp) || !infp) {
|
||||
UNREACHABLE();
|
||||
return;
|
||||
|
@ -402,7 +402,7 @@ namespace datalog {
|
|||
|
||||
app * tail[] = {t1, t2};
|
||||
|
||||
rule * new_rule = m_context.get_rule_manager().mk(head, 2, tail, 0);
|
||||
rule * new_rule = m_context.get_rule_manager().mk(head, 2, tail, nullptr);
|
||||
|
||||
//TODO: update accounting so that it can handle multiple parents
|
||||
new_rule->set_accounting_parent_object(m_context, one_parent);
|
||||
|
@ -702,7 +702,7 @@ namespace datalog {
|
|||
}
|
||||
|
||||
if (!m_modified_rules) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
rule_set * result = alloc(rule_set, m_context);
|
||||
rule_pred_map::iterator rcit = m_rules_content.begin();
|
||||
|
|
|
@ -261,7 +261,7 @@ namespace datalog {
|
|||
void init(relation_signature const& r1_sig, unsigned num_rels1, relation_base const* const* r1,
|
||||
relation_signature const& r2_sig, unsigned num_rels2, relation_base const* const* r2,
|
||||
unsigned col_cnt, unsigned const* cols1, unsigned const* cols2) {
|
||||
func_decl* p = 0;
|
||||
func_decl* p = nullptr;
|
||||
bit_vector bv;
|
||||
bv.resize(num_rels2);
|
||||
relation_manager& rmgr = m_plugin.get_manager();
|
||||
|
@ -453,7 +453,7 @@ namespace datalog {
|
|||
TRACE("dl", _r1.display(tout); _r2.display(tout););
|
||||
ptr_vector<relation_base> relations;
|
||||
unsigned sz = m_joins.size();
|
||||
relation_base* result = 0;
|
||||
relation_base* result = nullptr;
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
relation_base const& r1 = (m_kind1[i] == T_FULL)?(*m_full[m_offset1[i]]):access(m_offset1[i], _r1);
|
||||
relation_base const& r2 = (m_kind2[i] == T_FULL)?(*m_full[m_offset2[i]]):access(m_offset2[i], _r2);
|
||||
|
@ -479,7 +479,7 @@ namespace datalog {
|
|||
if (r1.get_kind() != r2.get_kind()) {
|
||||
return alloc(join_fn, *this, r1, r2, col_cnt, cols1, cols2);
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
@ -519,7 +519,7 @@ namespace datalog {
|
|||
relation_signature::from_project(r.get_signature(), col_cnt, removed_cols, s);
|
||||
return alloc(transform_fn, s, projs.size(), projs.c_ptr());
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
relation_transformer_fn * product_relation_plugin::mk_rename_fn(const relation_base & _r,
|
||||
|
@ -534,7 +534,7 @@ namespace datalog {
|
|||
relation_signature::from_rename(r.get_signature(), cycle_len, permutation_cycle, s);
|
||||
return alloc(transform_fn, s, trans.size(), trans.c_ptr());
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
class product_relation_plugin::aligned_union_fn : public relation_union_fn {
|
||||
|
@ -549,7 +549,7 @@ namespace datalog {
|
|||
void mk_union_fn(unsigned i, unsigned j, relation_base const& r1, relation_base const& r2,
|
||||
const relation_base* delta) {
|
||||
relation_manager& rmgr = r1.get_manager();
|
||||
relation_union_fn* u = 0;
|
||||
relation_union_fn* u = nullptr;
|
||||
if (m_is_widen) {
|
||||
u = rmgr.mk_widen_fn(r1, r2, delta);
|
||||
}
|
||||
|
@ -596,7 +596,7 @@ namespace datalog {
|
|||
return;
|
||||
}
|
||||
do_intersection(*tgt, *src);
|
||||
src = 0;
|
||||
src = nullptr;
|
||||
}
|
||||
|
||||
void do_intersection(relation_base& tgt, relation_base& src) {
|
||||
|
@ -625,7 +625,7 @@ namespace datalog {
|
|||
m_is_widen(is_widen) {
|
||||
SASSERT(vectors_equal(tgt.m_spec, src.m_spec));
|
||||
SASSERT(!delta || vectors_equal(tgt.m_spec, delta->m_spec));
|
||||
init(tgt.m_relations, src.m_relations, delta ? &delta->m_relations : 0);
|
||||
init(tgt.m_relations, src.m_relations, delta ? &delta->m_relations : nullptr);
|
||||
}
|
||||
|
||||
~aligned_union_fn() override {
|
||||
|
@ -650,9 +650,9 @@ namespace datalog {
|
|||
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
relation_base& itgt = tgt[i];
|
||||
relation_base* idelta = delta ? &(*delta)[i] : 0;
|
||||
relation_base* idelta = delta ? &(*delta)[i] : nullptr;
|
||||
|
||||
scoped_rel<relation_base> fresh_delta = idelta ? idelta->get_plugin().mk_empty(*idelta) : 0;
|
||||
scoped_rel<relation_base> fresh_delta = idelta ? idelta->get_plugin().mk_empty(*idelta) : nullptr;
|
||||
scoped_rel<relation_base> side_result;
|
||||
scoped_rel<relation_base> side_delta;
|
||||
|
||||
|
@ -665,7 +665,7 @@ namespace datalog {
|
|||
TRACE("dl", itgt.display(tout << "tgt:\n"); src[j].display(tout << "src:\n"););
|
||||
// union[i][j]
|
||||
scoped_rel<relation_base> one_side_union = itgt.clone();
|
||||
scoped_rel<relation_base> one_side_delta = fresh_delta ? fresh_delta->clone() : 0;
|
||||
scoped_rel<relation_base> one_side_delta = fresh_delta ? fresh_delta->clone() : nullptr;
|
||||
TRACE("dl", one_side_union->display(tout << "union 1:\n"); src[j].display(tout););
|
||||
do_inner_union(i, j, *one_side_union, src[j], one_side_delta.get());
|
||||
TRACE("dl", one_side_union->display(tout << "union:\n"););
|
||||
|
@ -679,7 +679,7 @@ namespace datalog {
|
|||
|
||||
// union[j][i]
|
||||
one_side_union = src[i].clone();
|
||||
one_side_delta = fresh_delta ? fresh_delta->clone() : 0;
|
||||
one_side_delta = fresh_delta ? fresh_delta->clone() : nullptr;
|
||||
TRACE("dl", one_side_union->display(tout << "union 2:\n"); tgt[j].display(tout););
|
||||
do_inner_union(i, j, *one_side_union, tgt[j], one_side_delta.get());
|
||||
TRACE("dl", one_side_union->display(tout << "union:\n"););
|
||||
|
@ -697,8 +697,8 @@ namespace datalog {
|
|||
}
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
relation_base& itgt = tgt[i];
|
||||
relation_base* idelta = delta ? &(*delta)[i] : 0;
|
||||
scoped_rel<relation_base> fresh_delta = idelta ? idelta->get_plugin().mk_empty(*idelta) : 0;
|
||||
relation_base* idelta = delta ? &(*delta)[i] : nullptr;
|
||||
scoped_rel<relation_base> fresh_delta = idelta ? idelta->get_plugin().mk_empty(*idelta) : nullptr;
|
||||
scoped_rel<relation_base> side_result(side_results[i]);
|
||||
scoped_rel<relation_base> side_delta(side_deltas[i]);
|
||||
|
||||
|
@ -752,7 +752,7 @@ namespace datalog {
|
|||
TRACE("dl_verbose", _tgt.display(tout << "dst:\n"); _src.display(tout << "src:\n"););
|
||||
product_relation& tgt = get(_tgt);
|
||||
product_relation const& src0 = get(_src);
|
||||
product_relation* delta = _delta ? get(_delta) : 0;
|
||||
product_relation* delta = _delta ? get(_delta) : nullptr;
|
||||
|
||||
tgt.convert_spec(m_common_spec);
|
||||
if(delta) {
|
||||
|
@ -815,7 +815,7 @@ namespace datalog {
|
|||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
relation_union_fn * product_relation_plugin::mk_union_fn(const relation_base & tgt, const relation_base & src,
|
||||
|
@ -867,7 +867,7 @@ namespace datalog {
|
|||
return alloc(mutator_fn, mutators.size(), mutators.c_ptr());
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
relation_mutator_fn * product_relation_plugin::mk_filter_equal_fn(const relation_base & _t,
|
||||
|
@ -885,7 +885,7 @@ namespace datalog {
|
|||
return alloc(mutator_fn, mutators.size(), mutators.c_ptr());
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
class product_relation_plugin::filter_interpreted_fn : public relation_mutator_fn {
|
||||
|
@ -983,7 +983,7 @@ namespace datalog {
|
|||
|
||||
void product_relation::convert_spec(const rel_spec & spec) {
|
||||
|
||||
func_decl* p = 0;
|
||||
func_decl* p = nullptr;
|
||||
const relation_signature & sig = get_signature();
|
||||
family_id new_kind = get_plugin().get_relation_kind(sig, spec);
|
||||
if (new_kind == get_kind()) {
|
||||
|
@ -1008,7 +1008,7 @@ namespace datalog {
|
|||
//the loop is quadratic with the number of relations, maybe we want to fix it
|
||||
for(unsigned i=0; i<new_sz; i++) {
|
||||
family_id ikind = spec[i];
|
||||
relation_base * irel = 0;
|
||||
relation_base * irel = nullptr;
|
||||
//we try to find the relation for the new specification among those we already have
|
||||
for(unsigned j=0; j<old_sz; j++) {
|
||||
if(m_relations[j] && m_relations[j]->get_kind()==ikind) {
|
||||
|
@ -1096,7 +1096,7 @@ namespace datalog {
|
|||
return res;
|
||||
}
|
||||
UNREACHABLE();
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool product_relation::empty() const {
|
||||
|
|
|
@ -47,8 +47,8 @@ namespace datalog {
|
|||
void relation_manager::reset() {
|
||||
reset_relations();
|
||||
|
||||
m_favourite_table_plugin = static_cast<table_plugin *>(0);
|
||||
m_favourite_relation_plugin = static_cast<relation_plugin *>(0);
|
||||
m_favourite_table_plugin = static_cast<table_plugin *>(nullptr);
|
||||
m_favourite_relation_plugin = static_cast<relation_plugin *>(nullptr);
|
||||
dealloc_ptr_vector_content(m_table_plugins);
|
||||
m_table_plugins.reset();
|
||||
dealloc_ptr_vector_content(m_relation_plugins);
|
||||
|
@ -95,9 +95,9 @@ namespace datalog {
|
|||
}
|
||||
|
||||
relation_base * relation_manager::try_get_relation(func_decl * pred) const {
|
||||
relation_base * res = 0;
|
||||
relation_base * res = nullptr;
|
||||
if(!m_relations.find(pred, res)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
SASSERT(res);
|
||||
return res;
|
||||
|
@ -217,7 +217,7 @@ namespace datalog {
|
|||
return *rpit;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
relation_plugin & relation_manager::get_appropriate_plugin(const relation_signature & s) {
|
||||
|
@ -239,7 +239,7 @@ namespace datalog {
|
|||
return *tpit;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
table_plugin & relation_manager::get_appropriate_plugin(const table_signature & t) {
|
||||
|
@ -258,13 +258,13 @@ namespace datalog {
|
|||
return *rpit;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
relation_plugin & relation_manager::get_relation_plugin(family_id kind) {
|
||||
SASSERT(kind>=0);
|
||||
SASSERT(kind<m_next_relation_fid);
|
||||
relation_plugin * res = 0;
|
||||
relation_plugin * res = nullptr;
|
||||
VERIFY(m_kind2plugin.find(kind, res));
|
||||
return *res;
|
||||
}
|
||||
|
@ -275,11 +275,11 @@ namespace datalog {
|
|||
return tp;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
table_relation_plugin & relation_manager::get_table_relation_plugin(table_plugin & tp) {
|
||||
table_relation_plugin * res = 0;
|
||||
table_relation_plugin * res = nullptr;
|
||||
VERIFY( m_table_relation_plugins.find(&tp, res) );
|
||||
return *res;
|
||||
}
|
||||
|
@ -612,7 +612,7 @@ namespace datalog {
|
|||
unsigned removed_col_cnt,
|
||||
const unsigned * removed_cols)
|
||||
: m_filter(filter),
|
||||
m_project(0),
|
||||
m_project(nullptr),
|
||||
m_removed_cols(removed_col_cnt, removed_cols) {}
|
||||
|
||||
relation_base * operator()(const relation_base & t) override {
|
||||
|
@ -686,7 +686,7 @@ namespace datalog {
|
|||
*/
|
||||
default_relation_join_project_fn(join_fn * join, unsigned removed_col_cnt,
|
||||
const unsigned * removed_cols)
|
||||
: m_join(join), m_project(0), m_removed_cols(removed_col_cnt, removed_cols) {}
|
||||
: m_join(join), m_project(nullptr), m_removed_cols(removed_col_cnt, removed_cols) {}
|
||||
|
||||
relation_base * operator()(const relation_base & t1, const relation_base & t2) override {
|
||||
scoped_rel<relation_base> aux = (*m_join)(t1, t2);
|
||||
|
@ -851,21 +851,21 @@ namespace datalog {
|
|||
scoped_rel<relation_join_fn> join_fun = mk_join_project_fn(tgt, src, joined_col_cnt, tgt_cols, src_cols,
|
||||
join_removed_cols.size(), join_removed_cols.c_ptr(), false);
|
||||
if(!join_fun) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
//we perform the join operation here to see what the result is
|
||||
scoped_rel<relation_base> join_res = (*join_fun)(tgt, src);
|
||||
if(tgt.can_swap(*join_res)) {
|
||||
return alloc(default_relation_intersection_filter_fn, join_fun.release(), 0);
|
||||
return alloc(default_relation_intersection_filter_fn, join_fun.release(), nullptr);
|
||||
}
|
||||
if(join_res->get_plugin().is_product_relation()) {
|
||||
//we cannot have the product relation here, since it uses the intersection operation
|
||||
//for unions and therefore we would get into an infinite recursion
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
scoped_rel<relation_union_fn> union_fun = mk_union_fn(tgt, *join_res);
|
||||
if(!union_fun) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(default_relation_intersection_filter_fn, join_fun.release(), union_fun.release());
|
||||
}
|
||||
|
@ -1357,11 +1357,11 @@ namespace datalog {
|
|||
static table_mutator_fn* mk(context& ctx, expr* condition) {
|
||||
ast_manager& m = ctx.get_manager();
|
||||
if (!m.is_not(condition)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
condition = to_app(condition)->get_arg(0);
|
||||
if (!m.is_eq(condition)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
expr* x = to_app(condition)->get_arg(0);
|
||||
expr* y = to_app(condition)->get_arg(1);
|
||||
|
@ -1369,12 +1369,12 @@ namespace datalog {
|
|||
std::swap(x, y);
|
||||
}
|
||||
if (!is_var(x)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
dl_decl_util decl_util(m);
|
||||
uint64 value = 0;
|
||||
if (!decl_util.is_numeral_ext(y, value)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(default_table_filter_not_equal_fn, ctx, to_var(x)->get_idx(), value);
|
||||
}
|
||||
|
@ -1410,7 +1410,7 @@ namespace datalog {
|
|||
unsigned col_cnt = f.size();
|
||||
for(int i=col_cnt-1;i>=0;i--) {
|
||||
if(!m_free_vars.contains(i)) {
|
||||
args.push_back(0);
|
||||
args.push_back(nullptr);
|
||||
continue; //this variable does not occur in the condition;
|
||||
}
|
||||
|
||||
|
@ -1502,7 +1502,7 @@ namespace datalog {
|
|||
default_table_negation_filter_fn(const table_base & tgt, const table_base & neg_t,
|
||||
unsigned joined_col_cnt, const unsigned * t_cols, const unsigned * negated_cols)
|
||||
: convenient_table_negation_filter_fn(tgt, neg_t, joined_col_cnt, t_cols, negated_cols),
|
||||
m_negated_table(0) {
|
||||
m_negated_table(nullptr) {
|
||||
m_aux_fact.resize(neg_t.get_signature().size());
|
||||
}
|
||||
|
||||
|
@ -1603,7 +1603,7 @@ namespace datalog {
|
|||
SASSERT(t.get_signature().functional_columns()>0);
|
||||
table_plugin & plugin = t.get_plugin();
|
||||
m_aux_table = plugin.mk_empty(t.get_signature());
|
||||
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 *>(nullptr));
|
||||
}
|
||||
|
||||
~default_table_map_fn() override {}
|
||||
|
@ -1625,7 +1625,7 @@ namespace datalog {
|
|||
}
|
||||
|
||||
t.reset();
|
||||
(*m_union_fn)(t, *m_aux_table, static_cast<table_base *>(0));
|
||||
(*m_union_fn)(t, *m_aux_table, static_cast<table_base *>(nullptr));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -109,8 +109,8 @@ namespace datalog {
|
|||
public:
|
||||
relation_manager(context & ctx) :
|
||||
m_context(ctx),
|
||||
m_favourite_table_plugin(0),
|
||||
m_favourite_relation_plugin(0),
|
||||
m_favourite_table_plugin(nullptr),
|
||||
m_favourite_relation_plugin(nullptr),
|
||||
m_next_table_fid(0),
|
||||
m_next_relation_fid(0) {}
|
||||
|
||||
|
@ -331,7 +331,7 @@ namespace datalog {
|
|||
const relation_base * delta);
|
||||
|
||||
relation_union_fn * mk_union_fn(const relation_base & tgt, const relation_base & src) {
|
||||
return mk_union_fn(tgt, src, static_cast<relation_base *>(0));
|
||||
return mk_union_fn(tgt, src, static_cast<relation_base *>(nullptr));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -510,7 +510,7 @@ namespace datalog {
|
|||
const table_base * delta);
|
||||
|
||||
table_union_fn * mk_union_fn(const table_base & tgt, const table_base & src) {
|
||||
return mk_union_fn(tgt, src, static_cast<table_base *>(0));
|
||||
return mk_union_fn(tgt, src, static_cast<table_base *>(nullptr));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -226,7 +226,7 @@ namespace datalog {
|
|||
|
||||
relation_base * sieve_relation_plugin::mk_empty(const relation_signature & s) {
|
||||
UNREACHABLE();
|
||||
return 0;
|
||||
return nullptr;
|
||||
#if 0
|
||||
svector<bool> inner_cols(s.size());
|
||||
extract_inner_columns(s, inner_cols.c_ptr());
|
||||
|
@ -278,8 +278,8 @@ namespace datalog {
|
|||
m_inner_join_fun(inner_join_fun) {
|
||||
bool r1_sieved = r1.get_plugin().is_sieve_relation();
|
||||
bool r2_sieved = r2.get_plugin().is_sieve_relation();
|
||||
const sieve_relation * sr1 = r1_sieved ? static_cast<const sieve_relation *>(&r1) : 0;
|
||||
const sieve_relation * sr2 = r2_sieved ? static_cast<const sieve_relation *>(&r2) : 0;
|
||||
const sieve_relation * sr1 = r1_sieved ? static_cast<const sieve_relation *>(&r1) : nullptr;
|
||||
const sieve_relation * sr2 = r2_sieved ? static_cast<const sieve_relation *>(&r2) : nullptr;
|
||||
if(r1_sieved) {
|
||||
m_result_inner_cols.append(sr1->m_inner_cols);
|
||||
}
|
||||
|
@ -298,8 +298,8 @@ namespace datalog {
|
|||
bool r1_sieved = r1.get_plugin().is_sieve_relation();
|
||||
bool r2_sieved = r2.get_plugin().is_sieve_relation();
|
||||
SASSERT(r1_sieved || r2_sieved);
|
||||
const sieve_relation * sr1 = r1_sieved ? static_cast<const sieve_relation *>(&r1) : 0;
|
||||
const sieve_relation * sr2 = r2_sieved ? static_cast<const sieve_relation *>(&r2) : 0;
|
||||
const sieve_relation * sr1 = r1_sieved ? static_cast<const sieve_relation *>(&r1) : nullptr;
|
||||
const sieve_relation * sr2 = r2_sieved ? static_cast<const sieve_relation *>(&r2) : nullptr;
|
||||
const relation_base & inner1 = r1_sieved ? sr1->get_inner() : r1;
|
||||
const relation_base & inner2 = r2_sieved ? sr2->get_inner() : r2;
|
||||
|
||||
|
@ -313,12 +313,12 @@ namespace datalog {
|
|||
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) {
|
||||
if( &r1.get_plugin()!=this && &r2.get_plugin()!=this ) {
|
||||
//we create just operations that involve the current plugin
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
bool r1_sieved = r1.get_plugin().is_sieve_relation();
|
||||
bool r2_sieved = r2.get_plugin().is_sieve_relation();
|
||||
const sieve_relation * sr1 = r1_sieved ? static_cast<const sieve_relation *>(&r1) : 0;
|
||||
const sieve_relation * sr2 = r2_sieved ? static_cast<const sieve_relation *>(&r2) : 0;
|
||||
const sieve_relation * sr1 = r1_sieved ? static_cast<const sieve_relation *>(&r1) : nullptr;
|
||||
const sieve_relation * sr2 = r2_sieved ? static_cast<const sieve_relation *>(&r2) : nullptr;
|
||||
const relation_base & inner1 = r1_sieved ? sr1->get_inner() : r1;
|
||||
const relation_base & inner2 = r2_sieved ? sr2->get_inner() : r2;
|
||||
|
||||
|
@ -340,7 +340,7 @@ namespace datalog {
|
|||
|
||||
relation_join_fn * inner_join_fun = get_manager().mk_join_fn(inner1, inner2, inner_cols1, inner_cols2, false);
|
||||
if(!inner_join_fun) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(join_fn, *this, r1, r2, col_cnt, cols1, cols2, inner_join_fun);
|
||||
}
|
||||
|
@ -371,7 +371,7 @@ namespace datalog {
|
|||
relation_transformer_fn * sieve_relation_plugin::mk_project_fn(const relation_base & r0, unsigned col_cnt,
|
||||
const unsigned * removed_cols) {
|
||||
if(&r0.get_plugin()!=this) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
const sieve_relation & r = static_cast<const sieve_relation &>(r0);
|
||||
unsigned_vector inner_removed_cols;
|
||||
|
@ -398,7 +398,7 @@ namespace datalog {
|
|||
}
|
||||
|
||||
if(!inner_fun) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(transformer_fn, inner_fun, result_sig, result_inner_cols.c_ptr());
|
||||
}
|
||||
|
@ -406,7 +406,7 @@ namespace datalog {
|
|||
relation_transformer_fn * sieve_relation_plugin::mk_rename_fn(const relation_base & r0,
|
||||
unsigned cycle_len, const unsigned * permutation_cycle) {
|
||||
if(&r0.get_plugin()!=this) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
const sieve_relation & r = static_cast<const sieve_relation &>(r0);
|
||||
|
||||
|
@ -428,7 +428,7 @@ namespace datalog {
|
|||
relation_transformer_fn * inner_fun =
|
||||
get_manager().mk_permutation_rename_fn(r.get_inner(), inner_permutation);
|
||||
if(!inner_fun) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(transformer_fn, inner_fun, result_sig, result_inner_cols.c_ptr());
|
||||
}
|
||||
|
@ -443,9 +443,9 @@ namespace datalog {
|
|||
bool tgt_sieved = tgt.get_plugin().is_sieve_relation();
|
||||
bool src_sieved = src.get_plugin().is_sieve_relation();
|
||||
bool delta_sieved = delta && delta->get_plugin().is_sieve_relation();
|
||||
sieve_relation * stgt = tgt_sieved ? static_cast<sieve_relation *>(&tgt) : 0;
|
||||
const sieve_relation * ssrc = src_sieved ? static_cast<const sieve_relation *>(&src) : 0;
|
||||
sieve_relation * sdelta = delta_sieved ? static_cast<sieve_relation *>(delta) : 0;
|
||||
sieve_relation * stgt = tgt_sieved ? static_cast<sieve_relation *>(&tgt) : nullptr;
|
||||
const sieve_relation * ssrc = src_sieved ? static_cast<const sieve_relation *>(&src) : nullptr;
|
||||
sieve_relation * sdelta = delta_sieved ? static_cast<sieve_relation *>(delta) : nullptr;
|
||||
relation_base & itgt = tgt_sieved ? stgt->get_inner() : tgt;
|
||||
const relation_base & isrc = src_sieved ? ssrc->get_inner() : src;
|
||||
relation_base * idelta = delta_sieved ? &sdelta->get_inner() : delta;
|
||||
|
@ -458,15 +458,15 @@ namespace datalog {
|
|||
const relation_base * delta) {
|
||||
if(&tgt.get_plugin()!=this && &src.get_plugin()!=this && (delta && &delta->get_plugin()!=this)) {
|
||||
//we create the operation only if it involves this plugin
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool tgt_sieved = tgt.get_plugin().is_sieve_relation();
|
||||
bool src_sieved = src.get_plugin().is_sieve_relation();
|
||||
bool delta_sieved = delta && delta->get_plugin().is_sieve_relation();
|
||||
const sieve_relation * stgt = tgt_sieved ? static_cast<const sieve_relation *>(&tgt) : 0;
|
||||
const sieve_relation * ssrc = src_sieved ? static_cast<const sieve_relation *>(&src) : 0;
|
||||
const sieve_relation * sdelta = delta_sieved ? static_cast<const sieve_relation *>(delta) : 0;
|
||||
const sieve_relation * stgt = tgt_sieved ? static_cast<const sieve_relation *>(&tgt) : nullptr;
|
||||
const sieve_relation * ssrc = src_sieved ? static_cast<const sieve_relation *>(&src) : nullptr;
|
||||
const sieve_relation * sdelta = delta_sieved ? static_cast<const sieve_relation *>(delta) : nullptr;
|
||||
const relation_base & itgt = tgt_sieved ? stgt->get_inner() : tgt;
|
||||
const relation_base & isrc = src_sieved ? ssrc->get_inner() : src;
|
||||
const relation_base * idelta = delta_sieved ? &sdelta->get_inner() : delta;
|
||||
|
@ -476,7 +476,7 @@ namespace datalog {
|
|||
if( tgt_sieved && src_sieved && (!delta || delta_sieved) ) {
|
||||
if( !vectors_equal(stgt->m_inner_cols, ssrc->m_inner_cols)
|
||||
|| (delta && !vectors_equal(stgt->m_inner_cols, sdelta->m_inner_cols)) ) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -485,13 +485,13 @@ namespace datalog {
|
|||
|| (sdelta && !sdelta->no_sieved_columns()) ) {
|
||||
//We have an unsieved relation and then some relation with some sieved columns,
|
||||
//which means there is an misalignment.
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
relation_union_fn * union_fun = get_manager().mk_union_fn(itgt, isrc, idelta);
|
||||
if(!union_fun) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return alloc(union_fn, union_fun);
|
||||
|
@ -515,7 +515,7 @@ namespace datalog {
|
|||
relation_mutator_fn * sieve_relation_plugin::mk_filter_identical_fn(const relation_base & r0,
|
||||
unsigned col_cnt, const unsigned * identical_cols) {
|
||||
if(&r0.get_plugin()!=this) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
const sieve_relation & r = static_cast<const sieve_relation &>(r0);
|
||||
unsigned_vector inner_icols;
|
||||
|
@ -534,7 +534,7 @@ namespace datalog {
|
|||
|
||||
relation_mutator_fn * inner_fun = get_manager().mk_filter_identical_fn(r.get_inner(), inner_icols);
|
||||
if(!inner_fun) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(filter_fn, inner_fun);
|
||||
}
|
||||
|
@ -542,7 +542,7 @@ namespace datalog {
|
|||
relation_mutator_fn * sieve_relation_plugin::mk_filter_equal_fn(const relation_base & r0,
|
||||
const relation_element & value, unsigned col) {
|
||||
if(&r0.get_plugin()!=this) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
const sieve_relation & r = static_cast<const sieve_relation &>(r0);
|
||||
if(!r.is_inner_col(col)) {
|
||||
|
@ -553,7 +553,7 @@ namespace datalog {
|
|||
|
||||
relation_mutator_fn * inner_fun = get_manager().mk_filter_equal_fn(r.get_inner(), value, inner_col);
|
||||
if(!inner_fun) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(filter_fn, inner_fun);
|
||||
}
|
||||
|
@ -561,7 +561,7 @@ namespace datalog {
|
|||
relation_mutator_fn * sieve_relation_plugin::mk_filter_interpreted_fn(const relation_base & rb,
|
||||
app * condition) {
|
||||
if(&rb.get_plugin()!=this) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
ast_manager & m = get_ast_manager();
|
||||
const sieve_relation & r = static_cast<const sieve_relation &>(rb);
|
||||
|
@ -589,7 +589,7 @@ namespace datalog {
|
|||
|
||||
relation_mutator_fn * inner_fun = get_manager().mk_filter_interpreted_fn(r.get_inner(), to_app(inner_cond));
|
||||
if(!inner_fun) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(filter_fn, inner_fun);
|
||||
}
|
||||
|
@ -604,8 +604,8 @@ namespace datalog {
|
|||
bool r_sieved = r.get_plugin().is_sieve_relation();
|
||||
bool neg_sieved = neg.get_plugin().is_sieve_relation();
|
||||
SASSERT(r_sieved || neg_sieved);
|
||||
sieve_relation * sr = r_sieved ? static_cast<sieve_relation *>(&r) : 0;
|
||||
const sieve_relation * sneg = neg_sieved ? static_cast<const sieve_relation *>(&neg) : 0;
|
||||
sieve_relation * sr = r_sieved ? static_cast<sieve_relation *>(&r) : nullptr;
|
||||
const sieve_relation * sneg = neg_sieved ? static_cast<const sieve_relation *>(&neg) : nullptr;
|
||||
relation_base & inner_r = r_sieved ? sr->get_inner() : r;
|
||||
const relation_base & inner_neg = neg_sieved ? sneg->get_inner() : neg;
|
||||
|
||||
|
@ -618,13 +618,13 @@ namespace datalog {
|
|||
const unsigned * neg_cols) {
|
||||
if(&r.get_plugin()!=this && &neg.get_plugin()!=this) {
|
||||
//we create just operations that involve the current plugin
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
bool r_sieved = r.get_plugin().is_sieve_relation();
|
||||
bool neg_sieved = neg.get_plugin().is_sieve_relation();
|
||||
SASSERT(r_sieved || neg_sieved);
|
||||
const sieve_relation * sr = r_sieved ? static_cast<const sieve_relation *>(&r) : 0;
|
||||
const sieve_relation * sneg = neg_sieved ? static_cast<const sieve_relation *>(&neg) : 0;
|
||||
const sieve_relation * sr = r_sieved ? static_cast<const sieve_relation *>(&r) : nullptr;
|
||||
const sieve_relation * sneg = neg_sieved ? static_cast<const sieve_relation *>(&neg) : nullptr;
|
||||
const relation_base & inner_r = r_sieved ? sr->get_inner() : r;
|
||||
const relation_base & inner_neg = neg_sieved ? sneg->get_inner() : neg;
|
||||
|
||||
|
@ -657,7 +657,7 @@ namespace datalog {
|
|||
relation_intersection_filter_fn * inner_fun =
|
||||
get_manager().mk_filter_by_negation_fn(inner_r, inner_neg, ir_cols, ineg_cols);
|
||||
if(!inner_fun) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(negation_filter_fn, inner_fun);
|
||||
}
|
||||
|
|
|
@ -257,8 +257,8 @@ namespace datalog {
|
|||
\brief Empty result.
|
||||
*/
|
||||
query_result() : m_singleton(false) {
|
||||
m_many.begin = 0;
|
||||
m_many.end = 0;
|
||||
m_many.begin = nullptr;
|
||||
m_many.end = nullptr;
|
||||
}
|
||||
query_result(offset_iterator begin, offset_iterator end) : m_singleton(false) {
|
||||
m_many.begin = begin;
|
||||
|
@ -327,7 +327,7 @@ namespace datalog {
|
|||
key_value key;
|
||||
key.resize(key_len);
|
||||
|
||||
offset_vector * index_entry = 0;
|
||||
offset_vector * index_entry = nullptr;
|
||||
bool key_modified = true;
|
||||
|
||||
for (; ofs!=after_last; ofs+=t.m_fact_size) {
|
||||
|
@ -473,7 +473,7 @@ namespace datalog {
|
|||
#endif
|
||||
key_spec kspec;
|
||||
kspec.append(key_len, key_cols);
|
||||
key_index_map::entry * key_map_entry = m_key_indexes.insert_if_not_there2(kspec, 0);
|
||||
key_index_map::entry * key_map_entry = m_key_indexes.insert_if_not_there2(kspec, nullptr);
|
||||
if (!key_map_entry->get_data().m_value) {
|
||||
if (full_signature_key_indexer::can_handle(key_len, key_cols, *this)) {
|
||||
key_map_entry->get_data().m_value = alloc(full_signature_key_indexer, key_len, key_cols, *this);
|
||||
|
@ -777,9 +777,9 @@ namespace datalog {
|
|||
const table_signature & sig = t->get_signature();
|
||||
t->reset();
|
||||
|
||||
table_pool::entry * e = m_pool.insert_if_not_there2(sig, 0);
|
||||
table_pool::entry * e = m_pool.insert_if_not_there2(sig, nullptr);
|
||||
sp_table_vector * & vect = e->get_data().m_value;
|
||||
if (vect == 0) {
|
||||
if (vect == nullptr) {
|
||||
vect = alloc(sp_table_vector);
|
||||
}
|
||||
IF_VERBOSE(12, verbose_stream() << "Recycle: " << t->get_size_estimate_bytes() << "\n";);
|
||||
|
@ -859,9 +859,9 @@ namespace datalog {
|
|||
if (t1.get_kind()!=get_kind() || t2.get_kind()!=get_kind()
|
||||
|| join_involves_functional(sig1, sig2, col_cnt, cols1, cols2)) {
|
||||
//We also don't allow indexes on functional columns (and they are needed for joins)
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return mk_join_project_fn(t1, t2, col_cnt, cols1, cols2, 0, static_cast<unsigned*>(0));
|
||||
return mk_join_project_fn(t1, t2, col_cnt, cols1, cols2, 0, static_cast<unsigned*>(nullptr));
|
||||
}
|
||||
|
||||
table_join_fn * sparse_table_plugin::mk_join_project_fn(const table_base & t1, const table_base & t2,
|
||||
|
@ -874,7 +874,7 @@ namespace datalog {
|
|||
|| join_involves_functional(sig1, sig2, col_cnt, cols1, cols2)) {
|
||||
//We don't allow sparse tables with zero signatures (and project on all columns leads to such)
|
||||
//We also don't allow indexes on functional columns.
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(join_project_fn, t1.get_signature(), t2.get_signature(), col_cnt, cols1, cols2,
|
||||
removed_col_cnt, removed_cols);
|
||||
|
@ -905,7 +905,7 @@ namespace datalog {
|
|||
|| (delta && delta->get_kind()!=get_kind())
|
||||
|| tgt.get_signature()!=src.get_signature()
|
||||
|| (delta && delta->get_signature()!=tgt.get_signature())) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(union_fn);
|
||||
}
|
||||
|
@ -969,7 +969,7 @@ namespace datalog {
|
|||
table_transformer_fn * sparse_table_plugin::mk_project_fn(const table_base & t, unsigned col_cnt,
|
||||
const unsigned * removed_cols) {
|
||||
if (col_cnt == t.get_signature().size()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(project_fn, t.get_signature(), col_cnt, removed_cols);
|
||||
}
|
||||
|
@ -1032,7 +1032,7 @@ namespace datalog {
|
|||
//column table produces one).
|
||||
//We also don't allow indexes on functional columns. And our implementation of
|
||||
//select_equal_and_project uses index on \c col.
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(select_equal_and_project_fn, t.get_signature(), value, col);
|
||||
}
|
||||
|
@ -1113,7 +1113,7 @@ namespace datalog {
|
|||
table_transformer_fn * sparse_table_plugin::mk_rename_fn(const table_base & t, unsigned permutation_cycle_len,
|
||||
const unsigned * permutation_cycle) {
|
||||
if (t.get_kind()!=get_kind()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(rename_fn, t.get_signature(), permutation_cycle_len, permutation_cycle);
|
||||
}
|
||||
|
@ -1252,7 +1252,7 @@ namespace datalog {
|
|||
if (!check_kind(t) || !check_kind(negated_obj)
|
||||
|| join_involves_functional(t.get_signature(), negated_obj.get_signature(), joined_col_cnt,
|
||||
t_cols, negated_cols) ) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(negation_filter_fn, t, negated_obj, joined_col_cnt, t_cols, negated_cols);
|
||||
}
|
||||
|
@ -1394,7 +1394,7 @@ namespace datalog {
|
|||
return alloc(negated_join_fn, src1, t_cols, src_cols, src1_cols, src2_cols);
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ namespace datalog {
|
|||
table_join_fn * hashtable_table_plugin::mk_join_fn(const table_base & t1, const table_base & t2,
|
||||
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) {
|
||||
if(t1.get_kind()!=get_kind() || t2.get_kind()!=get_kind()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(join_fn, t1.get_signature(), t2.get_signature(), col_cnt, cols1, cols2);
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace datalog {
|
|||
relation_base * table_relation_plugin::mk_empty(const relation_signature & s) {
|
||||
table_signature tsig;
|
||||
if (!get_manager().relation_signature_to_table(s, tsig)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
table_base * t = m_table_plugin.mk_empty(tsig);
|
||||
return alloc(table_relation, *this, s, t);
|
||||
|
@ -57,7 +57,7 @@ namespace datalog {
|
|||
relation_base * table_relation_plugin::mk_full_relation(const relation_signature & s, func_decl* p, family_id kind) {
|
||||
table_signature tsig;
|
||||
if(!get_manager().relation_signature_to_table(s, tsig)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
table_base * t = m_table_plugin.mk_full(p, tsig, kind);
|
||||
return alloc(table_relation, *this, s, t);
|
||||
|
@ -108,25 +108,25 @@ namespace datalog {
|
|||
relation_join_fn * table_relation_plugin::mk_join_fn(const relation_base & r1, const relation_base & r2,
|
||||
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) {
|
||||
if(!r1.from_table() || !r2.from_table()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
const table_relation & tr1 = static_cast<const table_relation &>(r1);
|
||||
const table_relation & tr2 = static_cast<const table_relation &>(r2);
|
||||
|
||||
table_join_fn * tfun = get_manager().mk_join_fn(tr1.get_table(), tr2.get_table(), col_cnt, cols1, cols2);
|
||||
if(!tfun) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return alloc(tr_join_project_fn, r1.get_signature(), r2.get_signature(), col_cnt, cols1,
|
||||
cols2, 0, static_cast<const unsigned *>(0), tfun);
|
||||
cols2, 0, static_cast<const unsigned *>(nullptr), tfun);
|
||||
}
|
||||
|
||||
relation_join_fn * table_relation_plugin::mk_join_project_fn(const relation_base & r1,
|
||||
const relation_base & r2, unsigned joined_col_cnt, const unsigned * cols1, const unsigned * cols2,
|
||||
unsigned removed_col_cnt, const unsigned * removed_cols) {
|
||||
if(!r1.from_table() || !r2.from_table()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
const table_relation & tr1 = static_cast<const table_relation &>(r1);
|
||||
const table_relation & tr2 = static_cast<const table_relation &>(r2);
|
||||
|
@ -168,7 +168,7 @@ namespace datalog {
|
|||
relation_transformer_fn * table_relation_plugin::mk_project_fn(const relation_base & t, unsigned col_cnt,
|
||||
const unsigned * removed_cols) {
|
||||
if(!t.from_table()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
const table_relation & tr = static_cast<const table_relation &>(t);
|
||||
|
||||
|
@ -184,7 +184,7 @@ namespace datalog {
|
|||
relation_transformer_fn * table_relation_plugin::mk_rename_fn(const relation_base & t, unsigned permutation_cycle_len,
|
||||
const unsigned * permutation_cycle) {
|
||||
if(!t.from_table()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
const table_relation & tr = static_cast<const table_relation &>(t);
|
||||
|
||||
|
@ -200,7 +200,7 @@ namespace datalog {
|
|||
relation_transformer_fn * table_relation_plugin::mk_permutation_rename_fn(const relation_base & t,
|
||||
const unsigned * permutation) {
|
||||
if(!t.from_table()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
const table_relation & tr = static_cast<const table_relation &>(t);
|
||||
|
||||
|
@ -216,7 +216,7 @@ namespace datalog {
|
|||
relation_transformer_fn * table_relation_plugin::mk_select_equal_and_project_fn(const relation_base & t,
|
||||
const relation_element & value, unsigned col) {
|
||||
if(!t.from_table()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
const table_relation & tr = static_cast<const table_relation &>(t);
|
||||
|
||||
|
@ -280,7 +280,7 @@ namespace datalog {
|
|||
const table_relation & tr_src = static_cast<const table_relation &>(src);
|
||||
table_relation * tr_delta = static_cast<table_relation *>(delta);
|
||||
|
||||
(*m_tfun)(tr_tgt.get_table(), tr_src.get_table(), tr_delta ? &tr_delta->get_table() : 0);
|
||||
(*m_tfun)(tr_tgt.get_table(), tr_src.get_table(), tr_delta ? &tr_delta->get_table() : nullptr);
|
||||
|
||||
TRACE("dl_table_relation", tout << "# union => "; tr_tgt.get_table().display(tout););
|
||||
}
|
||||
|
@ -289,7 +289,7 @@ namespace datalog {
|
|||
relation_union_fn * table_relation_plugin::mk_union_fn(const relation_base & tgt, const relation_base & src,
|
||||
const relation_base * delta) {
|
||||
if(!src.from_table()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
if(!tgt.from_table() || (delta && !delta->from_table())) {
|
||||
return alloc(universal_target_union_fn);
|
||||
|
@ -299,7 +299,7 @@ namespace datalog {
|
|||
const table_relation * tr_delta = static_cast<const table_relation *>(delta);
|
||||
|
||||
table_union_fn * tfun = get_manager().mk_union_fn(tr_tgt.get_table(), tr_src.get_table(),
|
||||
tr_delta ? &tr_delta->get_table() : 0);
|
||||
tr_delta ? &tr_delta->get_table() : nullptr);
|
||||
SASSERT(tfun);
|
||||
|
||||
return alloc(tr_union_fn, tfun);
|
||||
|
@ -322,7 +322,7 @@ namespace datalog {
|
|||
relation_mutator_fn * table_relation_plugin::mk_filter_identical_fn(const relation_base & t, unsigned col_cnt,
|
||||
const unsigned * identical_cols) {
|
||||
if(!t.from_table()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
const table_relation & tr = static_cast<const table_relation &>(t);
|
||||
|
||||
|
@ -334,7 +334,7 @@ namespace datalog {
|
|||
relation_mutator_fn * table_relation_plugin::mk_filter_equal_fn(const relation_base & t, const relation_element & value,
|
||||
unsigned col) {
|
||||
if(!t.from_table()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
const table_relation & tr = static_cast<const table_relation &>(t);
|
||||
|
||||
|
@ -349,7 +349,7 @@ namespace datalog {
|
|||
relation_mutator_fn * table_relation_plugin::mk_filter_interpreted_fn(const relation_base & t, app * condition) {
|
||||
bool condition_needs_transforming = false;
|
||||
if(!t.from_table() || condition_needs_transforming) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
const table_relation & tr = static_cast<const table_relation &>(t);
|
||||
table_mutator_fn * tfun = get_manager().mk_filter_interpreted_fn(tr.get_table(), condition);
|
||||
|
@ -360,7 +360,7 @@ namespace datalog {
|
|||
relation_transformer_fn * table_relation_plugin::mk_filter_interpreted_and_project_fn(const relation_base & t,
|
||||
app * condition, unsigned removed_col_cnt, const unsigned * removed_cols) {
|
||||
if (!t.from_table())
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
const table_relation & tr = static_cast<const table_relation &>(t);
|
||||
table_transformer_fn * tfun = get_manager().mk_filter_interpreted_and_project_fn(tr.get_table(),
|
||||
|
@ -392,14 +392,14 @@ namespace datalog {
|
|||
relation_intersection_filter_fn * table_relation_plugin::mk_filter_by_intersection_fn(const relation_base & r,
|
||||
const relation_base & src, unsigned joined_col_cnt, const unsigned * r_cols, const unsigned * src_cols) {
|
||||
if(!r.from_table() || !src.from_table()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
const table_relation & tr = static_cast<const table_relation &>(r);
|
||||
const table_relation & tr_neg = static_cast<const table_relation &>(src);
|
||||
table_intersection_filter_fn * tfun = get_manager().mk_filter_by_intersection_fn(tr.get_table(),
|
||||
tr_neg.get_table(), joined_col_cnt, r_cols, src_cols);
|
||||
if(!tfun) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return alloc(tr_intersection_filter_fn, tfun);
|
||||
|
@ -410,7 +410,7 @@ namespace datalog {
|
|||
const relation_base & negated_rel, unsigned joined_col_cnt,
|
||||
const unsigned * r_cols, const unsigned * negated_cols) {
|
||||
if(!r.from_table() || !negated_rel.from_table()) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
const table_relation & tr = static_cast<const table_relation &>(r);
|
||||
const table_relation & tr_neg = static_cast<const table_relation &>(negated_rel);
|
||||
|
|
|
@ -447,7 +447,7 @@ doc* doc_manager::join(const doc& d1, const doc& d2, doc_manager& dm1,
|
|||
}
|
||||
else if (v1 != v2) {
|
||||
// columns don't match
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
SASSERT(well_formed(*d));
|
||||
}
|
||||
|
|
|
@ -373,7 +373,7 @@ class doc_ref {
|
|||
doc_manager& dm;
|
||||
doc* d;
|
||||
public:
|
||||
doc_ref(doc_manager& dm):dm(dm),d(0) {}
|
||||
doc_ref(doc_manager& dm):dm(dm),d(nullptr) {}
|
||||
doc_ref(doc_manager& dm, doc* d):dm(dm),d(d) {}
|
||||
~doc_ref() {
|
||||
if (d) dm.deallocate(d);
|
||||
|
@ -385,8 +385,8 @@ public:
|
|||
}
|
||||
doc& operator*() { return *d; }
|
||||
doc* operator->() { return d; }
|
||||
doc* detach() { doc* r = d; d = 0; return r; }
|
||||
operator bool() const { return d != 0; }
|
||||
doc* detach() { doc* r = d; d = nullptr; return r; }
|
||||
operator bool() const { return d != nullptr; }
|
||||
};
|
||||
|
||||
#endif /* DOC_H_ */
|
||||
|
|
|
@ -90,7 +90,7 @@ namespace datalog {
|
|||
|
||||
karr_relation * complement(func_decl*) const override {
|
||||
UNREACHABLE();
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void to_formula(expr_ref& fml) const override {
|
||||
|
@ -111,8 +111,8 @@ namespace datalog {
|
|||
|
||||
void filter_interpreted(app* cond) {
|
||||
rational one(1), mone(-1);
|
||||
expr* e1 = 0, *e2 = 0, *en = 0;
|
||||
var* v = 0, *w = 0;
|
||||
expr* e1 = nullptr, *e2 = nullptr, *en = nullptr;
|
||||
var* v = nullptr, *w = nullptr;
|
||||
rational n1, n2;
|
||||
expr_ref_vector conjs(m);
|
||||
flatten_and(cond, conjs);
|
||||
|
@ -500,7 +500,7 @@ namespace datalog {
|
|||
}
|
||||
|
||||
relation_base * karr_relation_plugin::mk_empty(const relation_signature & s) {
|
||||
return alloc(karr_relation, *this, 0, s, true);
|
||||
return alloc(karr_relation, *this, nullptr, s, true);
|
||||
}
|
||||
|
||||
relation_base * karr_relation_plugin::mk_full(func_decl* p, const relation_signature & s) {
|
||||
|
@ -518,7 +518,7 @@ namespace datalog {
|
|||
karr_relation const& r1 = get(_r1);
|
||||
karr_relation const& r2 = get(_r2);
|
||||
karr_relation_plugin& p = r1.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(nullptr, get_result_signature()));
|
||||
result->mk_join(r1, r2, m_cols1.size(), m_cols1.c_ptr(), m_cols2.c_ptr());
|
||||
return result;
|
||||
}
|
||||
|
@ -528,7 +528,7 @@ namespace datalog {
|
|||
const relation_base & t1, const relation_base & t2,
|
||||
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) {
|
||||
if (!check_kind(t1) || !check_kind(t2)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(join_fn, t1.get_signature(), t2.get_signature(), col_cnt, cols1, cols2);
|
||||
}
|
||||
|
@ -543,7 +543,7 @@ namespace datalog {
|
|||
relation_base * operator()(const relation_base & _r) override {
|
||||
karr_relation const& r = get(_r);
|
||||
karr_relation_plugin& p = r.get_plugin();
|
||||
karr_relation* result = dynamic_cast<karr_relation*>(p.mk_full(0, get_result_signature()));
|
||||
karr_relation* result = dynamic_cast<karr_relation*>(p.mk_full(nullptr, get_result_signature()));
|
||||
result->mk_project(r, m_removed_cols.size(), m_removed_cols.c_ptr());
|
||||
return result;
|
||||
}
|
||||
|
@ -562,7 +562,7 @@ namespace datalog {
|
|||
relation_base * operator()(const relation_base & _r) override {
|
||||
karr_relation const& r = get(_r);
|
||||
karr_relation_plugin& p = r.get_plugin();
|
||||
karr_relation* result = dynamic_cast<karr_relation*>(p.mk_full(0, get_result_signature()));
|
||||
karr_relation* result = dynamic_cast<karr_relation*>(p.mk_full(nullptr, get_result_signature()));
|
||||
result->mk_rename(r, m_cycle.size(), m_cycle.c_ptr());
|
||||
return result;
|
||||
}
|
||||
|
@ -571,7 +571,7 @@ namespace datalog {
|
|||
relation_transformer_fn * karr_relation_plugin::mk_rename_fn(const relation_base & r,
|
||||
unsigned cycle_len, const unsigned * permutation_cycle) {
|
||||
if (!check_kind(r)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(rename_fn, *this, r.get_signature(), cycle_len, permutation_cycle);
|
||||
}
|
||||
|
@ -687,7 +687,7 @@ namespace datalog {
|
|||
r.mk_union(src, &d);
|
||||
}
|
||||
else {
|
||||
r.mk_union(src, 0);
|
||||
r.mk_union(src, nullptr);
|
||||
}
|
||||
TRACE("dl", r.display(tout << "result:\n"););
|
||||
}
|
||||
|
@ -696,7 +696,7 @@ namespace datalog {
|
|||
relation_union_fn * karr_relation_plugin::mk_union_fn(const relation_base & tgt, const relation_base & src,
|
||||
const relation_base * delta) {
|
||||
if (!check_kind(tgt) || !check_kind(src) || (delta && !check_kind(*delta))) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(union_fn);
|
||||
}
|
||||
|
@ -730,7 +730,7 @@ namespace datalog {
|
|||
relation_mutator_fn * karr_relation_plugin::mk_filter_identical_fn(
|
||||
const relation_base & t, unsigned col_cnt, const unsigned * identical_cols) {
|
||||
if(!check_kind(t)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(filter_identical_fn, col_cnt, identical_cols);
|
||||
}
|
||||
|
@ -768,7 +768,7 @@ namespace datalog {
|
|||
if (check_kind(r)) {
|
||||
return alloc(filter_equal_fn, get_manager(), value, col);
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
@ -789,6 +789,6 @@ namespace datalog {
|
|||
if (check_kind(t)) {
|
||||
return alloc(filter_interpreted_fn, get(t), condition);
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -96,7 +96,7 @@ namespace datalog {
|
|||
m(ctx.get_manager()),
|
||||
m_rmanager(ctx),
|
||||
m_answer(m),
|
||||
m_last_result_relation(0),
|
||||
m_last_result_relation(nullptr),
|
||||
m_ectx(ctx),
|
||||
m_sw(0) {
|
||||
|
||||
|
@ -121,7 +121,7 @@ namespace datalog {
|
|||
rel_context::~rel_context() {
|
||||
if (m_last_result_relation) {
|
||||
m_last_result_relation->deallocate();
|
||||
m_last_result_relation = 0;
|
||||
m_last_result_relation = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@ class tbv_ref {
|
|||
tbv_manager& mgr;
|
||||
tbv* d;
|
||||
public:
|
||||
tbv_ref(tbv_manager& mgr):mgr(mgr),d(0) {}
|
||||
tbv_ref(tbv_manager& mgr):mgr(mgr),d(nullptr) {}
|
||||
tbv_ref(tbv_manager& mgr, tbv* d):mgr(mgr),d(d) {}
|
||||
~tbv_ref() {
|
||||
if (d) mgr.deallocate(d);
|
||||
|
@ -143,7 +143,7 @@ public:
|
|||
tbv& operator*() { return *d; }
|
||||
tbv* operator->() { return d; }
|
||||
tbv* get() { return d; }
|
||||
tbv* detach() { tbv* result = d; d = 0; return result; }
|
||||
tbv* detach() { tbv* result = d; d = nullptr; return result; }
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -203,7 +203,7 @@ namespace datalog {
|
|||
return dynamic_cast<udoc_relation&>(r);
|
||||
}
|
||||
udoc_relation* udoc_plugin::get(relation_base* r) {
|
||||
return r?dynamic_cast<udoc_relation*>(r):0;
|
||||
return r?dynamic_cast<udoc_relation*>(r):nullptr;
|
||||
}
|
||||
udoc_relation const & udoc_plugin::get(relation_base const& r) {
|
||||
return dynamic_cast<udoc_relation const&>(r);
|
||||
|
@ -351,7 +351,7 @@ namespace datalog {
|
|||
const relation_base & t1, const relation_base & t2,
|
||||
unsigned col_cnt, const unsigned * cols1, const unsigned * cols2) {
|
||||
if (!check_kind(t1) || !check_kind(t2)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(join_fn, *this, get(t1), get(t2), col_cnt, cols1, cols2);
|
||||
}
|
||||
|
@ -394,7 +394,7 @@ namespace datalog {
|
|||
const relation_base & t, unsigned col_cnt,
|
||||
const unsigned * removed_cols) {
|
||||
if (!check_kind(t))
|
||||
return 0;
|
||||
return nullptr;
|
||||
return alloc(project_fn, get(t), col_cnt, removed_cols);
|
||||
}
|
||||
|
||||
|
@ -487,7 +487,7 @@ namespace datalog {
|
|||
return alloc(rename_fn, get(r), cycle_len, permutation_cycle);
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
class udoc_plugin::union_fn : public relation_union_fn {
|
||||
|
@ -500,7 +500,7 @@ namespace datalog {
|
|||
udoc_relation const& src = get(_src);
|
||||
udoc_relation* d = get(_delta);
|
||||
doc_manager& dm = r.get_dm();
|
||||
udoc* d1 = 0;
|
||||
udoc* d1 = nullptr;
|
||||
if (d) d1 = &d->get_udoc();
|
||||
IF_VERBOSE(3, r.display(verbose_stream() << "orig: "););
|
||||
r.get_plugin().mk_union(dm, r.get_udoc(), src.get_udoc(), d1);
|
||||
|
@ -539,7 +539,7 @@ namespace datalog {
|
|||
const relation_base & tgt, const relation_base & src,
|
||||
const relation_base * delta) {
|
||||
if (!check_kind(tgt) || !check_kind(src) || (delta && !check_kind(*delta))) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return alloc(union_fn);
|
||||
}
|
||||
|
@ -585,7 +585,7 @@ namespace datalog {
|
|||
};
|
||||
relation_mutator_fn * udoc_plugin::mk_filter_identical_fn(
|
||||
const relation_base & t, unsigned col_cnt, const unsigned * identical_cols) {
|
||||
return check_kind(t)?alloc(filter_identical_fn, t, col_cnt, identical_cols):0;
|
||||
return check_kind(t)?alloc(filter_identical_fn, t, col_cnt, identical_cols):nullptr;
|
||||
}
|
||||
class udoc_plugin::filter_equal_fn : public relation_mutator_fn {
|
||||
doc_manager& dm;
|
||||
|
@ -614,7 +614,7 @@ namespace datalog {
|
|||
relation_mutator_fn * udoc_plugin::mk_filter_equal_fn(
|
||||
const relation_base & t, const relation_element & value, unsigned col) {
|
||||
if (!check_kind(t))
|
||||
return 0;
|
||||
return nullptr;
|
||||
return alloc(filter_equal_fn, *this, get(t), value, col);
|
||||
}
|
||||
|
||||
|
@ -951,7 +951,7 @@ namespace datalog {
|
|||
}
|
||||
};
|
||||
relation_mutator_fn * udoc_plugin::mk_filter_interpreted_fn(const relation_base & t, app * condition) {
|
||||
return check_kind(t)?alloc(filter_interpreted_fn, get(t), get_ast_manager(), condition):0;
|
||||
return check_kind(t)?alloc(filter_interpreted_fn, get(t), get_ast_manager(), condition):nullptr;
|
||||
}
|
||||
|
||||
class udoc_plugin::join_project_fn : public convenient_relation_join_project_fn {
|
||||
|
@ -1055,7 +1055,7 @@ namespace datalog {
|
|||
unsigned joined_col_cnt, const unsigned * cols1, const unsigned * cols2,
|
||||
unsigned removed_col_cnt, const unsigned * removed_cols) {
|
||||
if (!check_kind(t1) || !check_kind(t2))
|
||||
return 0;
|
||||
return nullptr;
|
||||
// special case where we have h(X) :- f(X), g(X).
|
||||
if (joined_col_cnt == removed_col_cnt &&
|
||||
t1.get_signature().size() == joined_col_cnt &&
|
||||
|
@ -1183,7 +1183,7 @@ namespace datalog {
|
|||
const relation_base& neg, unsigned joined_col_cnt, const unsigned *t_cols,
|
||||
const unsigned *negated_cols) {
|
||||
if (!check_kind(t) || !check_kind(neg))
|
||||
return 0;
|
||||
return nullptr;
|
||||
return alloc(negation_filter_fn, get(t), get(neg), joined_col_cnt, t_cols, negated_cols);
|
||||
}
|
||||
|
||||
|
@ -1250,7 +1250,7 @@ namespace datalog {
|
|||
relation_transformer_fn * udoc_plugin::mk_filter_interpreted_and_project_fn(
|
||||
const relation_base & t, app * condition,
|
||||
unsigned removed_col_cnt, const unsigned * removed_cols) {
|
||||
return check_kind(t)?alloc(filter_proj_fn, get(t), get_ast_manager(), condition, removed_col_cnt, removed_cols):0;
|
||||
return check_kind(t)?alloc(filter_proj_fn, get(t), get_ast_manager(), condition, removed_col_cnt, removed_cols):nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace datalog {
|
|||
unsigned get_num_cols() const { return m_column_info.size()-1; }
|
||||
unsigned column_idx(unsigned col) const { return m_column_info[col]; }
|
||||
unsigned column_num_bits(unsigned col) const { return m_column_info[col+1] - m_column_info[col]; }
|
||||
void expand_column_vector(unsigned_vector& v, const udoc_relation* other = 0) const;
|
||||
void expand_column_vector(unsigned_vector& v, const udoc_relation* other = nullptr) const;
|
||||
void extract_guard(expr* condition, expr_ref& guard, expr_ref& rest) const;
|
||||
bool is_guard(expr* g) const;
|
||||
bool is_guard(unsigned n, expr* const *g) const;
|
||||
|
|
|
@ -441,7 +441,7 @@ struct subs_rewriter_cfg : public default_rewriter_cfg {
|
|||
|
||||
bool reduce_var(var * t, expr_ref & result, proof_ref & result_pr) {
|
||||
result = m_c;
|
||||
result_pr = 0;
|
||||
result_pr = nullptr;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -127,7 +127,7 @@ void pred_transformer::init_sig()
|
|||
std::stringstream name_stm;
|
||||
name_stm << m_head->get_name() << '_' << i;
|
||||
func_decl_ref stm(m);
|
||||
stm = m.mk_func_decl(symbol(name_stm.str().c_str()), 0, (sort*const*)0, arg_sort);
|
||||
stm = m.mk_func_decl(symbol(name_stm.str().c_str()), 0, (sort*const*)nullptr, arg_sort);
|
||||
m_sig.push_back(pm.get_o_pred(stm, 0));
|
||||
}
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ bool pred_transformer::is_must_reachable(expr* state, model_ref* model)
|
|||
m_reach_ctx->push ();
|
||||
m_reach_ctx->assert_expr (state);
|
||||
m_reach_ctx->assert_expr (m.mk_not (m_reach_case_vars.back ()));
|
||||
lbool res = m_reach_ctx->check_sat (0, NULL);
|
||||
lbool res = m_reach_ctx->check_sat (0, nullptr);
|
||||
if (model) { m_reach_ctx->get_model(*model); }
|
||||
m_reach_ctx->pop (1);
|
||||
return (res == l_true);
|
||||
|
@ -176,14 +176,14 @@ reach_fact* pred_transformer::get_used_reach_fact (model_evaluator_util& mev,
|
|||
}
|
||||
|
||||
UNREACHABLE ();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
reach_fact *pred_transformer::get_used_origin_reach_fact (model_evaluator_util& mev,
|
||||
unsigned oidx)
|
||||
{
|
||||
expr_ref b(m), v(m);
|
||||
reach_fact *res = NULL;
|
||||
reach_fact *res = nullptr;
|
||||
|
||||
for (unsigned i = 0, sz = m_reach_case_vars.size (); i < sz; i++) {
|
||||
pm.formula_n2o (m_reach_case_vars.get (i), v, oidx);
|
||||
|
@ -219,7 +219,7 @@ datalog::rule const* pred_transformer::find_rule(model &model,
|
|||
// prefer a rule where the model intersects with reach facts of all predecessors;
|
||||
// also find how many predecessors' reach facts are true in the model
|
||||
expr_ref vl(m);
|
||||
datalog::rule const* r = ((datalog::rule*)0);
|
||||
datalog::rule const* r = ((datalog::rule*)nullptr);
|
||||
tag2rule::iterator it = m_tag2rule.begin(), end = m_tag2rule.end();
|
||||
for (; it != end; ++it) {
|
||||
expr* tag = it->m_key;
|
||||
|
@ -392,7 +392,7 @@ expr* pred_transformer::mk_fresh_reach_case_var ()
|
|||
|
||||
name << head ()->get_name () << "#reach_case_" << m_reach_case_vars.size ();
|
||||
decl = m.mk_func_decl (symbol (name.str ().c_str ()), 0,
|
||||
(sort*const*)0, m.mk_bool_sort ());
|
||||
(sort*const*)nullptr, m.mk_bool_sort ());
|
||||
m_reach_case_vars.push_back (m.mk_const (pm.get_n_pred (decl)));
|
||||
return m_reach_case_vars.back ();
|
||||
}
|
||||
|
@ -495,7 +495,7 @@ expr_ref pred_transformer::get_reachable()
|
|||
|
||||
expr* pred_transformer::get_last_reach_case_var () const
|
||||
{
|
||||
return m_reach_case_vars.empty () ? NULL : m_reach_case_vars.back ();
|
||||
return m_reach_case_vars.empty () ? nullptr : m_reach_case_vars.back ();
|
||||
}
|
||||
|
||||
expr_ref pred_transformer::get_cover_delta(func_decl* p_orig, int level)
|
||||
|
@ -557,7 +557,7 @@ expr_ref pred_transformer::get_origin_summary (model_evaluator_util &mev,
|
|||
if (!must) { // use may summary
|
||||
summary.push_back (get_formulas (level, false));
|
||||
// -- no auxiliary variables in lemmas
|
||||
*aux = NULL;
|
||||
*aux = nullptr;
|
||||
} else { // find must summary to use
|
||||
reach_fact *f = get_used_origin_reach_fact (mev, oidx);
|
||||
summary.push_back (f->get ());
|
||||
|
@ -613,12 +613,12 @@ bool pred_transformer::is_blocked (pob &n, unsigned &uses_level)
|
|||
{
|
||||
ensure_level (n.level ());
|
||||
prop_solver::scoped_level _sl (m_solver, n.level ());
|
||||
m_solver.set_core (NULL);
|
||||
m_solver.set_model (NULL);
|
||||
m_solver.set_core (nullptr);
|
||||
m_solver.set_model (nullptr);
|
||||
|
||||
expr_ref_vector post(m), aux(m);
|
||||
post.push_back (n.post ());
|
||||
lbool res = m_solver.check_assumptions (post, aux, 0, NULL, 0);
|
||||
lbool res = m_solver.check_assumptions (post, aux, 0, nullptr, 0);
|
||||
if (res == l_false) { uses_level = m_solver.uses_level(); }
|
||||
return res == l_false;
|
||||
}
|
||||
|
@ -775,7 +775,7 @@ bool pred_transformer::is_invariant(unsigned level, expr* lemma,
|
|||
prop_solver::scoped_level _sl(m_solver, level);
|
||||
prop_solver::scoped_subset_core _sc (m_solver, true);
|
||||
m_solver.set_core(core);
|
||||
m_solver.set_model(0);
|
||||
m_solver.set_model(nullptr);
|
||||
expr * bg = m_extend_lit.get ();
|
||||
lbool r = m_solver.check_assumptions (conj, aux, 1, &bg, 1);
|
||||
if (r == l_false) {
|
||||
|
@ -799,7 +799,7 @@ bool pred_transformer::check_inductive(unsigned level, expr_ref_vector& state,
|
|||
prop_solver::scoped_level _sl(m_solver, level);
|
||||
prop_solver::scoped_subset_core _sc (m_solver, true);
|
||||
m_solver.set_core(&core);
|
||||
m_solver.set_model (0);
|
||||
m_solver.set_model (nullptr);
|
||||
expr_ref_vector aux (m);
|
||||
conj.push_back (m_extend_lit);
|
||||
lbool res = m_solver.check_assumptions (state, aux, conj.size (), conj.c_ptr (), 1);
|
||||
|
@ -1023,7 +1023,7 @@ void pred_transformer::ground_free_vars(expr* e, app_ref_vector& vars,
|
|||
fv(e);
|
||||
|
||||
while (vars.size() < fv.size()) {
|
||||
vars.push_back(0);
|
||||
vars.push_back(nullptr);
|
||||
}
|
||||
for (unsigned i = 0; i < fv.size(); ++i) {
|
||||
if (fv[i] && !vars[i].get()) {
|
||||
|
@ -1110,7 +1110,7 @@ lemma::lemma (ast_manager &manager, expr * body, unsigned lvl) :
|
|||
m_ref_count(0), m(manager),
|
||||
m_body(body, m), m_cube(m),
|
||||
m_bindings(m), m_lvl(lvl),
|
||||
m_pob(0), m_new_pob(false) {
|
||||
m_pob(nullptr), m_new_pob(false) {
|
||||
SASSERT(m_body);
|
||||
normalize(m_body, m_body);
|
||||
}
|
||||
|
@ -1579,7 +1579,7 @@ void derivation::add_premise (pred_transformer &pt,
|
|||
|
||||
pob *derivation::create_first_child (model_evaluator_util &mev)
|
||||
{
|
||||
if (m_premises.empty()) { return NULL; }
|
||||
if (m_premises.empty()) { return nullptr; }
|
||||
m_active = 0;
|
||||
return create_next_child(mev);
|
||||
}
|
||||
|
@ -1602,7 +1602,7 @@ pob *derivation::create_next_child (model_evaluator_util &mev)
|
|||
vars.append (m_premises[m_active].get_ovars ());
|
||||
++m_active;
|
||||
}
|
||||
if (m_active >= m_premises.size()) { return NULL; }
|
||||
if (m_active >= m_premises.size()) { return nullptr; }
|
||||
|
||||
// -- update m_trans with the pre-image of m_trans over the must summaries
|
||||
summaries.push_back (m_trans);
|
||||
|
@ -1621,7 +1621,7 @@ pob *derivation::create_next_child (model_evaluator_util &mev)
|
|||
|
||||
if (!mev.is_true (m_premises[m_active].get_summary())) {
|
||||
IF_VERBOSE(1, verbose_stream() << "Summary unexpectendly not true\n";);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1670,7 +1670,7 @@ pob *derivation::create_next_child (model_evaluator_util &mev)
|
|||
|
||||
pob *derivation::create_next_child ()
|
||||
{
|
||||
if (m_active + 1 >= m_premises.size()) { return NULL; }
|
||||
if (m_active + 1 >= m_premises.size()) { return nullptr; }
|
||||
|
||||
bool use_native_mbp = get_context ().use_native_mbp ();
|
||||
bool ground = get_context ().use_ground_cti ();
|
||||
|
@ -1697,7 +1697,7 @@ pob *derivation::create_next_child ()
|
|||
|
||||
// if not true, bail out, the must summary of m_active is not strong enough
|
||||
// this is possible if m_post was weakened for some reason
|
||||
if (!pt.is_must_reachable(pm.mk_and(summaries), &model)) { return NULL; }
|
||||
if (!pt.is_must_reachable(pm.mk_and(summaries), &model)) { return nullptr; }
|
||||
|
||||
model_evaluator_util mev (m);
|
||||
mev.set_model (*model);
|
||||
|
@ -1848,12 +1848,12 @@ void pob::get_skolems(app_ref_vector &v) {
|
|||
pob* pob_queue::top ()
|
||||
{
|
||||
/// nothing in the queue
|
||||
if (m_obligations.empty()) { return NULL; }
|
||||
if (m_obligations.empty()) { return nullptr; }
|
||||
/// top queue element is above max level
|
||||
if (m_obligations.top()->level() > m_max_level) { return NULL; }
|
||||
if (m_obligations.top()->level() > m_max_level) { return nullptr; }
|
||||
/// top queue element is at the max level, but at a higher than base depth
|
||||
if (m_obligations.top ()->level () == m_max_level &&
|
||||
m_obligations.top()->depth() > m_min_depth) { return NULL; }
|
||||
m_obligations.top()->depth() > m_min_depth) { return nullptr; }
|
||||
|
||||
/// there is something good in the queue
|
||||
return m_obligations.top ().get ();
|
||||
|
@ -1882,10 +1882,10 @@ context::context(fixedpoint_params const& params,
|
|||
ast_manager& m) :
|
||||
m_params(params),
|
||||
m(m),
|
||||
m_context(0),
|
||||
m_context(nullptr),
|
||||
m_pm(params.pdr_max_num_contexts(), m),
|
||||
m_query_pred(m),
|
||||
m_query(0),
|
||||
m_query(nullptr),
|
||||
m_pob_queue(),
|
||||
m_last_result(l_undef),
|
||||
m_inductive_lvl(0),
|
||||
|
@ -1914,7 +1914,7 @@ void context::reset()
|
|||
dealloc(it->m_value);
|
||||
}
|
||||
m_rels.reset();
|
||||
m_query = 0;
|
||||
m_query = nullptr;
|
||||
m_last_result = l_undef;
|
||||
m_inductive_lvl = 0;
|
||||
}
|
||||
|
@ -1985,7 +1985,7 @@ void context::update_rules(datalog::rule_set& rules)
|
|||
init_rules(rules, rels);
|
||||
decl2rel::iterator it = rels.begin(), end = rels.end();
|
||||
for (; it != end; ++it) {
|
||||
pred_transformer* pt = 0;
|
||||
pred_transformer* pt = nullptr;
|
||||
if (m_rels.find(it->m_key, pt)) {
|
||||
it->m_value->inherit_properties(*pt);
|
||||
}
|
||||
|
@ -1999,7 +1999,7 @@ void context::update_rules(datalog::rule_set& rules)
|
|||
|
||||
unsigned context::get_num_levels(func_decl* p)
|
||||
{
|
||||
pred_transformer* pt = 0;
|
||||
pred_transformer* pt = nullptr;
|
||||
if (m_rels.find(p, pt)) {
|
||||
return pt->get_num_levels();
|
||||
} else {
|
||||
|
@ -2010,7 +2010,7 @@ unsigned context::get_num_levels(func_decl* p)
|
|||
|
||||
expr_ref context::get_cover_delta(int level, func_decl* p_orig, func_decl* p)
|
||||
{
|
||||
pred_transformer* pt = 0;
|
||||
pred_transformer* pt = nullptr;
|
||||
if (m_rels.find(p, pt)) {
|
||||
return pt->get_cover_delta(p_orig, level);
|
||||
} else {
|
||||
|
@ -2021,7 +2021,7 @@ expr_ref context::get_cover_delta(int level, func_decl* p_orig, func_decl* p)
|
|||
|
||||
void context::add_cover(int level, func_decl* p, expr* property)
|
||||
{
|
||||
pred_transformer* pt = 0;
|
||||
pred_transformer* pt = nullptr;
|
||||
if (!m_rels.find(p, pt)) {
|
||||
pt = alloc(pred_transformer, *this, get_manager(), p);
|
||||
m_rels.insert(p, pt);
|
||||
|
@ -2036,7 +2036,7 @@ void context::add_invariant (func_decl *p, expr *property)
|
|||
|
||||
expr_ref context::get_reachable(func_decl *p)
|
||||
{
|
||||
pred_transformer* pt = 0;
|
||||
pred_transformer* pt = nullptr;
|
||||
if (!m_rels.find(p, pt))
|
||||
{ return expr_ref(m.mk_false(), m); }
|
||||
return pt->get_reachable();
|
||||
|
@ -2300,7 +2300,7 @@ unsigned context::get_cex_depth()
|
|||
// get current pt and fact
|
||||
pt = pts.get (curr);
|
||||
// check for depth marker
|
||||
if (pt == NULL) {
|
||||
if (pt == nullptr) {
|
||||
++cex_depth;
|
||||
// insert new marker if there are pts at higher depth
|
||||
if (curr + 1 < pts.size()) { pts.push_back(NULL); }
|
||||
|
@ -2635,7 +2635,7 @@ bool context::check_reachability ()
|
|||
while (last_reachable) {
|
||||
checkpoint ();
|
||||
node = last_reachable;
|
||||
last_reachable = NULL;
|
||||
last_reachable = nullptr;
|
||||
if (m_pob_queue.is_root(*node)) { return true; }
|
||||
if (is_reachable (*node->parent())) {
|
||||
last_reachable = node->parent ();
|
||||
|
@ -2751,14 +2751,14 @@ bool context::is_reachable(pob &n)
|
|||
|
||||
// used in case n is reachable
|
||||
bool is_concrete;
|
||||
const datalog::rule * r = NULL;
|
||||
const datalog::rule * r = nullptr;
|
||||
// denotes which predecessor's (along r) reach facts are used
|
||||
vector<bool> reach_pred_used;
|
||||
unsigned num_reuse_reach = 0;
|
||||
|
||||
unsigned saved = n.level ();
|
||||
n.m_level = infty_level ();
|
||||
lbool res = n.pt().is_reachable(n, NULL, &model,
|
||||
lbool res = n.pt().is_reachable(n, nullptr, &model,
|
||||
uses_level, is_concrete, r,
|
||||
reach_pred_used, num_reuse_reach);
|
||||
n.m_level = saved;
|
||||
|
@ -2782,7 +2782,7 @@ bool context::is_reachable(pob &n)
|
|||
|
||||
// if n has a derivation, create a new child and report l_undef
|
||||
// otherwise if n has no derivation or no new children, report l_true
|
||||
pob *next = NULL;
|
||||
pob *next = nullptr;
|
||||
scoped_ptr<derivation> deriv;
|
||||
if (n.has_derivation()) {deriv = n.detach_derivation();}
|
||||
|
||||
|
@ -2854,7 +2854,7 @@ lbool context::expand_node(pob& n)
|
|||
|
||||
// used in case n is reachable
|
||||
bool is_concrete;
|
||||
const datalog::rule * r = NULL;
|
||||
const datalog::rule * r = nullptr;
|
||||
// denotes which predecessor's (along r) reach facts are used
|
||||
vector<bool> reach_pred_used;
|
||||
unsigned num_reuse_reach = 0;
|
||||
|
@ -2899,7 +2899,7 @@ lbool context::expand_node(pob& n)
|
|||
|
||||
// if n has a derivation, create a new child and report l_undef
|
||||
// otherwise if n has no derivation or no new children, report l_true
|
||||
pob *next = NULL;
|
||||
pob *next = nullptr;
|
||||
scoped_ptr<derivation> deriv;
|
||||
if (n.has_derivation()) {deriv = n.detach_derivation();}
|
||||
|
||||
|
@ -3264,7 +3264,7 @@ bool context::create_children(pob& n, datalog::rule const& r,
|
|||
|
||||
pred_transformer &pt = get_pred_transformer (preds [j]);
|
||||
|
||||
const ptr_vector<app> *aux = NULL;
|
||||
const ptr_vector<app> *aux = nullptr;
|
||||
expr_ref sum(m);
|
||||
// XXX This is a bit confusing. The summary is returned over
|
||||
// XXX o-variables. But it is simpler if it is returned over n-variables instead.
|
||||
|
@ -3432,7 +3432,7 @@ void context::add_constraints (unsigned level, const expr_ref& c)
|
|||
expr *e1, *e2;
|
||||
if (m.is_implies(c, e1, e2)) {
|
||||
SASSERT (is_app (e1));
|
||||
pred_transformer *r = 0;
|
||||
pred_transformer *r = nullptr;
|
||||
if (m_rels.find (to_app (e1)->get_decl (), r))
|
||||
{ r->add_lemma(e2, level); }
|
||||
}
|
||||
|
|
|
@ -323,7 +323,7 @@ public:
|
|||
{
|
||||
for (unsigned i = 0, sz = m_reach_facts.size (); i < sz; ++i)
|
||||
if(v == m_reach_facts [i]->get()) { return m_reach_facts[i]; }
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void add_rule(datalog::rule* r) { m_rules.push_back(r); }
|
||||
|
@ -348,7 +348,7 @@ public:
|
|||
void collect_statistics(statistics& st) const;
|
||||
void reset_statistics();
|
||||
|
||||
bool is_must_reachable (expr* state, model_ref* model = 0);
|
||||
bool is_must_reachable (expr* state, model_ref* model = nullptr);
|
||||
/// \brief Returns reachability fact active in the given model
|
||||
/// all determines whether initial reachability facts are included as well
|
||||
reach_fact *get_used_reach_fact (model_evaluator_util& mev, bool all = true);
|
||||
|
@ -397,7 +397,7 @@ public:
|
|||
vector<bool>& reach_pred_used,
|
||||
unsigned& num_reuse_reach);
|
||||
bool is_invariant(unsigned level, expr* lemma,
|
||||
unsigned& solver_level, expr_ref_vector* core = 0);
|
||||
unsigned& solver_level, expr_ref_vector* core = nullptr);
|
||||
bool check_inductive(unsigned level, expr_ref_vector& state,
|
||||
unsigned& assumes_level);
|
||||
|
||||
|
@ -475,7 +475,7 @@ public:
|
|||
void set_derivation (derivation *d) {m_derivation = d;}
|
||||
bool has_derivation () const {return (bool)m_derivation;}
|
||||
derivation &get_derivation() const {return *m_derivation.get ();}
|
||||
void reset_derivation () {set_derivation (NULL);}
|
||||
void reset_derivation () {set_derivation (nullptr);}
|
||||
/// detaches derivation from the node without deallocating
|
||||
derivation* detach_derivation () {return m_derivation.detach ();}
|
||||
|
||||
|
@ -503,7 +503,7 @@ public:
|
|||
/// clean a dirty node
|
||||
void clean();
|
||||
|
||||
void reset () {clean (); m_derivation = NULL; m_open = true;}
|
||||
void reset () {clean (); m_derivation = nullptr; m_open = true;}
|
||||
|
||||
bool is_closed () const { return !m_open; }
|
||||
void close();
|
||||
|
@ -563,7 +563,7 @@ class derivation {
|
|||
|
||||
public:
|
||||
premise (pred_transformer &pt, unsigned oidx, expr *summary, bool must,
|
||||
const ptr_vector<app> *aux_vars = NULL);
|
||||
const ptr_vector<app> *aux_vars = nullptr);
|
||||
premise (const premise &p);
|
||||
|
||||
bool is_must () {return m_must;}
|
||||
|
@ -575,7 +575,7 @@ class derivation {
|
|||
/// \brief Updated the summary.
|
||||
/// The new summary is over n-variables.
|
||||
void set_summary (expr * summary, bool must,
|
||||
const ptr_vector<app> *aux_vars = NULL);
|
||||
const ptr_vector<app> *aux_vars = nullptr);
|
||||
};
|
||||
|
||||
|
||||
|
@ -600,7 +600,7 @@ public:
|
|||
derivation (pob& parent, datalog::rule const& rule,
|
||||
expr *trans, app_ref_vector const &evars);
|
||||
void add_premise (pred_transformer &pt, unsigned oidx,
|
||||
expr * summary, bool must, const ptr_vector<app> *aux_vars = NULL);
|
||||
expr * summary, bool must, const ptr_vector<app> *aux_vars = nullptr);
|
||||
|
||||
/// creates the first child. Must be called after all the premises
|
||||
/// are added. The model must be valid for the premises
|
||||
|
@ -628,7 +628,7 @@ class pob_queue {
|
|||
pob_ref_gt> m_obligations;
|
||||
|
||||
public:
|
||||
pob_queue(): m_root(NULL), m_max_level(0), m_min_depth(0) {}
|
||||
pob_queue(): m_root(nullptr), m_max_level(0), m_min_depth(0) {}
|
||||
~pob_queue();
|
||||
|
||||
void reset();
|
||||
|
|
|
@ -42,7 +42,7 @@ dl_interface::dl_interface(datalog::context& ctx) :
|
|||
m_ctx(ctx),
|
||||
m_spacer_rules(ctx),
|
||||
m_old_rules(ctx),
|
||||
m_context(0),
|
||||
m_context(nullptr),
|
||||
m_refs(ctx.get_manager())
|
||||
{
|
||||
m_context = alloc(spacer::context, ctx.get_params(), ctx.get_manager());
|
||||
|
|
|
@ -161,7 +161,7 @@ class collect_array_proc {
|
|||
sort *m_sort;
|
||||
public:
|
||||
collect_array_proc(ast_manager &m, func_decl_set& s) :
|
||||
m_au(m), m_symbs(s), m_sort(NULL) {}
|
||||
m_au(m), m_symbs(s), m_sort(nullptr) {}
|
||||
|
||||
void operator()(app* a)
|
||||
{
|
||||
|
|
|
@ -146,7 +146,7 @@ app* itp_solver::def_manager::mk_proxy (expr *v)
|
|||
|
||||
bool itp_solver::def_manager::is_proxy (app *k, app_ref &def)
|
||||
{
|
||||
app *r = NULL;
|
||||
app *r = nullptr;
|
||||
bool found = m_proxy2def.find (k, r);
|
||||
def = r;
|
||||
return found;
|
||||
|
|
|
@ -80,7 +80,7 @@ void model_evaluator::reset()
|
|||
m_visited.reset();
|
||||
m_numbers.reset();
|
||||
m_refs.reset();
|
||||
m_model = 0;
|
||||
m_model = nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -43,10 +43,10 @@ prop_solver::prop_solver(manager& pm, fixedpoint_params const& p, symbol const&
|
|||
m(pm.get_manager()),
|
||||
m_pm(pm),
|
||||
m_name(name),
|
||||
m_ctx(NULL),
|
||||
m_ctx(nullptr),
|
||||
m_pos_level_atoms(m),
|
||||
m_neg_level_atoms(m),
|
||||
m_core(0),
|
||||
m_core(nullptr),
|
||||
m_subset_based_core(false),
|
||||
m_uses_level(infty_level()),
|
||||
m_delta_level(false),
|
||||
|
@ -72,7 +72,7 @@ void prop_solver::add_level()
|
|||
unsigned idx = level_cnt();
|
||||
std::stringstream name;
|
||||
name << m_name << "#level_" << idx;
|
||||
func_decl * lev_pred = m.mk_fresh_func_decl(name.str().c_str(), 0, 0, m.mk_bool_sort());
|
||||
func_decl * lev_pred = m.mk_fresh_func_decl(name.str().c_str(), 0, nullptr, m.mk_bool_sort());
|
||||
m_level_preds.push_back(lev_pred);
|
||||
|
||||
app_ref pos_la(m.mk_const(lev_pred), m);
|
||||
|
@ -196,7 +196,7 @@ lbool prop_solver::internal_check_assumptions(
|
|||
// XXX Turn model generation if m_model != 0
|
||||
SASSERT(m_ctx);
|
||||
SASSERT(m_ctx_fparams);
|
||||
flet<bool> _model(m_ctx_fparams->m_model, m_model != 0);
|
||||
flet<bool> _model(m_ctx_fparams->m_model, m_model != nullptr);
|
||||
|
||||
if (m_in_level) { assert_level_atoms(m_current_level); }
|
||||
lbool result = maxsmt(hard_atoms, soft_atoms);
|
||||
|
@ -280,8 +280,8 @@ lbool prop_solver::check_assumptions(const expr_ref_vector & _hard,
|
|||
SASSERT(soft_sz >= soft.size());
|
||||
|
||||
// -- reset all parameters
|
||||
m_core = 0;
|
||||
m_model = 0;
|
||||
m_core = nullptr;
|
||||
m_model = nullptr;
|
||||
m_subset_based_core = false;
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ public:
|
|||
lbool check_assumptions(const expr_ref_vector & hard,
|
||||
expr_ref_vector & soft,
|
||||
unsigned num_bg = 0,
|
||||
expr * const *bg = NULL,
|
||||
expr * const *bg = nullptr,
|
||||
unsigned solver_id = 0);
|
||||
|
||||
void collect_statistics(statistics& st) const;
|
||||
|
|
|
@ -595,7 +595,7 @@ namespace qe {
|
|||
// c*x + t = 0 <=> x = -t/c
|
||||
expr_ref eq_term (mk_mul (-(rational::one ()/m_coeffs[eq_idx]), m_terms.get (eq_idx)), m);
|
||||
m_rw (eq_term);
|
||||
map.insert (m_var->x (), eq_term, 0);
|
||||
map.insert (m_var->x (), eq_term, nullptr);
|
||||
TRACE ("qe",
|
||||
tout << "Using equality term: " << mk_pp (eq_term, m) << "\n";
|
||||
);
|
||||
|
@ -680,7 +680,7 @@ namespace qe {
|
|||
} else {
|
||||
new_lit = m.mk_true ();
|
||||
}
|
||||
map.insert (m_lits.get (i), new_lit, 0);
|
||||
map.insert (m_lits.get (i), new_lit, nullptr);
|
||||
TRACE ("qe",
|
||||
tout << "Old literal: " << mk_pp (m_lits.get (i), m) << "\n";
|
||||
tout << "New literal: " << mk_pp (new_lit, m) << "\n";
|
||||
|
@ -722,7 +722,7 @@ namespace qe {
|
|||
} else {
|
||||
new_lit = m.mk_true ();
|
||||
}
|
||||
map.insert (m_lits.get (i), new_lit, 0);
|
||||
map.insert (m_lits.get (i), new_lit, nullptr);
|
||||
TRACE ("qe",
|
||||
tout << "Old literal: " << mk_pp (m_lits.get (i), m) << "\n";
|
||||
tout << "New literal: " << mk_pp (new_lit, m) << "\n";
|
||||
|
@ -932,7 +932,7 @@ namespace qe {
|
|||
if (!all_done) continue;
|
||||
// all args so far have been processed
|
||||
// get the correct arg to use
|
||||
proof* pr = 0; expr* new_arg = 0;
|
||||
proof* pr = nullptr; expr* new_arg = nullptr;
|
||||
factored_terms.get (old_arg, new_arg, pr);
|
||||
if (new_arg) {
|
||||
// changed
|
||||
|
@ -965,7 +965,7 @@ namespace qe {
|
|||
mdl.register_decl (new_var->get_decl (), val);
|
||||
}
|
||||
if (changed) {
|
||||
factored_terms.insert (e, new_term, 0);
|
||||
factored_terms.insert (e, new_term, nullptr);
|
||||
}
|
||||
done.mark (e, true);
|
||||
todo.pop_back ();
|
||||
|
@ -973,7 +973,7 @@ namespace qe {
|
|||
}
|
||||
|
||||
// mk new fml
|
||||
proof* pr = 0; expr* new_fml = 0;
|
||||
proof* pr = nullptr; expr* new_fml = nullptr;
|
||||
factored_terms.get (fml, new_fml, pr);
|
||||
if (new_fml) {
|
||||
fml = new_fml;
|
||||
|
@ -994,9 +994,9 @@ namespace qe {
|
|||
* the divisibility atom is a special mod term ((t1-t2) % num == 0)
|
||||
*/
|
||||
void mod2div (expr_ref& fml, expr_map& map) {
|
||||
expr* new_fml = 0;
|
||||
expr* new_fml = nullptr;
|
||||
|
||||
proof *pr = 0;
|
||||
proof *pr = nullptr;
|
||||
map.get (fml, new_fml, pr);
|
||||
if (new_fml) {
|
||||
fml = new_fml;
|
||||
|
@ -1065,7 +1065,7 @@ namespace qe {
|
|||
new_fml = m.mk_app (a->get_decl (), children.size (), children.c_ptr ());
|
||||
}
|
||||
|
||||
map.insert (fml, new_fml, 0);
|
||||
map.insert (fml, new_fml, nullptr);
|
||||
fml = new_fml;
|
||||
}
|
||||
|
||||
|
@ -1133,7 +1133,7 @@ namespace qe {
|
|||
z);
|
||||
}
|
||||
}
|
||||
map.insert (m_lits.get (i), new_lit, 0);
|
||||
map.insert (m_lits.get (i), new_lit, nullptr);
|
||||
TRACE ("qe",
|
||||
tout << "Old literal: " << mk_pp (m_lits.get (i), m) << "\n";
|
||||
tout << "New literal: " << mk_pp (new_lit, m) << "\n";
|
||||
|
@ -1145,7 +1145,7 @@ namespace qe {
|
|||
expr_substitution sub (m);
|
||||
// literals
|
||||
for (unsigned i = 0; i < lits.size (); i++) {
|
||||
expr* new_lit = 0; proof* pr = 0;
|
||||
expr* new_lit = nullptr; proof* pr = nullptr;
|
||||
app* old_lit = lits.get (i);
|
||||
map.get (old_lit, new_lit, pr);
|
||||
if (new_lit) {
|
||||
|
@ -1157,7 +1157,7 @@ namespace qe {
|
|||
}
|
||||
}
|
||||
// substitute for x, if any
|
||||
expr* x_term = 0; proof* pr = 0;
|
||||
expr* x_term = nullptr; proof* pr = nullptr;
|
||||
map.get (m_var->x (), x_term, pr);
|
||||
if (x_term) {
|
||||
sub.insert (m_var->x (), x_term);
|
||||
|
@ -1292,9 +1292,9 @@ namespace qe {
|
|||
model_evaluator_array_util m_mev;
|
||||
|
||||
void reset_v () {
|
||||
m_v = 0;
|
||||
m_v = nullptr;
|
||||
m_has_stores_v.reset ();
|
||||
m_subst_term_v = 0;
|
||||
m_subst_term_v = nullptr;
|
||||
m_true_sub_v.reset ();
|
||||
m_false_sub_v.reset ();
|
||||
m_aux_lits_v.reset ();
|
||||
|
@ -1302,7 +1302,7 @@ namespace qe {
|
|||
}
|
||||
|
||||
void reset () {
|
||||
M = 0;
|
||||
M = nullptr;
|
||||
reset_v ();
|
||||
m_aux_vars.reset ();
|
||||
}
|
||||
|
@ -1393,7 +1393,7 @@ namespace qe {
|
|||
todo.push_back (to_app (arg));
|
||||
}
|
||||
else if (all_done) { // all done so far..
|
||||
expr* arg_new = 0; proof* pr;
|
||||
expr* arg_new = nullptr; proof* pr;
|
||||
sel_cache.get (arg, arg_new, pr);
|
||||
if (!arg_new) {
|
||||
arg_new = arg;
|
||||
|
@ -1423,12 +1423,12 @@ namespace qe {
|
|||
}
|
||||
|
||||
if (a != a_new) {
|
||||
sel_cache.insert (a, a_new, 0);
|
||||
sel_cache.insert (a, a_new, nullptr);
|
||||
pinned.push_back (a_new);
|
||||
}
|
||||
done.mark (a, true);
|
||||
}
|
||||
expr* res = 0; proof* pr;
|
||||
expr* res = nullptr; proof* pr;
|
||||
sel_cache.get (fml, res, pr);
|
||||
if (res) {
|
||||
fml = to_app (res);
|
||||
|
@ -1478,7 +1478,7 @@ namespace qe {
|
|||
|
||||
void find_subst_term (app* eq) {
|
||||
app_ref p_exp (m);
|
||||
mk_peq (eq->get_arg (0), eq->get_arg (1), 0, 0, p_exp);
|
||||
mk_peq (eq->get_arg (0), eq->get_arg (1), 0, nullptr, p_exp);
|
||||
bool subst_eq_found = false;
|
||||
while (true) {
|
||||
TRACE ("qe",
|
||||
|
@ -1672,7 +1672,7 @@ namespace qe {
|
|||
expr* rhs = eq->get_arg (1);
|
||||
bool lhs_has_v = (lhs == m_v || m_has_stores_v.is_marked (lhs));
|
||||
bool rhs_has_v = (rhs == m_v || m_has_stores_v.is_marked (rhs));
|
||||
app* store = 0;
|
||||
app* store = nullptr;
|
||||
|
||||
SASSERT (lhs_has_v || rhs_has_v);
|
||||
|
||||
|
@ -1829,7 +1829,7 @@ namespace qe {
|
|||
m_cache.reset ();
|
||||
m_pinned.reset ();
|
||||
m_idx_lits.reset ();
|
||||
M = 0;
|
||||
M = nullptr;
|
||||
m_arr_test.reset ();
|
||||
m_has_stores.reset ();
|
||||
m_reduce_all_selects = false;
|
||||
|
@ -1864,7 +1864,7 @@ namespace qe {
|
|||
bool reduce (expr_ref& e) {
|
||||
if (!is_app (e)) return true;
|
||||
|
||||
expr *r = 0;
|
||||
expr *r = nullptr;
|
||||
if (m_cache.find (e, r)) {
|
||||
e = r;
|
||||
return true;
|
||||
|
@ -1882,7 +1882,7 @@ namespace qe {
|
|||
|
||||
for (unsigned i = 0; i < a->get_num_args (); ++i) {
|
||||
expr *arg = a->get_arg (i);
|
||||
expr *narg = 0;
|
||||
expr *narg = nullptr;
|
||||
|
||||
if (!is_app (arg)) args.push_back (arg);
|
||||
else if (m_cache.find (arg, narg)) {
|
||||
|
@ -2025,7 +2025,7 @@ namespace qe {
|
|||
m_idx_vals.reset ();
|
||||
m_sel_consts.reset ();
|
||||
m_idx_lits.reset ();
|
||||
M = 0;
|
||||
M = nullptr;
|
||||
m_sub.reset ();
|
||||
m_arr_test.reset ();
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ smt_context_manager::~smt_context_manager()
|
|||
virtual_solver* smt_context_manager::mk_fresh()
|
||||
{
|
||||
++m_num_contexts;
|
||||
virtual_solver_factory *solver_factory = 0;
|
||||
virtual_solver_factory *solver_factory = nullptr;
|
||||
|
||||
if (m_max_num_contexts == 0 || m_solvers.size() < m_max_num_contexts) {
|
||||
m_solvers.push_back(alloc(spacer::virtual_solver_factory, m, m_fparams));
|
||||
|
|
|
@ -126,7 +126,7 @@ public:
|
|||
{
|
||||
func_decl * res;
|
||||
if(!m_prefix2prim.find(prefix, res)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ public:
|
|||
{
|
||||
func_decl * prim = try_get_primary_by_prefix(prefix);
|
||||
if(!prim) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return conv(prim, 0, idx);
|
||||
}
|
||||
|
|
|
@ -506,7 +506,7 @@ void unsat_core_plugin_farkas_lemma::compute_linear_combination(const vector<rat
|
|||
std::string name = "w_" + std::to_string(i) + std::to_string(n);
|
||||
|
||||
func_decl_ref decl(m);
|
||||
decl = m.mk_func_decl(symbol(name.c_str()), 0, (sort*const*)0, util.mk_int());
|
||||
decl = m.mk_func_decl(symbol(name.c_str()), 0, (sort*const*)nullptr, util.mk_int());
|
||||
coeffs[i].push_back(m.mk_const(decl));
|
||||
}
|
||||
|
||||
|
@ -516,7 +516,7 @@ void unsat_core_plugin_farkas_lemma::compute_linear_combination(const vector<rat
|
|||
std::string name = "s_" + std::to_string(j) + std::to_string(n);
|
||||
|
||||
func_decl_ref decl(m);
|
||||
decl = m.mk_func_decl(symbol(name.c_str()), 0, (sort*const*)0, util.mk_int());
|
||||
decl = m.mk_func_decl(symbol(name.c_str()), 0, (sort*const*)nullptr, util.mk_int());
|
||||
|
||||
expr_ref s_jn(m);
|
||||
s_jn = m.mk_const(decl);
|
||||
|
@ -556,7 +556,7 @@ void unsat_core_plugin_farkas_lemma::compute_linear_combination(const vector<rat
|
|||
}
|
||||
|
||||
// check result
|
||||
lbool res = s->check_sat(0,0);
|
||||
lbool res = s->check_sat(0,nullptr);
|
||||
|
||||
// if sat extract model and add corresponding linear combinations to core
|
||||
if (res == lbool::l_true) {
|
||||
|
|
|
@ -72,17 +72,17 @@ namespace spacer {
|
|||
//
|
||||
|
||||
model_evaluator_util::model_evaluator_util(ast_manager& m) :
|
||||
m(m), m_mev(nullptr) {
|
||||
reset (nullptr);
|
||||
m(m), m_mev(nullptr) {
|
||||
reset (nullptr);
|
||||
}
|
||||
|
||||
model_evaluator_util::~model_evaluator_util() {reset (NULL);}
|
||||
model_evaluator_util::~model_evaluator_util() {reset (nullptr);}
|
||||
|
||||
|
||||
void model_evaluator_util::reset(model* model) {
|
||||
if (m_mev) {
|
||||
dealloc(m_mev);
|
||||
m_mev = NULL;
|
||||
m_mev = nullptr;
|
||||
}
|
||||
m_model = model;
|
||||
if (!m_model) { return; }
|
||||
|
|
|
@ -162,7 +162,7 @@ void find_decls (expr* fml, app_ref_vector& decls, std::string& prefix);
|
|||
struct mk_epp : public mk_pp {
|
||||
params_ref m_epp_params;
|
||||
expr_ref m_epp_expr;
|
||||
mk_epp(ast *t, ast_manager &m, unsigned indent = 0, unsigned num_vars = 0, char const * var_prefix = 0);
|
||||
mk_epp(ast *t, ast_manager &m, unsigned indent = 0, unsigned num_vars = 0, char const * var_prefix = nullptr);
|
||||
void rw(expr *e, expr_ref &out);
|
||||
|
||||
};
|
||||
|
|
|
@ -257,14 +257,14 @@ void virtual_solver::get_labels(svector<symbol> &r)
|
|||
{
|
||||
r.reset();
|
||||
buffer<symbol> tmp;
|
||||
m_context.get_relevant_labels(0, tmp);
|
||||
m_context.get_relevant_labels(nullptr, tmp);
|
||||
r.append(tmp.size(), tmp.c_ptr());
|
||||
}
|
||||
|
||||
solver* virtual_solver::translate(ast_manager& m, params_ref const& p)
|
||||
{
|
||||
UNREACHABLE();
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
void virtual_solver::updt_params(params_ref const &p)
|
||||
{ m_factory.updt_params(p); }
|
||||
|
|
|
@ -1129,7 +1129,7 @@ namespace tb {
|
|||
}
|
||||
else {
|
||||
change = true;
|
||||
m_rename.push_back(0);
|
||||
m_rename.push_back(nullptr);
|
||||
}
|
||||
}
|
||||
if (change) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -138,8 +138,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() {}
|
||||
|
@ -186,7 +186,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)) {
|
||||
|
||||
|
@ -202,7 +202,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;
|
||||
}
|
||||
};
|
||||
|
@ -262,7 +262,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();
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace datalog {
|
|||
for (unsigned i = 0; i < r->get_uninterpreted_tail_size(); ++i) {
|
||||
func_decl* decl_i = r->get_decl(i);
|
||||
if (m_context.has_facts(decl_i)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool reachable = engine.get_fact(decl_i).is_reachable();
|
||||
|
@ -93,7 +93,7 @@ namespace datalog {
|
|||
}
|
||||
if (res->get_num_rules() == source.get_num_rules()) {
|
||||
TRACE("dl", tout << "No transformation\n";);
|
||||
res = 0;
|
||||
res = nullptr;
|
||||
}
|
||||
else {
|
||||
res->close();
|
||||
|
@ -134,7 +134,7 @@ 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()) {
|
||||
extension_model_converter* mc0 = alloc(extension_model_converter, m);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,7 +601,7 @@ 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);
|
||||
|
@ -612,7 +612,7 @@ namespace datalog {
|
|||
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.
|
||||
|
|
|
@ -191,13 +191,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);
|
||||
|
@ -209,7 +209,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.
|
||||
|
@ -248,7 +248,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);
|
||||
}
|
||||
|
@ -270,7 +270,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);
|
||||
}
|
||||
|
@ -292,7 +292,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) {
|
||||
|
@ -306,7 +306,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.
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -143,7 +143,7 @@ namespace datalog {
|
|||
m_ctx(ctx),
|
||||
a(m),
|
||||
m_refs(m),
|
||||
m_mc(NULL){
|
||||
m_mc(nullptr) {
|
||||
}
|
||||
|
||||
mk_quantifier_abstraction::~mk_quantifier_abstraction() {
|
||||
|
@ -153,7 +153,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();
|
||||
|
@ -164,10 +164,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;
|
||||
|
@ -281,7 +281,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();
|
||||
|
@ -301,13 +301,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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -351,12 +351,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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -549,16 +549,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 +566,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,10 +576,10 @@ 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;
|
||||
res = nullptr;
|
||||
datalog::del_rule(m_mc, *r, false);
|
||||
return true;
|
||||
}
|
||||
|
@ -591,7 +591,7 @@ namespace datalog {
|
|||
}
|
||||
if (!try_to_inline_rule(*r, *inlining_candidate, ti, res)) {
|
||||
datalog::del_rule(m_mc, *r, false);
|
||||
res = 0;
|
||||
res = nullptr;
|
||||
}
|
||||
return true;
|
||||
|
||||
|
@ -852,13 +852,13 @@ 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;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -893,7 +893,7 @@ namespace datalog {
|
|||
}
|
||||
|
||||
if (!something_done) {
|
||||
res = 0;
|
||||
res = nullptr;
|
||||
}
|
||||
else {
|
||||
m_context.add_model_converter(hsmc.get());
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -97,7 +97,7 @@ namespace datalog {
|
|||
|
||||
model_converter * translate(ast_translation & translator) override {
|
||||
UNREACHABLE();
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -116,7 +116,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);
|
||||
|
|
|
@ -127,7 +127,7 @@ namespace datalog {
|
|||
}
|
||||
}
|
||||
if (!has_new_rule) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
else {
|
||||
result->inherit_predicates(src);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
@ -281,7 +281,7 @@ namespace datalog {
|
|||
proof_converter * translate(ast_translation & translator) override {
|
||||
UNREACHABLE();
|
||||
// this would require implementing translation for the dl_context.
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -393,7 +393,7 @@ namespace datalog {
|
|||
|
||||
model_converter * translate(ast_translation & translator) override {
|
||||
UNREACHABLE();
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -405,8 +405,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)
|
||||
{}
|
||||
|
||||
|
||||
|
@ -790,7 +790,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);
|
||||
|
||||
|
@ -805,7 +805,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -819,7 +819,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;
|
||||
|
@ -839,7 +839,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);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue