mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 03:45:51 +00:00
Use nullptr.
This commit is contained in:
parent
f01328c65f
commit
76eb7b9ede
625 changed files with 4639 additions and 4639 deletions
|
@ -120,7 +120,7 @@ class blast_term_ite_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("blast-term-ite", *g);
|
||||
bool produce_proofs = g->proofs_enabled();
|
||||
|
||||
|
|
|
@ -219,7 +219,7 @@ struct cofactor_elim_term_ite::imp {
|
|||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -286,7 +286,7 @@ struct cofactor_elim_term_ite::imp {
|
|||
break;
|
||||
}
|
||||
}
|
||||
expr * best = 0;
|
||||
expr * best = nullptr;
|
||||
unsigned best_occs = 0;
|
||||
obj_map<expr, unsigned>::iterator it = occs.begin();
|
||||
obj_map<expr, unsigned>::iterator end = occs.end();
|
||||
|
@ -329,7 +329,7 @@ struct cofactor_elim_term_ite::imp {
|
|||
bool m_strict_upper;
|
||||
app * m_upper;
|
||||
|
||||
cofactor_rw_cfg(ast_manager & _m, imp & owner, obj_hashtable<expr> * has_term_ite = 0):
|
||||
cofactor_rw_cfg(ast_manager & _m, imp & owner, obj_hashtable<expr> * has_term_ite = nullptr):
|
||||
m(_m),
|
||||
m_owner(owner),
|
||||
m_has_term_ite(has_term_ite),
|
||||
|
@ -349,13 +349,13 @@ struct cofactor_elim_term_ite::imp {
|
|||
if (m.is_not(t)) {
|
||||
m_atom = to_app(t)->get_arg(0);
|
||||
m_sign = true;
|
||||
m_term = 0;
|
||||
m_term = nullptr;
|
||||
// TODO: bounds
|
||||
}
|
||||
else {
|
||||
m_atom = t;
|
||||
m_sign = false;
|
||||
m_term = 0;
|
||||
m_term = nullptr;
|
||||
expr * lhs;
|
||||
expr * rhs;
|
||||
if (m_owner.m_cofactor_equalities && m.is_eq(t, lhs, rhs)) {
|
||||
|
@ -377,19 +377,19 @@ struct cofactor_elim_term_ite::imp {
|
|||
bool rewrite_patterns() const { return false; }
|
||||
|
||||
br_status reduce_app(func_decl * f, unsigned num, expr * const * args, expr_ref & result, proof_ref & result_pr) {
|
||||
result_pr = 0;
|
||||
result_pr = nullptr;
|
||||
return m_mk_app.mk_core(f, num, args, result);
|
||||
}
|
||||
|
||||
bool get_subst(expr * s, expr * & t, proof * & pr) {
|
||||
pr = 0;
|
||||
pr = nullptr;
|
||||
|
||||
if (s == m_atom) {
|
||||
t = m_sign ? m.mk_false() : m.mk_true();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (s == m_term && m_value != 0) {
|
||||
if (s == m_term && m_value != nullptr) {
|
||||
t = m_value;
|
||||
return true;
|
||||
}
|
||||
|
@ -406,7 +406,7 @@ struct cofactor_elim_term_ite::imp {
|
|||
struct cofactor_rw : rewriter_tpl<cofactor_rw_cfg> {
|
||||
cofactor_rw_cfg m_cfg;
|
||||
public:
|
||||
cofactor_rw(ast_manager & m, imp & owner, obj_hashtable<expr> * has_term_ite = 0):
|
||||
cofactor_rw(ast_manager & m, imp & owner, obj_hashtable<expr> * has_term_ite = nullptr):
|
||||
rewriter_tpl<cofactor_rw_cfg>(m, false, m_cfg),
|
||||
m_cfg(m, owner, has_term_ite) {
|
||||
}
|
||||
|
@ -444,7 +444,7 @@ struct cofactor_elim_term_ite::imp {
|
|||
|
||||
bool get_subst(expr * s, expr * & t, proof * & t_pr) {
|
||||
if (m_candidates.contains(s)) {
|
||||
t_pr = 0;
|
||||
t_pr = nullptr;
|
||||
|
||||
if (m_cache.find(s, t))
|
||||
return true;
|
||||
|
@ -455,7 +455,7 @@ struct cofactor_elim_term_ite::imp {
|
|||
while (true) {
|
||||
// expr * c = m_owner.get_best(curr);
|
||||
expr * c = m_owner.get_first(curr);
|
||||
if (c == 0) {
|
||||
if (c == nullptr) {
|
||||
m_cache.insert(s, curr);
|
||||
m_cache_domain.push_back(curr);
|
||||
t = curr.get();
|
||||
|
@ -532,7 +532,7 @@ struct cofactor_elim_term_ite::imp {
|
|||
while (true) {
|
||||
expr * c = m_owner.get_best(curr);
|
||||
// expr * c = m_owner.get_first(curr);
|
||||
if (c == 0) {
|
||||
if (c == nullptr) {
|
||||
r = curr.get();
|
||||
return;
|
||||
}
|
||||
|
@ -607,7 +607,7 @@ struct cofactor_elim_term_ite::imp {
|
|||
unsigned num = to_app(t)->get_num_args();
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
expr * arg = to_app(t)->get_arg(i);
|
||||
expr * new_arg = 0;
|
||||
expr * new_arg = nullptr;
|
||||
TRACE("cofactor_bug", tout << "collecting child: " << arg->get_id() << "\n";);
|
||||
m_cache.find(arg, new_arg);
|
||||
SASSERT(new_arg != 0);
|
||||
|
@ -645,7 +645,7 @@ struct cofactor_elim_term_ite::imp {
|
|||
m_cache_domain.push_back(new_t);
|
||||
m_frames.pop_back();
|
||||
}
|
||||
expr * result = 0;
|
||||
expr * result = nullptr;
|
||||
m_cache.find(t, result);
|
||||
r = result;
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ class cofactor_term_ite_tactic : public tactic {
|
|||
expr * f = g.form(i);
|
||||
expr_ref new_f(m);
|
||||
m_elim_ite(f, new_f);
|
||||
g.update(i, new_f, 0, g.dep(i));
|
||||
g.update(i, new_f, nullptr, g.dep(i));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ public:
|
|||
fail_if_proof_generation("cofactor-term-ite", g);
|
||||
fail_if_unsat_core_generation("cofactor-term-ite", g);
|
||||
tactic_report report("cofactor-term-ite", *g);
|
||||
mc = 0; pc = 0; core = 0;
|
||||
mc = nullptr; pc = nullptr; core = nullptr;
|
||||
process(*(g.get()));
|
||||
g->inc_depth();
|
||||
result.push_back(g.get());
|
||||
|
|
|
@ -66,7 +66,7 @@ public:
|
|||
void operator()(goal_ref const & g, goal_ref_buffer & result,
|
||||
model_converter_ref & mc, proof_converter_ref & pc,
|
||||
expr_dependency_ref & core) override {
|
||||
mc = 0;
|
||||
mc = nullptr;
|
||||
tactic_report report("collect-statistics", *g);
|
||||
|
||||
collect_proc cp(m, m_stats);
|
||||
|
|
|
@ -148,7 +148,7 @@ struct ctx_simplify_tactic::imp {
|
|||
struct cache_cell {
|
||||
expr * m_from;
|
||||
cached_result * m_result;
|
||||
cache_cell():m_from(0), m_result(0) {}
|
||||
cache_cell():m_from(nullptr), m_result(nullptr) {}
|
||||
};
|
||||
|
||||
ast_manager & m;
|
||||
|
@ -217,7 +217,7 @@ struct ctx_simplify_tactic::imp {
|
|||
bool check_cache() {
|
||||
for (unsigned i = 0; i < m_cache.size(); i++) {
|
||||
cache_cell & cell = m_cache[i];
|
||||
if (cell.m_from != 0) {
|
||||
if (cell.m_from != nullptr) {
|
||||
SASSERT(cell.m_result != 0);
|
||||
cached_result * curr = cell.m_result;
|
||||
while (curr) {
|
||||
|
@ -235,10 +235,10 @@ struct ctx_simplify_tactic::imp {
|
|||
m_cache.reserve(id+1);
|
||||
cache_cell & cell = m_cache[id];
|
||||
void * mem = m_allocator.allocate(sizeof(cached_result));
|
||||
if (cell.m_from == 0) {
|
||||
if (cell.m_from == nullptr) {
|
||||
// new_entry
|
||||
cell.m_from = from;
|
||||
cell.m_result = new (mem) cached_result(to, scope_level(), 0);
|
||||
cell.m_result = new (mem) cached_result(to, scope_level(), nullptr);
|
||||
m.inc_ref(from);
|
||||
m.inc_ref(to);
|
||||
}
|
||||
|
@ -281,9 +281,9 @@ struct ctx_simplify_tactic::imp {
|
|||
if (to_delete->m_next) tout << mk_ismt2_pp(to_delete->m_next->m_to, m); else tout << "<null>";
|
||||
tout << "\n";);
|
||||
cell.m_result = to_delete->m_next;
|
||||
if (cell.m_result == 0) {
|
||||
if (cell.m_result == nullptr) {
|
||||
m.dec_ref(cell.m_from);
|
||||
cell.m_from = 0;
|
||||
cell.m_from = nullptr;
|
||||
}
|
||||
m_allocator.deallocate(sizeof(cached_result), to_delete);
|
||||
}
|
||||
|
@ -316,7 +316,7 @@ struct ctx_simplify_tactic::imp {
|
|||
return false;
|
||||
cache_cell & cell = m_cache[id];
|
||||
SASSERT(cell.m_result == 0 || cell.m_result->m_lvl <= scope_level());
|
||||
if (cell.m_result != 0 && cell.m_result->m_lvl == scope_level()) {
|
||||
if (cell.m_result != nullptr && cell.m_result->m_lvl == scope_level()) {
|
||||
SASSERT(cell.m_from == t);
|
||||
SASSERT(cell.m_result->m_to != 0);
|
||||
r = cell.m_result->m_to;
|
||||
|
@ -326,7 +326,7 @@ struct ctx_simplify_tactic::imp {
|
|||
}
|
||||
|
||||
void simplify(expr * t, expr_ref & r) {
|
||||
r = 0;
|
||||
r = nullptr;
|
||||
if (m_depth >= m_max_depth || m_num_steps >= m_max_steps || !is_app(t) || !m_simp->may_simplify(t)) {
|
||||
r = t;
|
||||
return;
|
||||
|
@ -534,7 +534,7 @@ struct ctx_simplify_tactic::imp {
|
|||
if (i < sz - 1 && !m.is_true(r) && !m.is_false(r) && !g.dep(i) && !assert_expr(r, false)) {
|
||||
r = m.mk_false();
|
||||
}
|
||||
g.update(i, r, 0, g.dep(i));
|
||||
g.update(i, r, nullptr, g.dep(i));
|
||||
}
|
||||
pop(scope_level() - old_lvl);
|
||||
|
||||
|
@ -549,7 +549,7 @@ struct ctx_simplify_tactic::imp {
|
|||
if (i > 0 && !m.is_true(r) && !m.is_false(r) && !g.dep(i) && !assert_expr(r, false)) {
|
||||
r = m.mk_false();
|
||||
}
|
||||
g.update(i, r, 0, g.dep(i));
|
||||
g.update(i, r, nullptr, g.dep(i));
|
||||
}
|
||||
pop(scope_level() - old_lvl);
|
||||
SASSERT(scope_level() == 0);
|
||||
|
@ -582,7 +582,7 @@ struct ctx_simplify_tactic::imp {
|
|||
for (unsigned i = 0; !g.inconsistent() && i < sz; ++i) {
|
||||
expr * t = g.form(i);
|
||||
process(t, r);
|
||||
proof* new_pr = m.mk_modus_ponens(g.pr(i), m.mk_rewrite_star(t, r, 0, 0)); // TODO :-)
|
||||
proof* new_pr = m.mk_modus_ponens(g.pr(i), m.mk_rewrite_star(t, r, 0, nullptr)); // TODO :-)
|
||||
g.update(i, r, new_pr, g.dep(i));
|
||||
}
|
||||
}
|
||||
|
@ -625,7 +625,7 @@ void ctx_simplify_tactic::operator()(goal_ref const & in,
|
|||
model_converter_ref & mc,
|
||||
proof_converter_ref & pc,
|
||||
expr_dependency_ref & core) {
|
||||
mc = 0; pc = 0; core = 0;
|
||||
mc = nullptr; pc = nullptr; core = nullptr;
|
||||
(*m_imp)(*(in.get()));
|
||||
in->inc_depth();
|
||||
result.push_back(in.get());
|
||||
|
|
|
@ -78,7 +78,7 @@ public:
|
|||
model_converter_ref & mc,
|
||||
proof_converter_ref & pc,
|
||||
expr_dependency_ref & core) override {
|
||||
mc = 0; pc = 0; core = 0;
|
||||
mc = nullptr; pc = nullptr; core = nullptr;
|
||||
(*m_imp)(*(in.get()));
|
||||
in->inc_depth();
|
||||
result.push_back(in.get());
|
||||
|
|
|
@ -93,7 +93,7 @@ class distribute_forall_tactic : public tactic {
|
|||
rw * m_rw;
|
||||
|
||||
public:
|
||||
distribute_forall_tactic():m_rw(0) {}
|
||||
distribute_forall_tactic():m_rw(nullptr) {}
|
||||
|
||||
tactic * translate(ast_manager & m) override {
|
||||
return alloc(distribute_forall_tactic);
|
||||
|
@ -109,7 +109,7 @@ public:
|
|||
bool produce_proofs = g->proofs_enabled();
|
||||
rw r(m, produce_proofs);
|
||||
m_rw = &r;
|
||||
mc = 0; pc = 0; core = 0; result.reset();
|
||||
mc = nullptr; pc = nullptr; core = nullptr; result.reset();
|
||||
tactic_report report("distribute-forall", *g);
|
||||
|
||||
expr_ref new_curr(m);
|
||||
|
@ -131,7 +131,7 @@ public:
|
|||
result.push_back(g.get());
|
||||
TRACE("distribute-forall", g->display(tout););
|
||||
SASSERT(g->is_well_sorted());
|
||||
m_rw = 0;
|
||||
m_rw = nullptr;
|
||||
}
|
||||
|
||||
void cleanup() override {}
|
||||
|
|
|
@ -100,7 +100,7 @@ bool expr_dominators::compute_dominators() {
|
|||
for (unsigned i = 0; i + 1 < m_post2expr.size(); ++i) {
|
||||
expr * child = m_post2expr[i];
|
||||
ptr_vector<expr> const& p = m_parents[child];
|
||||
expr * new_idom = 0, *idom2 = 0;
|
||||
expr * new_idom = nullptr, *idom2 = nullptr;
|
||||
|
||||
for (expr * pred : p) {
|
||||
if (m_doms.contains(pred)) {
|
||||
|
@ -189,7 +189,7 @@ void dom_simplify_tactic::operator()(
|
|||
model_converter_ref & mc,
|
||||
proof_converter_ref & pc,
|
||||
expr_dependency_ref & core) {
|
||||
mc = 0; pc = 0; core = 0;
|
||||
mc = nullptr; pc = nullptr; core = nullptr;
|
||||
|
||||
tactic_report report("dom-simplify", *in.get());
|
||||
simplify_goal(*(in.get()));
|
||||
|
@ -207,7 +207,7 @@ void dom_simplify_tactic::cleanup() {
|
|||
|
||||
expr_ref dom_simplify_tactic::simplify_ite(app * ite) {
|
||||
expr_ref r(m);
|
||||
expr * c = 0, *t = 0, *e = 0;
|
||||
expr * c = nullptr, *t = nullptr, *e = nullptr;
|
||||
VERIFY(m.is_ite(ite, c, t, e));
|
||||
unsigned old_lvl = scope_level();
|
||||
expr_ref new_c = simplify_arg(c);
|
||||
|
@ -262,7 +262,7 @@ expr_ref dom_simplify_tactic::simplify_arg(expr * e) {
|
|||
*/
|
||||
expr_ref dom_simplify_tactic::simplify_rec(expr * e0) {
|
||||
expr_ref r(m);
|
||||
expr* e = 0;
|
||||
expr* e = nullptr;
|
||||
|
||||
TRACE("simplify", tout << "depth: " << m_depth << " " << mk_pp(e0, m) << "\n";);
|
||||
if (!m_result.find(e0, e)) {
|
||||
|
@ -380,9 +380,9 @@ void dom_simplify_tactic::simplify_goal(goal& g) {
|
|||
}
|
||||
CTRACE("simplify", r != g.form(i), tout << r << " " << mk_pp(g.form(i), m) << "\n";);
|
||||
change |= r != g.form(i);
|
||||
proof* new_pr = 0;
|
||||
proof* new_pr = nullptr;
|
||||
if (g.proofs_enabled()) {
|
||||
new_pr = m.mk_modus_ponens(g.pr(i), m.mk_rewrite_star(g.form(i), r, 0, 0));
|
||||
new_pr = m.mk_modus_ponens(g.pr(i), m.mk_rewrite_star(g.form(i), r, 0, nullptr));
|
||||
}
|
||||
g.update(i, r, new_pr, g.dep(i));
|
||||
}
|
||||
|
@ -400,9 +400,9 @@ void dom_simplify_tactic::simplify_goal(goal& g) {
|
|||
}
|
||||
change |= r != g.form(i);
|
||||
CTRACE("simplify", r != g.form(i), tout << r << " " << mk_pp(g.form(i), m) << "\n";);
|
||||
proof* new_pr = 0;
|
||||
proof* new_pr = nullptr;
|
||||
if (g.proofs_enabled()) {
|
||||
new_pr = m.mk_modus_ponens(g.pr(i), m.mk_rewrite_star(g.form(i), r, 0, 0));
|
||||
new_pr = m.mk_modus_ponens(g.pr(i), m.mk_rewrite_star(g.form(i), r, 0, nullptr));
|
||||
}
|
||||
g.update(i, r, new_pr, g.dep(i));
|
||||
}
|
||||
|
@ -448,14 +448,14 @@ bool expr_substitution_simplifier::assert_expr(expr * t, bool sign) {
|
|||
m_scoped_substitution.push();
|
||||
expr* tt;
|
||||
if (!sign) {
|
||||
update_substitution(t, 0);
|
||||
update_substitution(t, nullptr);
|
||||
}
|
||||
else if (m.is_not(t, tt)) {
|
||||
update_substitution(tt, 0);
|
||||
update_substitution(tt, nullptr);
|
||||
}
|
||||
else {
|
||||
expr_ref nt(m.mk_not(t), m);
|
||||
update_substitution(nt, 0);
|
||||
update_substitution(nt, nullptr);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ class dom_simplify_tactic : public tactic {
|
|||
|
||||
bool is_subexpr(expr * a, expr * b);
|
||||
|
||||
expr_ref get_cached(expr* t) { expr* r = 0; if (!m_result.find(t, r)) r = t; return expr_ref(r, m); }
|
||||
expr_ref get_cached(expr* t) { expr* r = nullptr; if (!m_result.find(t, r)) r = t; return expr_ref(r, m); }
|
||||
void cache(expr *t, expr* r) { m_result.insert(t, r); m_trail.push_back(r); }
|
||||
|
||||
ptr_vector<expr> const & tree(expr * e);
|
||||
|
|
|
@ -51,7 +51,7 @@ class elim_term_ite_tactic : public tactic {
|
|||
proof_ref new_def_pr(m);
|
||||
app_ref _result(m);
|
||||
if (m_defined_names.mk_name(new_ite, new_def, new_def_pr, _result, result_pr)) {
|
||||
m_goal->assert_expr(new_def, new_def_pr, 0);
|
||||
m_goal->assert_expr(new_def, new_def_pr, nullptr);
|
||||
m_num_fresh++;
|
||||
if (m_produce_models) {
|
||||
if (!m_mc)
|
||||
|
@ -65,9 +65,9 @@ class elim_term_ite_tactic : public tactic {
|
|||
|
||||
rw_cfg(ast_manager & _m, params_ref const & p):
|
||||
m(_m),
|
||||
m_defined_names(m, 0 /* don't use prefix */) {
|
||||
m_defined_names(m, nullptr /* don't use prefix */) {
|
||||
updt_params(p);
|
||||
m_goal = 0;
|
||||
m_goal = nullptr;
|
||||
m_num_fresh = 0;
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ class elim_term_ite_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("elim-term-ite", *g);
|
||||
bool produce_proofs = g->proofs_enabled();
|
||||
m_rw.cfg().m_produce_models = g->models_enabled();
|
||||
|
|
|
@ -95,7 +95,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
return false; // variable already existed for this application
|
||||
}
|
||||
|
||||
v = m().mk_fresh_const(0, m().get_sort(t));
|
||||
v = m().mk_fresh_const(nullptr, m().get_sort(t));
|
||||
TRACE("elim_uncnstr_bug", tout << "eliminating:\n" << mk_ismt2_pp(t, m()) << "\n";);
|
||||
TRACE("elim_uncnstr_bug_ll", tout << "eliminating:\n" << mk_bounded_pp(t, m()) << "\n";);
|
||||
m_fresh_vars.push_back(v);
|
||||
|
@ -220,7 +220,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
t = arg1;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
sort * s = m().get_sort(arg1);
|
||||
|
@ -243,14 +243,14 @@ class elim_uncnstr_tactic : public tactic {
|
|||
// variables.
|
||||
//
|
||||
if (!m().is_fully_interp(s))
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
// If the interpreted sort has only one element,
|
||||
// then it is unsound to eliminate the unconstrained variable in the equality
|
||||
sort_size sz = s->get_num_elements();
|
||||
|
||||
if (sz.is_finite() && sz.size() <= 1)
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
if (!m_mc) {
|
||||
// easy case, model generation is disabled.
|
||||
|
@ -267,7 +267,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
add_def(v, m().mk_ite(u, t, d));
|
||||
return u;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
app * process_basic_app(func_decl * f, unsigned num, expr * const * args) {
|
||||
|
@ -299,7 +299,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
add_def(args[2], r);
|
||||
return r;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
case OP_NOT:
|
||||
SASSERT(num == 1);
|
||||
if (uncnstr(args[0])) {
|
||||
|
@ -310,7 +310,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
add_def(args[0], m().mk_not(r));
|
||||
return r;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
case OP_AND:
|
||||
if (num > 0 && uncnstr(num, args)) {
|
||||
app * r;
|
||||
|
@ -320,7 +320,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
add_defs(num, args, r, m().mk_true());
|
||||
return r;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
case OP_OR:
|
||||
if (num > 0 && uncnstr(num, args)) {
|
||||
app * r;
|
||||
|
@ -330,13 +330,13 @@ class elim_uncnstr_tactic : public tactic {
|
|||
add_defs(num, args, r, m().mk_false());
|
||||
return r;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
case OP_IFF:
|
||||
case OP_EQ:
|
||||
SASSERT(num == 2);
|
||||
return process_eq(f, args[0], args[1]);
|
||||
default:
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -353,7 +353,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
le = !le;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
app * u;
|
||||
if (!mk_fresh_uncnstr_var_for(f, arg1, arg2, u))
|
||||
|
@ -368,9 +368,9 @@ class elim_uncnstr_tactic : public tactic {
|
|||
|
||||
app * process_add(family_id fid, decl_kind add_k, decl_kind sub_k, unsigned num, expr * const * args) {
|
||||
if (num == 0)
|
||||
return 0;
|
||||
return nullptr;
|
||||
unsigned i;
|
||||
expr * v = 0;
|
||||
expr * v = nullptr;
|
||||
for (i = 0; i < num; i++) {
|
||||
expr * arg = args[i];
|
||||
if (uncnstr(arg)) {
|
||||
|
@ -378,8 +378,8 @@ class elim_uncnstr_tactic : public tactic {
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (v == 0)
|
||||
return 0;
|
||||
if (v == nullptr)
|
||||
return nullptr;
|
||||
app * u;
|
||||
if (!mk_fresh_uncnstr_var_for(m().mk_app(fid, add_k, num, args), u))
|
||||
return u;
|
||||
|
@ -407,7 +407,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
|
||||
app * process_arith_mul(func_decl * f, unsigned num, expr * const * args) {
|
||||
if (num == 0)
|
||||
return 0;
|
||||
return nullptr;
|
||||
sort * s = m().get_sort(args[0]);
|
||||
if (uncnstr(num, args)) {
|
||||
app * r;
|
||||
|
@ -422,7 +422,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
rational val;
|
||||
if (num == 2 && uncnstr(args[1]) && m_a_util.is_numeral(args[0], val, is_int) && !is_int) {
|
||||
if (val.is_zero())
|
||||
return 0;
|
||||
return nullptr;
|
||||
app * r;
|
||||
if (!mk_fresh_uncnstr_var_for(f, num, args, r))
|
||||
return r;
|
||||
|
@ -432,7 +432,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
}
|
||||
return r;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
app * process_arith_app(func_decl * f, unsigned num, expr * const * args) {
|
||||
|
@ -450,13 +450,13 @@ class elim_uncnstr_tactic : public tactic {
|
|||
SASSERT(num == 2);
|
||||
return process_le_ge(f, args[0], args[1], false);
|
||||
default:
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
app * process_bv_mul(func_decl * f, unsigned num, expr * const * args) {
|
||||
if (num == 0)
|
||||
return 0;
|
||||
return nullptr;
|
||||
if (uncnstr(num, args)) {
|
||||
sort * s = m().get_sort(args[0]);
|
||||
app * r;
|
||||
|
@ -482,12 +482,12 @@ class elim_uncnstr_tactic : public tactic {
|
|||
add_def(args[1], m_bv_util.mk_bv_mul(m_bv_util.mk_numeral(inv, s), r));
|
||||
return r;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
app * process_extract(func_decl * f, expr * arg) {
|
||||
if (!uncnstr(arg))
|
||||
return 0;
|
||||
return nullptr;
|
||||
app * r;
|
||||
if (!mk_fresh_uncnstr_var_for(f, arg, r))
|
||||
return r;
|
||||
|
@ -523,14 +523,14 @@ class elim_uncnstr_tactic : public tactic {
|
|||
add_def(arg2, m_bv_util.mk_numeral(rational(1), s));
|
||||
return r;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
app * process_concat(func_decl * f, unsigned num, expr * const * args) {
|
||||
if (num == 0)
|
||||
return 0;
|
||||
return nullptr;
|
||||
if (!uncnstr(num, args))
|
||||
return 0;
|
||||
return nullptr;
|
||||
app * r;
|
||||
if (!mk_fresh_uncnstr_var_for(f, num, args, r))
|
||||
return r;
|
||||
|
@ -553,7 +553,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
// The result of bv_le is not just introducing a new fresh name,
|
||||
// we need a side condition.
|
||||
// TODO: the correct proof step
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
if (uncnstr(arg1)) {
|
||||
// v <= t
|
||||
|
@ -593,7 +593,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
add_def(v, m().mk_ite(r, t, m_bv_util.mk_bv_sub(t, m_bv_util.mk_numeral(rational(1), bv_sz))));
|
||||
return r;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
app * process_bv_app(func_decl * f, unsigned num, expr * const * args) {
|
||||
|
@ -630,7 +630,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
add_def(args[0], m().mk_app(f, r));
|
||||
return r;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
case OP_BOR:
|
||||
if (num > 0 && uncnstr(num, args)) {
|
||||
sort * s = m().get_sort(args[0]);
|
||||
|
@ -641,9 +641,9 @@ class elim_uncnstr_tactic : public tactic {
|
|||
add_defs(num, args, r, m_bv_util.mk_numeral(rational(0), s));
|
||||
return r;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
default:
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -660,7 +660,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
add_def(args[0], m_ar_util.mk_const_array(s, r));
|
||||
return r;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
case OP_STORE:
|
||||
if (uncnstr(args[0]) && uncnstr(args[num-1])) {
|
||||
app * r;
|
||||
|
@ -673,7 +673,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
return r;
|
||||
}
|
||||
default:
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -700,7 +700,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
func_decl * c = m_dt_util.get_accessor_constructor(f);
|
||||
for (unsigned i = 0; i < c->get_arity(); i++)
|
||||
if (!m().is_fully_interp(c->get_domain(i)))
|
||||
return 0;
|
||||
return nullptr;
|
||||
app * u;
|
||||
if (!mk_fresh_uncnstr_var_for(f, num, args, u))
|
||||
return u;
|
||||
|
@ -730,7 +730,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
return u;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
br_status reduce_app(func_decl * f, unsigned num, expr * const * args, expr_ref & result, proof_ref & result_pr) {
|
||||
|
@ -745,7 +745,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
return BR_FAILED; // non-ground terms are not handled.
|
||||
}
|
||||
|
||||
app * u = 0;
|
||||
app * u = nullptr;
|
||||
|
||||
if (fid == m().get_basic_family_id())
|
||||
u = process_basic_app(f, num, args);
|
||||
|
@ -758,7 +758,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
else if (fid == m_dt_util.get_family_id())
|
||||
u = process_datatype_app(f, num, args);
|
||||
|
||||
if (u == 0)
|
||||
if (u == nullptr)
|
||||
return BR_FAILED;
|
||||
|
||||
result = u;
|
||||
|
@ -806,7 +806,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
|
||||
void init_mc(bool produce_models) {
|
||||
if (!produce_models) {
|
||||
m_mc = 0;
|
||||
m_mc = nullptr;
|
||||
return;
|
||||
}
|
||||
m_mc = alloc(mc, m());
|
||||
|
@ -821,7 +821,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
model_converter_ref & mc,
|
||||
proof_converter_ref & pc,
|
||||
expr_dependency_ref & core) {
|
||||
mc = 0; pc = 0; core = 0;
|
||||
mc = nullptr; pc = nullptr; core = nullptr;
|
||||
bool produce_models = g->models_enabled();
|
||||
bool produce_proofs = g->proofs_enabled();
|
||||
|
||||
|
@ -867,7 +867,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
}
|
||||
if (!modified) {
|
||||
if (round == 0) {
|
||||
mc = 0;
|
||||
mc = nullptr;
|
||||
}
|
||||
else {
|
||||
app_ref_vector & fresh_vars = m_rw->cfg().m_fresh_vars;
|
||||
|
@ -879,11 +879,11 @@ class elim_uncnstr_tactic : public tactic {
|
|||
mc = concat(fmc, m_mc.get());
|
||||
}
|
||||
else {
|
||||
mc = 0;
|
||||
mc = nullptr;
|
||||
}
|
||||
}
|
||||
m_mc = 0;
|
||||
m_rw = 0;
|
||||
m_mc = nullptr;
|
||||
m_rw = nullptr;
|
||||
TRACE("elim_uncnstr", if (mc) mc->display(tout););
|
||||
result.push_back(g.get());
|
||||
g->inc_depth();
|
||||
|
|
|
@ -149,7 +149,7 @@ class injectivity_tactic : public tactic {
|
|||
proof_converter_ref & pc,
|
||||
expr_dependency_ref & core) {
|
||||
SASSERT(goal->is_well_sorted());
|
||||
mc = 0; pc = 0; core = 0;
|
||||
mc = nullptr; pc = nullptr; core = nullptr;
|
||||
tactic_report report("injectivity", *goal);
|
||||
fail_if_unsat_core_generation("injectivity", goal); // TODO: Support UNSAT cores
|
||||
fail_if_proof_generation("injectivity", goal);
|
||||
|
|
|
@ -33,13 +33,13 @@ class nnf_tactic : public tactic {
|
|||
}
|
||||
|
||||
~set_nnf() {
|
||||
m_owner.m_nnf = 0;
|
||||
m_owner.m_nnf = nullptr;
|
||||
}
|
||||
};
|
||||
public:
|
||||
nnf_tactic(params_ref const & p):
|
||||
m_params(p),
|
||||
m_nnf(0) {
|
||||
m_nnf(nullptr) {
|
||||
TRACE("nnf", tout << "nnf_tactic constructor: " << p << "\n";);
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ public:
|
|||
expr_dependency_ref & core) override {
|
||||
TRACE("nnf", tout << "params: " << m_params << "\n"; g->display(tout););
|
||||
SASSERT(g->is_well_sorted());
|
||||
mc = 0; pc = 0; core = 0;
|
||||
mc = nullptr; pc = nullptr; core = nullptr;
|
||||
tactic_report report("nnf", *g);
|
||||
bool produce_proofs = g->proofs_enabled();
|
||||
|
||||
|
@ -89,9 +89,9 @@ public:
|
|||
sz = defs.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
if (produce_proofs)
|
||||
g->assert_expr(defs.get(i), def_prs.get(i), 0);
|
||||
g->assert_expr(defs.get(i), def_prs.get(i), nullptr);
|
||||
else
|
||||
g->assert_expr(defs.get(i), 0, 0);
|
||||
g->assert_expr(defs.get(i), nullptr, nullptr);
|
||||
}
|
||||
g->inc_depth();
|
||||
result.push_back(g.get());
|
||||
|
|
|
@ -68,7 +68,7 @@ class occf_tactic : public tactic {
|
|||
expr * m_bvar;
|
||||
unsigned m_gen_pos:1;
|
||||
unsigned m_gen_neg:1;
|
||||
bvar_info():m_bvar(0), m_gen_pos(false), m_gen_neg(false) {}
|
||||
bvar_info():m_bvar(nullptr), m_gen_pos(false), m_gen_neg(false) {}
|
||||
bvar_info(expr * var, bool sign):
|
||||
m_bvar(var),
|
||||
m_gen_pos(!sign),
|
||||
|
@ -86,20 +86,20 @@ class occf_tactic : public tactic {
|
|||
}
|
||||
|
||||
cnstr2bvar::obj_map_entry * entry = c2b.find_core(cnstr);
|
||||
if (entry == 0)
|
||||
return 0;
|
||||
if (entry == nullptr)
|
||||
return nullptr;
|
||||
bvar_info & info = entry->get_data().m_value;
|
||||
if (sign) {
|
||||
if (!info.m_gen_neg) {
|
||||
info.m_gen_neg = true;
|
||||
g->assert_expr(m.mk_or(info.m_bvar, m.mk_not(cnstr)), 0, 0);
|
||||
g->assert_expr(m.mk_or(info.m_bvar, m.mk_not(cnstr)), nullptr, nullptr);
|
||||
}
|
||||
return m.mk_not(info.m_bvar);
|
||||
}
|
||||
else {
|
||||
if (!info.m_gen_pos) {
|
||||
info.m_gen_pos = true;
|
||||
g->assert_expr(m.mk_or(m.mk_not(info.m_bvar), cnstr), 0, 0);
|
||||
g->assert_expr(m.mk_or(m.mk_not(info.m_bvar), cnstr), nullptr, nullptr);
|
||||
}
|
||||
return info.m_bvar;
|
||||
}
|
||||
|
@ -113,16 +113,16 @@ class occf_tactic : public tactic {
|
|||
}
|
||||
|
||||
SASSERT(!c2b.contains(cnstr));
|
||||
expr * bvar = m.mk_fresh_const(0, m.mk_bool_sort());
|
||||
expr * bvar = m.mk_fresh_const(nullptr, m.mk_bool_sort());
|
||||
if (produce_models)
|
||||
m_mc->insert(to_app(bvar)->get_decl());
|
||||
c2b.insert(cnstr, bvar_info(bvar, sign));
|
||||
if (sign) {
|
||||
g->assert_expr(m.mk_or(bvar, m.mk_not(cnstr)), 0, 0);
|
||||
g->assert_expr(m.mk_or(bvar, m.mk_not(cnstr)), nullptr, nullptr);
|
||||
return m.mk_not(bvar);
|
||||
}
|
||||
else {
|
||||
g->assert_expr(m.mk_or(m.mk_not(bvar), cnstr), 0, 0);
|
||||
g->assert_expr(m.mk_or(m.mk_not(bvar), cnstr), nullptr, nullptr);
|
||||
return bvar;
|
||||
}
|
||||
}
|
||||
|
@ -133,14 +133,14 @@ class occf_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;
|
||||
|
||||
fail_if_proof_generation("occf", g);
|
||||
|
||||
bool produce_models = g->models_enabled();
|
||||
tactic_report report("occf", *g);
|
||||
|
||||
m_mc = 0;
|
||||
m_mc = nullptr;
|
||||
|
||||
ptr_vector<expr> new_lits;
|
||||
|
||||
|
@ -160,17 +160,17 @@ class occf_tactic : public tactic {
|
|||
m_mc = alloc(filter_model_converter, m);
|
||||
mc = m_mc;
|
||||
}
|
||||
expr * keep = 0;
|
||||
expr * keep = nullptr;
|
||||
new_lits.reset();
|
||||
unsigned num = cls->get_num_args();
|
||||
for (unsigned j = 0; j < num; j++) {
|
||||
expr * l = cls->get_arg(j);
|
||||
if (is_constraint(l)) {
|
||||
expr * new_l = get_aux_lit(c2b, l, g);
|
||||
if (new_l != 0) {
|
||||
if (new_l != nullptr) {
|
||||
new_lits.push_back(new_l);
|
||||
}
|
||||
else if (keep == 0) {
|
||||
else if (keep == nullptr) {
|
||||
keep = l;
|
||||
}
|
||||
else {
|
||||
|
@ -182,9 +182,9 @@ class occf_tactic : public tactic {
|
|||
new_lits.push_back(l);
|
||||
}
|
||||
}
|
||||
if (keep != 0)
|
||||
if (keep != nullptr)
|
||||
new_lits.push_back(keep);
|
||||
g->update(i, m.mk_or(new_lits.size(), new_lits.c_ptr()), 0, d);
|
||||
g->update(i, m.mk_or(new_lits.size(), new_lits.c_ptr()), nullptr, d);
|
||||
}
|
||||
g->inc_depth();
|
||||
result.push_back(g.get());
|
||||
|
|
|
@ -148,7 +148,7 @@ public:
|
|||
proof_converter_ref & pc,
|
||||
expr_dependency_ref & core) override {
|
||||
SASSERT(g->is_well_sorted());
|
||||
pc = 0; core = 0;
|
||||
pc = nullptr; core = nullptr;
|
||||
|
||||
if (g->proofs_enabled()) {
|
||||
throw tactic_exception("pb-preprocess does not support proofs");
|
||||
|
@ -250,7 +250,7 @@ public:
|
|||
if (!to_ge(g->form(k), args2, coeffs2, k2)) continue;
|
||||
if (subsumes(args1, coeffs1, k1, args2, coeffs2, k2)) {
|
||||
IF_VERBOSE(3, verbose_stream() << "replace " << mk_pp(g->form(k), m) << "\n";);
|
||||
g->update(k, m.mk_true(), 0, m.mk_join(g->dep(m_ge[i]), g->dep(k)));
|
||||
g->update(k, m.mk_true(), nullptr, m.mk_join(g->dep(m_ge[i]), g->dep(k)));
|
||||
m_progress = true;
|
||||
}
|
||||
}
|
||||
|
@ -328,12 +328,12 @@ private:
|
|||
for (unsigned j = 0; j < cuts.size(); ++j) {
|
||||
unsigned end = cuts[j];
|
||||
fml1 = decompose_cut(a, start, end, cut_args, cut_coeffs);
|
||||
g->assert_expr(fml1, 0, g->dep(i));
|
||||
g->assert_expr(fml1, nullptr, g->dep(i));
|
||||
start = end;
|
||||
TRACE("pb", tout << fml1 << "\n";);
|
||||
}
|
||||
fml2 = pb.mk_ge(cut_args.size(), cut_coeffs.c_ptr(), cut_args.c_ptr(), pb.get_k(e));
|
||||
g->update(i, fml2, 0, g->dep(i));
|
||||
g->update(i, fml2, nullptr, g->dep(i));
|
||||
TRACE("pb", tout << fml2 << "\n";);
|
||||
}
|
||||
}
|
||||
|
@ -578,8 +578,8 @@ private:
|
|||
tout << "resolve: " << mk_pp(fml1, m) << "\n" << mk_pp(fml2, m) << "\n" << tmp1 << "\n";
|
||||
tout << "to\n" << mk_pp(fml2, m) << " -> " << tmp2 << "\n";);
|
||||
|
||||
g->update(idx2, tmp2, 0, m.mk_join(g->dep(idx1), g->dep(idx2)));
|
||||
g->update(idx1, m.mk_true(), 0, 0);
|
||||
g->update(idx2, tmp2, nullptr, m.mk_join(g->dep(idx1), g->dep(idx2)));
|
||||
g->update(idx1, m.mk_true(), nullptr, nullptr);
|
||||
m_progress = true;
|
||||
//IF_VERBOSE(0, if (!g->inconsistent()) display_annotation(verbose_stream(), g););
|
||||
}
|
||||
|
@ -651,7 +651,7 @@ private:
|
|||
}
|
||||
}
|
||||
}
|
||||
m_r.set_substitution(0);
|
||||
m_r.set_substitution(nullptr);
|
||||
}
|
||||
|
||||
bool subsumes(expr_ref_vector const& args1,
|
||||
|
|
|
@ -38,7 +38,7 @@ class propagate_values_tactic : public tactic {
|
|||
imp(ast_manager & m, params_ref const & p):
|
||||
m(m),
|
||||
m_r(m, p),
|
||||
m_goal(0),
|
||||
m_goal(nullptr),
|
||||
m_occs(m, true /* track atoms */) {
|
||||
updt_params_core(p);
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ class propagate_values_tactic : public tactic {
|
|||
if (m_goal->unsat_core_enabled()) {
|
||||
new_d = m_goal->dep(m_idx);
|
||||
expr_dependency * used_d = m_r.get_used_dependencies();
|
||||
if (used_d != 0) {
|
||||
if (used_d != nullptr) {
|
||||
new_d = m.mk_join(new_d, used_d);
|
||||
m_r.reset_used_dependencies();
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ class propagate_values_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("propagate-values", *g);
|
||||
m_goal = g.get();
|
||||
|
||||
|
@ -210,7 +210,7 @@ class propagate_values_tactic : public tactic {
|
|||
SASSERT(m_goal->is_well_sorted());
|
||||
TRACE("propagate_values", tout << "end\n"; m_goal->display(tout););
|
||||
TRACE("propagate_values_core", m_goal->display_with_dependencies(tout););
|
||||
m_goal = 0;
|
||||
m_goal = nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ struct reduce_args_tactic::imp {
|
|||
}
|
||||
|
||||
static bool may_be_unique(ast_manager& m, bv_util& bv, expr* e, expr*& base) {
|
||||
base = 0;
|
||||
base = nullptr;
|
||||
return m.is_unique_value(e) || is_var_plus_offset(m, bv, e, base);
|
||||
}
|
||||
|
||||
|
@ -341,7 +341,7 @@ struct reduce_args_tactic::imp {
|
|||
}
|
||||
|
||||
br_status reduce_app(func_decl * f, unsigned num, expr * const * args, expr_ref & result, proof_ref & result_pr) {
|
||||
result_pr = 0;
|
||||
result_pr = nullptr;
|
||||
if (f->get_arity() == 0)
|
||||
return BR_FAILED; // ignore constants
|
||||
if (f->get_family_id() != null_family_id)
|
||||
|
@ -357,7 +357,7 @@ struct reduce_args_tactic::imp {
|
|||
}
|
||||
|
||||
app_ref tmp(m.mk_app(f, num, args), m);
|
||||
func_decl *& new_f = map->insert_if_not_there2(tmp, 0)->get_data().m_value;
|
||||
func_decl *& new_f = map->insert_if_not_there2(tmp, nullptr)->get_data().m_value;
|
||||
if (!new_f) {
|
||||
// create fresh symbol
|
||||
ptr_buffer<sort> domain;
|
||||
|
@ -401,7 +401,7 @@ struct reduce_args_tactic::imp {
|
|||
for (; it != end; ++it) {
|
||||
func_decl * f = it->m_key;
|
||||
arg2func * map = it->m_value;
|
||||
expr * def = 0;
|
||||
expr * def = nullptr;
|
||||
SASSERT(decl2args.contains(f));
|
||||
bit_vector & bv = decl2args.find(f);
|
||||
new_vars.reset();
|
||||
|
@ -419,7 +419,7 @@ struct reduce_args_tactic::imp {
|
|||
f_mc->insert(new_def);
|
||||
SASSERT(new_def->get_arity() == new_args.size());
|
||||
app * new_t = m_manager.mk_app(new_def, new_args.size(), new_args.c_ptr());
|
||||
if (def == 0) {
|
||||
if (def == nullptr) {
|
||||
def = new_t;
|
||||
}
|
||||
else {
|
||||
|
@ -494,7 +494,7 @@ void reduce_args_tactic::operator()(goal_ref const & g,
|
|||
SASSERT(g->is_well_sorted());
|
||||
fail_if_proof_generation("reduce-args", g);
|
||||
fail_if_unsat_core_generation("reduce-args", g);
|
||||
mc = 0; pc = 0; core = 0; result.reset();
|
||||
mc = nullptr; pc = nullptr; core = nullptr; result.reset();
|
||||
m_imp->operator()(*(g.get()), mc);
|
||||
g->inc_depth();
|
||||
result.push_back(g.get());
|
||||
|
|
|
@ -101,7 +101,7 @@ void simplify_tactic::operator()(goal_ref const & in,
|
|||
(*m_imp)(*(in.get()));
|
||||
in->inc_depth();
|
||||
result.push_back(in.get());
|
||||
mc = 0; pc = 0; core = 0;
|
||||
mc = nullptr; pc = nullptr; core = nullptr;
|
||||
}
|
||||
catch (rewriter_exception & ex) {
|
||||
throw tactic_exception(ex.msg());
|
||||
|
|
|
@ -53,12 +53,12 @@ class solve_eqs_tactic : public tactic {
|
|||
imp(ast_manager & m, params_ref const & p, expr_replacer * r, bool owner):
|
||||
m_manager(m),
|
||||
m_r(r),
|
||||
m_r_owner(r == 0 || owner),
|
||||
m_r_owner(r == nullptr || owner),
|
||||
m_a_util(m),
|
||||
m_num_steps(0),
|
||||
m_num_eliminated_vars(0) {
|
||||
updt_params(p);
|
||||
if (m_r == 0)
|
||||
if (m_r == nullptr)
|
||||
m_r = mk_default_expr_replacer(m);
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ class solve_eqs_tactic : public tactic {
|
|||
if (is_uninterp_const(lhs) && !m_candidate_vars.is_marked(lhs) && !occurs(lhs, rhs) && check_occs(lhs)) {
|
||||
var = to_app(lhs);
|
||||
def = rhs;
|
||||
pr = 0;
|
||||
pr = nullptr;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
|
@ -333,7 +333,7 @@ class solve_eqs_tactic : public tactic {
|
|||
}
|
||||
|
||||
bool solve(expr * f, app_ref & var, expr_ref & def, proof_ref & pr) {
|
||||
expr* arg1 = 0, *arg2 = 0;
|
||||
expr* arg1 = nullptr, *arg2 = nullptr;
|
||||
if (m().is_eq(f, arg1, arg2)) {
|
||||
if (trivial_solve(arg1, arg2, var, def, pr))
|
||||
return true;
|
||||
|
@ -393,7 +393,7 @@ class solve_eqs_tactic : public tactic {
|
|||
void collect(goal const & g) {
|
||||
m_subst->reset();
|
||||
m_norm_subst->reset();
|
||||
m_r->set_substitution(0);
|
||||
m_r->set_substitution(nullptr);
|
||||
m_candidate_vars.reset();
|
||||
m_candidate_set.reset();
|
||||
m_candidates.reset();
|
||||
|
@ -499,7 +499,7 @@ class solve_eqs_tactic : public tactic {
|
|||
|
||||
// Must save t and its definition.
|
||||
// See comment in the beginning of the function
|
||||
expr * def = 0;
|
||||
expr * def = nullptr;
|
||||
proof * pr;
|
||||
expr_dependency * dep;
|
||||
m_subst->find(to_app(t), def, pr, dep);
|
||||
|
@ -513,7 +513,7 @@ class solve_eqs_tactic : public tactic {
|
|||
else {
|
||||
visiting.mark(t);
|
||||
fr.second = 1;
|
||||
expr * def = 0;
|
||||
expr * def = nullptr;
|
||||
proof * pr;
|
||||
expr_dependency * dep;
|
||||
m_subst->find(to_app(t), def, pr, dep);
|
||||
|
@ -587,9 +587,9 @@ class solve_eqs_tactic : public tactic {
|
|||
for (unsigned idx = 0; idx < size; idx++) {
|
||||
checkpoint();
|
||||
expr * v = m_ordered_vars[idx];
|
||||
expr * def = 0;
|
||||
proof * pr = 0;
|
||||
expr_dependency * dep = 0;
|
||||
expr * def = nullptr;
|
||||
proof * pr = nullptr;
|
||||
expr_dependency * dep = nullptr;
|
||||
m_subst->find(v, def, pr, dep);
|
||||
SASSERT(def != 0);
|
||||
m_r->operator()(def, new_def, new_pr, new_dep);
|
||||
|
@ -645,7 +645,7 @@ class solve_eqs_tactic : public tactic {
|
|||
// so, we must remove remove the mark before doing the update
|
||||
m_candidate_set.mark(f, false);
|
||||
SASSERT(!m_candidate_set.is_marked(f));
|
||||
g.update(idx, m().mk_true(), m().mk_true_proof(), 0);
|
||||
g.update(idx, m().mk_true(), m().mk_true_proof(), nullptr);
|
||||
m_num_steps ++;
|
||||
continue;
|
||||
}
|
||||
|
@ -681,10 +681,10 @@ class solve_eqs_tactic : public tactic {
|
|||
IF_VERBOSE(100, if (!m_ordered_vars.empty()) verbose_stream() << "num. eliminated vars: " << m_ordered_vars.size() << "\n";);
|
||||
m_num_eliminated_vars += m_ordered_vars.size();
|
||||
if (m_produce_models) {
|
||||
if (mc.get() == 0)
|
||||
if (mc.get() == nullptr)
|
||||
mc = alloc(gmc, m());
|
||||
for (app* v : m_ordered_vars) {
|
||||
expr * def = 0;
|
||||
expr * def = nullptr;
|
||||
proof * pr;
|
||||
expr_dependency * dep;
|
||||
m_norm_subst->find(v, def, pr, dep);
|
||||
|
@ -748,7 +748,7 @@ class solve_eqs_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("solve_eqs", *g);
|
||||
m_produce_models = g->models_enabled();
|
||||
m_produce_proofs = g->proofs_enabled();
|
||||
|
@ -768,7 +768,7 @@ class solve_eqs_tactic : public tactic {
|
|||
normalize();
|
||||
substitute(*(g.get()));
|
||||
if (g->inconsistent()) {
|
||||
mc = 0;
|
||||
mc = nullptr;
|
||||
break;
|
||||
}
|
||||
save_elim_vars(mc);
|
||||
|
@ -823,7 +823,7 @@ public:
|
|||
ast_manager & m = m_imp->m();
|
||||
expr_replacer * r = m_imp->m_r;
|
||||
if (r)
|
||||
r->set_substitution(0);
|
||||
r->set_substitution(nullptr);
|
||||
bool owner = m_imp->m_r_owner;
|
||||
m_imp->m_r_owner = false; // stole replacer
|
||||
|
||||
|
@ -844,7 +844,7 @@ public:
|
|||
};
|
||||
|
||||
tactic * mk_solve_eqs_tactic(ast_manager & m, params_ref const & p, expr_replacer * r) {
|
||||
if (r == 0)
|
||||
if (r == nullptr)
|
||||
return clean(alloc(solve_eqs_tactic, m, p, mk_expr_simp_replacer(m, p), true));
|
||||
else
|
||||
return clean(alloc(solve_eqs_tactic, m, p, r, false));
|
||||
|
|
|
@ -24,7 +24,7 @@ class ast_manager;
|
|||
class tactic;
|
||||
class expr_replacer;
|
||||
|
||||
tactic * mk_solve_eqs_tactic(ast_manager & m, params_ref const & p = params_ref(), expr_replacer * r = 0);
|
||||
tactic * mk_solve_eqs_tactic(ast_manager & m, params_ref const & p = params_ref(), expr_replacer * r = nullptr);
|
||||
|
||||
/*
|
||||
ADD_TACTIC("solve-eqs", "eliminate variables by solving equations.", "mk_solve_eqs_tactic(m, p)")
|
||||
|
|
|
@ -111,7 +111,7 @@ public:
|
|||
SASSERT(in->is_well_sorted());
|
||||
tactic_report report("split-clause", *in);
|
||||
TRACE("before_split_clause", in->display(tout););
|
||||
pc = 0; mc = 0; core = 0;
|
||||
pc = nullptr; mc = nullptr; core = nullptr;
|
||||
ast_manager & m = in->m();
|
||||
unsigned cls_pos = select_clause(m, in);
|
||||
if (cls_pos == UINT_MAX) {
|
||||
|
@ -131,7 +131,7 @@ public:
|
|||
else
|
||||
subgoal_i = alloc(goal, *in);
|
||||
expr * lit_i = cls->get_arg(i);
|
||||
proof * pr_i = 0;
|
||||
proof * pr_i = nullptr;
|
||||
if (produce_proofs)
|
||||
pr_i = m.mk_hypothesis(lit_i);
|
||||
subgoal_i->update(cls_pos, lit_i, pr_i, cls_dep);
|
||||
|
|
|
@ -88,7 +88,7 @@ struct ac_rewriter_cfg : public default_rewriter_cfg {
|
|||
bool rewrite_patterns() const { return false; }
|
||||
bool flat_assoc(func_decl * f) const { return false; }
|
||||
br_status reduce_app(func_decl * f, unsigned num, expr * const * args, expr_ref & result, proof_ref & result_pr) {
|
||||
result_pr = 0;
|
||||
result_pr = nullptr;
|
||||
return m_r.mk_app_core(f, num, args, result);
|
||||
}
|
||||
ac_rewriter_cfg(ast_manager & m):m_r(m) {}
|
||||
|
@ -475,7 +475,7 @@ private:
|
|||
T.reset();
|
||||
ptr_vector<expr> todo;
|
||||
todo.push_back(fml);
|
||||
app* t = 0;
|
||||
app* t = nullptr;
|
||||
while (!todo.empty()) {
|
||||
fml = todo.back();
|
||||
todo.pop_back();
|
||||
|
@ -490,24 +490,24 @@ private:
|
|||
bool is_range_restriction(expr* form, term_set const& C, app*& t) {
|
||||
if (!m().is_or(form)) return false;
|
||||
unsigned sz = to_app(form)->get_num_args();
|
||||
t = 0;
|
||||
t = nullptr;
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
expr* e = to_app(form)->get_arg(i);
|
||||
expr* e1, *e2;
|
||||
if (!m().is_eq(e, e1, e2)) return false;
|
||||
if (!is_app(e1) || !is_app(e2)) return false;
|
||||
app* a1 = to_app(e1), *a2 = to_app(e2);
|
||||
if (C.contains(a1) && (t == 0 || t == a2)) {
|
||||
if (C.contains(a1) && (t == nullptr || t == a2)) {
|
||||
t = a2;
|
||||
}
|
||||
else if (C.contains(a2) && (t == 0 || t == a1)) {
|
||||
else if (C.contains(a2) && (t == nullptr || t == a1)) {
|
||||
t = a1;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return t != 0;
|
||||
return t != nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
@ -641,7 +641,7 @@ void symmetry_reduce_tactic::operator()(goal_ref const & g,
|
|||
expr_dependency_ref & core) {
|
||||
fail_if_proof_generation("symmetry_reduce", g);
|
||||
fail_if_unsat_core_generation("symmetry_reduce", g);
|
||||
mc = 0; pc = 0; core = 0; result.reset();
|
||||
mc = nullptr; pc = nullptr; core = nullptr; result.reset();
|
||||
(*m_imp)(*(g.get()));
|
||||
g->inc_depth();
|
||||
result.push_back(g.get());
|
||||
|
|
|
@ -177,7 +177,7 @@ class tseitin_cnf_tactic : public tactic {
|
|||
goto start;
|
||||
case OP_OR:
|
||||
case OP_IFF:
|
||||
l = 0;
|
||||
l = nullptr;
|
||||
m_cache.find(to_app(n), l);
|
||||
SASSERT(l != 0);
|
||||
mk_lit(l, sign, r);
|
||||
|
@ -185,7 +185,7 @@ class tseitin_cnf_tactic : public tactic {
|
|||
case OP_ITE:
|
||||
case OP_EQ:
|
||||
if (m.is_bool(to_app(n)->get_arg(1))) {
|
||||
l = 0;
|
||||
l = nullptr;
|
||||
m_cache.find(to_app(n), l);
|
||||
SASSERT(l != 0);
|
||||
mk_lit(l, sign, r);
|
||||
|
@ -341,7 +341,7 @@ class tseitin_cnf_tactic : public tactic {
|
|||
|
||||
app * mk_fresh() {
|
||||
m_num_aux_vars++;
|
||||
app * v = m.mk_fresh_const(0, m.mk_bool_sort());
|
||||
app * v = m.mk_fresh_const(nullptr, m.mk_bool_sort());
|
||||
m_fresh_vars.push_back(v);
|
||||
if (m_mc)
|
||||
m_mc->insert(v->get_decl());
|
||||
|
@ -804,7 +804,7 @@ class tseitin_cnf_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("tseitin-cnf", *g);
|
||||
fail_if_proof_generation("tseitin-cnf", g);
|
||||
m_produce_models = g->models_enabled();
|
||||
|
@ -819,12 +819,12 @@ class tseitin_cnf_tactic : public tactic {
|
|||
if (m_produce_models)
|
||||
m_mc = alloc(filter_model_converter, m);
|
||||
else
|
||||
m_mc = 0;
|
||||
m_mc = nullptr;
|
||||
|
||||
unsigned size = g->size();
|
||||
for (unsigned idx = 0; idx < size; idx++) {
|
||||
process(g->form(idx), g->dep(idx));
|
||||
g->update(idx, m.mk_true(), 0, 0); // to save memory
|
||||
g->update(idx, m.mk_true(), nullptr, nullptr); // to save memory
|
||||
}
|
||||
|
||||
SASSERT(!m_produce_unsat_cores || m_clauses.size() == m_deps.size());
|
||||
|
@ -838,14 +838,14 @@ class tseitin_cnf_tactic : public tactic {
|
|||
continue;
|
||||
added.mark(cls);
|
||||
if (m_produce_unsat_cores)
|
||||
g->assert_expr(cls, 0, m_deps.get(i));
|
||||
g->assert_expr(cls, nullptr, m_deps.get(i));
|
||||
else
|
||||
g->assert_expr(cls);
|
||||
}
|
||||
if (m_produce_models && !m_fresh_vars.empty())
|
||||
mc = m_mc.get();
|
||||
else
|
||||
mc = 0;
|
||||
mc = nullptr;
|
||||
g->inc_depth();
|
||||
result.push_back(g.get());
|
||||
TRACE("tseitin_cnf", g->display(tout););
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue