3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 09:05:31 +00:00

Use nullptr.

This commit is contained in:
Bruce Mitchener 2018-02-12 14:05:55 +07:00
parent f01328c65f
commit 76eb7b9ede
625 changed files with 4639 additions and 4639 deletions

View file

@ -154,8 +154,8 @@ namespace smt {
// Requires that the theory arithmetic internalizer accept non simplified terms of the form t1 - t2
// if t1 and t2 already have slacks (theory variables) associated with them.
// It also accepts terms with repeated variables (Issue #429).
app * le = 0;
app * ge = 0;
app * le = nullptr;
app * ge = nullptr;
if (m_util.is_numeral(t1))
std::swap(t1, t2);
if (m_util.is_numeral(t2)) {

View file

@ -53,7 +53,7 @@ namespace smt {
expr * m_t1_eq_t2;
expr * m_le;
expr * m_ge;
data():m_t1_eq_t2(0), m_le(0), m_ge(0) {}
data():m_t1_eq_t2(nullptr), m_le(nullptr), m_ge(nullptr) {}
data(expr * t1_eq_t2, expr * le, expr * ge):m_t1_eq_t2(t1_eq_t2), m_le(le), m_ge(ge) {}
};

View file

@ -90,7 +90,7 @@ void asserted_formulas::push_assertion(expr * e, proof * pr, vector<justified_ex
if (inconsistent()) {
return;
}
expr* e1 = 0;
expr* e1 = nullptr;
if (m.is_false(e)) {
result.push_back(justified_expr(m, e, pr));
m_inconsistent = true;
@ -101,14 +101,14 @@ void asserted_formulas::push_assertion(expr * e, proof * pr, vector<justified_ex
else if (m.is_and(e)) {
for (unsigned i = 0; i < to_app(e)->get_num_args(); ++i) {
expr* arg = to_app(e)->get_arg(i);
proof_ref _pr(m.proofs_enabled() ? m.mk_and_elim(pr, i) : 0, m);
proof_ref _pr(m.proofs_enabled() ? m.mk_and_elim(pr, i) : nullptr, m);
push_assertion(arg, _pr, result);
}
}
else if (m.is_not(e, e1) && m.is_or(e1)) {
for (unsigned i = 0; i < to_app(e1)->get_num_args(); ++i) {
expr* arg = to_app(e1)->get_arg(i);
proof_ref _pr(m.proofs_enabled() ? m.mk_not_or_elim(pr, i) : 0, m);
proof_ref _pr(m.proofs_enabled() ? m.mk_not_or_elim(pr, i) : nullptr, m);
expr_ref narg(mk_not(m, arg), m);
push_assertion(narg, _pr, result);
}
@ -376,7 +376,7 @@ void asserted_formulas::nnf_cnf() {
unsigned sz2 = push_todo.size();
for (unsigned k = 0; k < sz2; k++) {
expr * n = push_todo.get(k);
pr = 0;
pr = nullptr;
m_rewriter(n, r1, pr1);
CASSERT("well_sorted",is_well_sorted(m, r1));
if (canceled()) {
@ -598,15 +598,15 @@ void asserted_formulas::compute_depth(expr* e) {
proof * asserted_formulas::get_inconsistency_proof() const {
if (!inconsistent())
return 0;
return nullptr;
if (!m.proofs_enabled())
return 0;
return nullptr;
for (justified_expr const& j : m_formulas) {
if (m.is_false(j.get_fml()))
return j.get_proof();
}
UNREACHABLE();
return 0;
return nullptr;
}
void asserted_formulas::refine_inj_axiom_fn::simplify(justified_expr const& j, expr_ref& n, proof_ref& p) {

View file

@ -44,7 +44,7 @@ void cached_var_subst::reset() {
void cached_var_subst::operator()(quantifier * qa, unsigned num_bindings, smt::enode * const * bindings, expr_ref & result) {
m_new_keys.reserve(num_bindings+1, 0);
key * new_key = m_new_keys[num_bindings];
if (new_key == 0)
if (new_key == nullptr)
new_key = static_cast<key*>(m_region.allocate(sizeof(key) + sizeof(expr*)*num_bindings));
new_key->m_qa = qa;
@ -52,7 +52,7 @@ void cached_var_subst::operator()(quantifier * qa, unsigned num_bindings, smt::e
for (unsigned i = 0; i < num_bindings; i++)
new_key->m_bindings[i] = bindings[i]->get_owner();
instances::entry * entry = m_instances.insert_if_not_there2(new_key, 0);
instances::entry * entry = m_instances.insert_if_not_there2(new_key, nullptr);
if (entry->get_data().m_key != new_key) {
SASSERT(entry->get_data().m_value != 0);
// entry was already there

View file

@ -299,7 +299,7 @@ namespace smt {
TRACE("dyn_ack", tout << "del_clause_eh: "; m_context.display_clause(tout, cls); tout << "\n";);
m_context.m_stats.m_num_del_dyn_ack++;
app_pair p((app*)0,(app*)0);
app_pair p((app*)nullptr,(app*)nullptr);
if (m_clause2app_pair.find(cls, p)) {
SASSERT(p.first && p.second);
m_instantiated.erase(p);
@ -371,7 +371,7 @@ namespace smt {
lits.push_back(mk_eq(n1, n2));
clause_del_eh * del_eh = alloc(dyn_ack_clause_del_eh, *this);
justification * js = 0;
justification * js = nullptr;
if (m_manager.proofs_enabled())
js = alloc(dyn_ack_justification, n1, n2);
clause * cls = m_context.mk_clause(lits.size(), lits.c_ptr(), js, CLS_AUX_LEMMA, del_eh);
@ -423,7 +423,7 @@ namespace smt {
lits.push_back(mk_eq(n1, n2));
clause_del_eh * del_eh = alloc(dyn_ack_clause_del_eh, *this);
justification * js = 0;
justification * js = nullptr;
if (m_manager.proofs_enabled())
js = alloc(dyn_ack_justification, n1, n2);
clause * cls = m_context.mk_clause(lits.size(), lits.c_ptr(), js, CLS_AUX_LEMMA, del_eh);

View file

@ -311,7 +311,7 @@ bool expr_context_simplifier::is_false(expr* e) const {
//
expr_strong_context_simplifier::expr_strong_context_simplifier(smt_params& p, ast_manager& m):
m_manager(m), m_arith(m), m_fn(0,m), m_solver(m, p) {
m_manager(m), m_arith(m), m_fn(nullptr,m), m_solver(m, p) {
sort* i_sort = m_arith.mk_int();
m_fn = m.mk_func_decl(symbol(0xbeef101), i_sort, m.mk_bool_sort());
}
@ -358,7 +358,7 @@ void expr_strong_context_simplifier::simplify_basic(expr* fml, expr_ref& result)
m_solver.push();
while (!todo.empty()) {
r = 0;
r = nullptr;
ptr_buffer<expr> args;
expr* e = todo.back();
unsigned pos = parent_ids.back();
@ -405,7 +405,7 @@ void expr_strong_context_simplifier::simplify_basic(expr* fml, expr_ref& result)
self_pos = self_ids.back();
sz = a->get_num_args();
n2 = 0;
n2 = nullptr;
for (unsigned i = 0; i < sz; ++i) {
expr* arg = a->get_arg(i);
@ -620,7 +620,7 @@ void expr_strong_context_simplifier::simplify_model_based(expr* fml, expr_ref& r
m_solver.push();
while (!todo.empty()) {
r = 0;
r = nullptr;
ptr_buffer<expr> args;
expr* e = todo.back();
unsigned pos = parent_ids.back();
@ -681,7 +681,7 @@ void expr_strong_context_simplifier::simplify_model_based(expr* fml, expr_ref& r
self_pos = self_ids.back();
sz = a->get_num_args();
n2 = 0;
n2 = nullptr;
for (unsigned i = 0; i < sz; ++i) {
expr* arg = a->get_arg(i);

View file

@ -24,7 +24,7 @@ namespace smt {
m_data(d),
m_data_hash(d_h),
m_num_args(n),
m_args(0) {
m_args(nullptr) {
m_args = new (r) enode*[n];
memcpy(m_args, args, sizeof(enode*) * n);
}
@ -54,7 +54,7 @@ namespace smt {
fingerprint * fingerprint_set::insert(void * data, unsigned data_hash, unsigned num_args, enode * const * args) {
fingerprint * d = mk_dummy(data, data_hash, num_args, args);
if (m_set.contains(d))
return 0;
return nullptr;
TRACE("fingerprint_bug", tout << "1) inserting: " << data_hash << " num_args: " << num_args;
for (unsigned i = 0; i < num_args; i++) tout << " " << args[i]->get_owner_id();
tout << "\n";);
@ -64,7 +64,7 @@ namespace smt {
TRACE("fingerprint_bug", tout << "failed: " << data_hash << " num_args: " << num_args;
for (unsigned i = 0; i < num_args; i++) tout << " " << d->m_args[i]->get_owner_id();
tout << "\n";);
return 0;
return nullptr;
}
TRACE("fingerprint_bug", tout << "2) inserting: " << data_hash << " num_args: " << num_args;
for (unsigned i = 0; i < num_args; i++) tout << " " << args[i]->get_owner_id();

View file

@ -423,20 +423,20 @@ namespace smt {
instruction * curr = head;
out << *curr;
curr = curr->m_next;
while (curr != 0 && curr->m_opcode != CHOOSE && curr->m_opcode != NOOP) {
while (curr != nullptr && curr->m_opcode != CHOOSE && curr->m_opcode != NOOP) {
out << "\n";
out << *curr;
curr = curr->m_next;
}
out << "\n";
if (curr != 0) {
if (curr != nullptr) {
display_children(out, static_cast<choose*>(curr), indent + 1);
}
}
void display_children(std::ostream & out, choose * first_child, unsigned indent) const {
choose * curr = first_child;
while (curr != 0) {
while (curr != nullptr) {
display_seq(out, curr, indent);
curr = curr->m_alt;
}
@ -485,7 +485,7 @@ namespace smt {
m_filter_candidates(filter_candidates),
m_num_regs(num_args + 1),
m_num_choices(0),
m_root(0) {
m_root(nullptr) {
DEBUG_CODE(m_context = 0;);
#ifdef _PROFILE_MAM
m_counter = 0;
@ -607,7 +607,7 @@ namespace smt {
void * mem = m_region.allocate(size);
OP * r = new (mem) OP;
r->m_opcode = op;
r->m_next = 0;
r->m_next = nullptr;
#ifdef _PROFILE_MAM
r->m_counter = 0;
#endif
@ -696,7 +696,7 @@ namespace smt {
choose * mk_noop() {
choose * r = mk_instr<choose>(NOOP, sizeof(choose));
r->m_alt = 0;
r->m_alt = nullptr;
return r;
}
@ -923,7 +923,7 @@ namespace smt {
*/
void linearise_core() {
m_aux.reset();
app * first_app = 0;
app * first_app = nullptr;
unsigned first_app_reg;
unsigned first_app_sz;
unsigned first_app_num_unbound_vars;
@ -1111,7 +1111,7 @@ namespace smt {
// multi_pattern support
for (unsigned i = 1; i < num_args; i++) {
// select the pattern with the biggest number of bound variables
app * best = 0;
app * best = nullptr;
unsigned best_num_bvars = 0;
unsigned best_j = 0;
bool found_bounded_mp = false;
@ -1127,7 +1127,7 @@ namespace smt {
found_bounded_mp = true;
break;
}
if (best == 0 || (num_bvars > best_num_bvars)) {
if (best == nullptr || (num_bvars > best_num_bvars)) {
best = p;
best_num_bvars = num_bvars;
best_j = j;
@ -1286,16 +1286,16 @@ namespace smt {
choose * find_best_child(choose * first_child) {
unsigned num_too_simple = 0;
choose * best_child = 0;
choose * best_child = nullptr;
unsigned max_compatibility = 0;
choose * curr_child = first_child;
while (curr_child != 0) {
while (curr_child != nullptr) {
bool simple = false;
unsigned curr_compatibility = get_compatibility_measure(curr_child, simple);
if (simple) {
num_too_simple++;
if (num_too_simple > FIND_BEST_CHILD_THRESHOLD)
return 0; // it is unlikely we will find a compatible node
return nullptr; // it is unlikely we will find a compatible node
}
if (curr_compatibility > max_compatibility) {
best_child = curr_child;
@ -1310,7 +1310,7 @@ namespace smt {
unsigned ireg = instr->m_ireg;
expr * n = m_registers[ireg];
return
n != 0 &&
n != nullptr &&
is_app(n) &&
// It is wasteful to use a bind of a ground term.
// Actually, in the rest of the code I assume that.
@ -1450,7 +1450,7 @@ namespace smt {
unsigned weight = 0;
unsigned num_instr = 0;
instruction * curr = child->m_next;
while (curr != 0 && curr->m_opcode != CHOOSE && curr->m_opcode != NOOP) {
while (curr != nullptr && curr->m_opcode != CHOOSE && curr->m_opcode != NOOP) {
num_instr++;
switch (curr->m_opcode) {
case BIND1: case BIND2: case BIND3: case BIND4: case BIND5: case BIND6: case BINDN:
@ -1493,7 +1493,7 @@ namespace smt {
}
curr = curr->m_next;
}
if (num_instr > SIMPLE_SEQ_THRESHOLD || (curr != 0 && curr->m_opcode == CHOOSE))
if (num_instr > SIMPLE_SEQ_THRESHOLD || (curr != nullptr && curr->m_opcode == CHOOSE))
simple = false;
unsigned_vector::iterator it = m_to_reset.begin();
unsigned_vector::iterator end = m_to_reset.end();
@ -1509,7 +1509,7 @@ namespace smt {
TRACE("mam_compiler_detail", tout << "processing head: " << *head << "\n";);
instruction * curr = head->m_next;
instruction * last = head;
while (curr != 0 && curr->m_opcode != CHOOSE && curr->m_opcode != NOOP) {
while (curr != nullptr && curr->m_opcode != CHOOSE && curr->m_opcode != NOOP) {
TRACE("mam_compiler_detail", tout << "processing instr: " << *curr << "\n";);
switch (curr->m_opcode) {
case BIND1: case BIND2: case BIND3: case BIND4: case BIND5: case BIND6: case BINDN:
@ -1680,7 +1680,7 @@ namespace smt {
SASSERT(curr->m_opcode == CHOOSE);
choose * first_child = static_cast<choose *>(curr);
choose * best_child = find_best_child(first_child);
if (best_child == 0) {
if (best_child == nullptr) {
// There is no compatible child
// Suppose the sequence is:
// head -> c1 -> ... -> (cn == last) -> first_child;
@ -1902,7 +1902,7 @@ namespace smt {
curr = curr->get_next();
}
while (curr != first);
return 0;
return nullptr;
}
enode * get_next_f_app(func_decl * lbl, unsigned num_expected_args, enode * first, enode * curr) {
@ -1914,7 +1914,7 @@ namespace smt {
}
curr = curr->get_next();
}
return 0;
return nullptr;
}
/**
@ -2094,7 +2094,7 @@ namespace smt {
enode_vector * interpreter::mk_depth2_vector(joint2 * j2, func_decl * f, unsigned i) {
enode * n = m_registers[j2->m_reg]->get_root();
if (n->get_num_parents() == 0)
return 0;
return nullptr;
unsigned num_args = n->get_num_args();
enode_vector * v = mk_enode_vector();
enode_vector::const_iterator it1 = n->begin_parents();
@ -2132,7 +2132,7 @@ namespace smt {
// quick filter... check if any of the joint points have zero parents...
for (unsigned i = 0; i < num_args; i++) {
void * bare = c->m_joints[i];
enode * n = 0;
enode * n = nullptr;
switch (GET_TAG(bare)) {
case NULL_TAG:
goto non_depth1;
@ -2147,20 +2147,20 @@ namespace smt {
}
r = n->get_root();
if (m_use_filters && r->get_plbls().empty_intersection(c->m_lbl_set))
return 0;
return nullptr;
if (r->get_num_parents() == 0)
return 0;
return nullptr;
non_depth1:
;
}
// traverse each joint and select the best one.
enode_vector * best_v = 0;
enode_vector * best_v = nullptr;
for (unsigned i = 0; i < num_args; i++) {
enode * bare = c->m_joints[i];
enode_vector * curr_v = 0;
enode_vector * curr_v = nullptr;
switch (GET_TAG(bare)) {
case NULL_TAG:
curr_v = 0;
curr_v = nullptr;
break;
case GROUND_TERM_TAG:
curr_v = mk_depth1_vector(UNTAG(enode *, bare), lbl, i);
@ -2172,14 +2172,14 @@ namespace smt {
curr_v = mk_depth2_vector(UNTAG(joint2 *, bare), lbl, i);
break;
}
if (curr_v != 0) {
if (curr_v->size() < min_sz && (best_v == 0 || curr_v->size() < best_v->size())) {
if (curr_v != nullptr) {
if (curr_v->size() < min_sz && (best_v == nullptr || curr_v->size() < best_v->size())) {
if (best_v)
recycle_enode_vector(best_v);
best_v = curr_v;
if (best_v->empty()) {
recycle_enode_vector(best_v);
return 0;
return nullptr;
}
}
else {
@ -2191,10 +2191,10 @@ namespace smt {
bp.m_instr = c;
bp.m_old_max_generation = m_max_generation;
bp.m_old_used_enodes_size = m_used_enodes.size();
if (best_v == 0) {
if (best_v == nullptr) {
TRACE("mam_bug", tout << "m_top: " << m_top << ", m_backtrack_stack.size(): " << m_backtrack_stack.size() << "\n";
tout << *c << "\n";);
bp.m_to_recycle = 0;
bp.m_to_recycle = nullptr;
bp.m_it = m_context.begin_enodes_of(lbl);
bp.m_end = m_context.end_enodes_of(lbl);
}
@ -2211,7 +2211,7 @@ namespace smt {
break;
}
if (bp.m_it == bp.m_end)
return 0;
return nullptr;
m_top++;
update_max_generation(*(bp.m_it));
return *(bp.m_it);
@ -2648,7 +2648,7 @@ namespace smt {
m_num_args = static_cast<const cont *>(m_pc)->m_num_args;
m_oreg = static_cast<const cont *>(m_pc)->m_oreg;
m_app = init_continue(static_cast<const cont *>(m_pc), m_num_args);
if (m_app == 0)
if (m_app == nullptr)
goto backtrack;
m_pattern_instances.push_back(m_app);
TRACE("mam_int", tout << "continue candidate:\n" << mk_ll_pp(m_app->get_owner(), m_ast_manager););
@ -2911,7 +2911,7 @@ namespace smt {
if (lbl_id < m_trees.size())
return m_trees[lbl_id];
else
return 0;
return nullptr;
}
ptr_vector<code_tree>::iterator begin_code_trees() {
@ -2974,11 +2974,11 @@ namespace smt {
if (p1->m_label != p2->m_label ||
p1->m_arg_idx != p2->m_arg_idx ||
p1->m_pattern_idx != p2->m_pattern_idx ||
(p1->m_child == 0) != (p2->m_child == 0)) {
(p1->m_child == nullptr) != (p2->m_child == nullptr)) {
return false;
}
if (p1->m_child == 0 && p2->m_child == 0)
if (p1->m_child == nullptr && p2->m_child == nullptr)
return true;
p1 = p1->m_child;
@ -3014,11 +3014,11 @@ namespace smt {
m_arg_idx(p->m_arg_idx),
m_ground_arg_idx(p->m_ground_arg_idx),
m_ground_arg(p->m_ground_arg),
m_code(0),
m_code(nullptr),
m_filter(h(p->m_label)),
m_sibling(0),
m_first_child(0),
m_todo(0) {
m_sibling(nullptr),
m_first_child(nullptr),
m_todo(nullptr) {
#ifdef _PROFILE_PATH_TREE
m_counter = 0;
m_num_eq_visited = 0;
@ -3029,7 +3029,7 @@ namespace smt {
void display(std::ostream & out, unsigned indent) {
path_tree * curr = this;
while (curr != 0) {
while (curr != nullptr) {
for (unsigned i = 0; i < indent; i++) out << " ";
out << curr->m_label->get_name() << ":" << curr->m_arg_idx;
if (curr->m_ground_arg)
@ -3122,7 +3122,7 @@ namespace smt {
}
void add_candidate(code_tree * t, enode * app) {
if (t != 0) {
if (t != nullptr) {
TRACE("mam_candidate", tout << "adding candidate:\n" << mk_ll_pp(app->get_owner(), m_ast_manager););
if (!t->has_candidates())
m_to_match.push_back(t);
@ -3221,7 +3221,7 @@ namespace smt {
for (unsigned j = 0; j < APPROX_SET_CAPACITY; j++) {
m_pp[i][j].first = 0;
m_pp[i][j].second = 0;
m_pc[i][j] = 0;
m_pc[i][j] = nullptr;
}
}
}
@ -3240,10 +3240,10 @@ namespace smt {
SASSERT(m_ast_manager.is_pattern(mp));
SASSERT(p != 0);
unsigned pat_idx = p->m_pattern_idx;
path_tree * head = 0;
path_tree * curr = 0;
path_tree * prev = 0;
while (p != 0) {
path_tree * head = nullptr;
path_tree * curr = nullptr;
path_tree * prev = nullptr;
while (p != nullptr) {
curr = new (m_region) path_tree(p, m_lbl_hasher);
if (prev)
prev->m_first_child = curr;
@ -3260,9 +3260,9 @@ namespace smt {
void insert(path_tree * t, path * p, quantifier * qa, app * mp) {
SASSERT(m_ast_manager.is_pattern(mp));
path_tree * head = t;
path_tree * prev_sibling = 0;
path_tree * prev_sibling = nullptr;
bool found_label = false;
while (t != 0) {
while (t != nullptr) {
if (t->m_label == p->m_label) {
found_label = true;
if (t->m_arg_idx == p->m_arg_idx &&
@ -3270,8 +3270,8 @@ namespace smt {
t->m_ground_arg_idx == p->m_ground_arg_idx
) {
// found compatible node
if (t->m_first_child == 0) {
if (p->m_child == 0) {
if (t->m_first_child == nullptr) {
if (p->m_child == nullptr) {
SASSERT(t->m_code != 0);
insert_code(t, qa, mp, p->m_pattern_idx);
}
@ -3281,7 +3281,7 @@ namespace smt {
}
}
else {
if (p->m_child == 0) {
if (p->m_child == nullptr) {
if (t->m_code) {
insert_code(t, qa, mp, p->m_pattern_idx);
}
@ -3393,7 +3393,7 @@ namespace smt {
return mk_enode(m_context, qa, to_app(arg));
}
}
return 0;
return nullptr;
}
/**
@ -3460,7 +3460,7 @@ namespace smt {
unsigned num_patterns = mp->get_num_args();
for (unsigned i = 0; i < num_patterns; i++) {
app * pat = to_app(mp->get_arg(i));
update_filters(pat, 0, qa, mp, i);
update_filters(pat, nullptr, qa, mp, i);
}
}
@ -3496,7 +3496,7 @@ namespace smt {
\brief Collect new E-matching candidates using the inverted path index t.
*/
void collect_parents(enode * r, path_tree * t) {
if (t == 0)
if (t == nullptr)
return;
#ifdef _PROFILE_PATH_TREE
t->m_watch.start();
@ -3604,7 +3604,7 @@ namespace smt {
// Filter 2.
(
// curr_tree has no support for the filter based on a ground argument.
curr_tree->m_ground_arg == 0 ||
curr_tree->m_ground_arg == nullptr ||
// checks whether the child of the parent is equal to the expected ground argument.
is_eq(curr_tree->m_ground_arg, curr_parent->get_arg(curr_tree->m_ground_arg_idx))
)) {
@ -3614,7 +3614,7 @@ namespace smt {
}
if (curr_tree->m_first_child) {
path_tree * child = curr_tree->m_first_child;
if (child->m_todo == 0) {
if (child->m_todo == nullptr) {
child->m_todo = mk_tmp_vector();
m_todo.push_back(child);
}
@ -3636,7 +3636,7 @@ namespace smt {
}
}
recycle(t->m_todo);
t->m_todo = 0;
t->m_todo = nullptr;
// remove both marks.
unmark_enodes(to_unmark->size(), to_unmark->c_ptr());
unmark_enodes2(to_unmark2->size(), to_unmark2->c_ptr());
@ -3812,8 +3812,8 @@ namespace smt {
m_interpreter(ctx, *this, use_filters),
m_trees(m_ast_manager, m_compiler, m_trail_stack),
m_region(m_trail_stack.get_region()),
m_r1(0),
m_r2(0) {
m_r1(nullptr),
m_r2(nullptr) {
DEBUG_CODE(m_trees.set_context(&ctx););
DEBUG_CODE(m_check_missing_instances = false;);
reset_pp_pc();

View file

@ -157,8 +157,8 @@ interval::interval(v_dependency_manager & m):
m_upper(true),
m_lower_open(true),
m_upper_open(true),
m_lower_dep(0),
m_upper_dep(0) {
m_lower_dep(nullptr),
m_upper_dep(nullptr) {
}
/**
@ -215,12 +215,12 @@ interval::interval(v_dependency_manager & m, rational const & val, bool open, bo
m_lower_dep = d;
m_upper = ext_numeral(true);
m_upper_open = true;
m_upper_dep = 0;
m_upper_dep = nullptr;
}
else {
m_lower = ext_numeral(false);
m_lower_open = true;
m_lower_dep = 0;
m_lower_dep = nullptr;
m_upper = ext_numeral(val);
m_upper_open = open;
m_upper_dep = d;
@ -252,8 +252,8 @@ interval & interval::operator+=(interval const & other) {
m_upper += other.m_upper;
m_lower_open |= other.m_lower_open;
m_upper_open |= other.m_upper_open;
m_lower_dep = m_lower.is_infinite() ? 0 : m_manager.mk_join(m_lower_dep, other.m_lower_dep);
m_upper_dep = m_upper.is_infinite() ? 0 : m_manager.mk_join(m_upper_dep, other.m_upper_dep);
m_lower_dep = m_lower.is_infinite() ? nullptr : m_manager.mk_join(m_lower_dep, other.m_lower_dep);
m_upper_dep = m_upper.is_infinite() ? nullptr : m_manager.mk_join(m_upper_dep, other.m_upper_dep);
return *this;
}
@ -283,7 +283,7 @@ v_dependency * interval::join_opt(v_dependency * d1, v_dependency * d2, v_depend
return join(d1, d2);
if (opt2 == d1 || opt2 == d2)
return join(d1, d2);
if (opt1 == 0 || opt2 == 0)
if (opt1 == nullptr || opt2 == nullptr)
return join(d1, d2);
// TODO: more opts...
return join(d1, d2, opt1);
@ -331,8 +331,8 @@ interval & interval::operator*=(interval const & other) {
m_upper_open = a_o || c_o; SASSERT(a.is_neg() && c.is_neg());
m_lower = new_lower;
m_upper = new_upper;
m_lower_dep = m_lower.is_infinite() ? 0 : join(b_d, d_d);
m_upper_dep = m_upper.is_infinite() ? 0 : join_opt(a_d, c_d, b_d, d_d);
m_lower_dep = m_lower.is_infinite() ? nullptr : join(b_d, d_d);
m_upper_dep = m_upper.is_infinite() ? nullptr : join_opt(a_d, c_d, b_d, d_d);
}
else if (other.is_M()) {
// a <= x <= b <= 0, y <= d, d > 0 --> a*d <= x*y (uses the fact that b is not positive)
@ -344,8 +344,8 @@ interval & interval::operator*=(interval const & other) {
m_upper_open = a_o || c_o;
m_lower = new_lower;
m_upper = new_upper;
m_lower_dep = m_lower.is_infinite() ? 0 : join(a_d, d_d, b_d);
m_upper_dep = m_upper.is_infinite() ? 0 : join(a_d, c_d, b_d);
m_lower_dep = m_lower.is_infinite() ? nullptr : join(a_d, d_d, b_d);
m_upper_dep = m_upper.is_infinite() ? nullptr : join(a_d, c_d, b_d);
}
else {
// a <= x <= b <= 0, 0 <= c <= y <= d --> a*d <= x*y (uses the fact that x is neg (b is not positive) or y is pos (c is not negative))
@ -359,8 +359,8 @@ interval & interval::operator*=(interval const & other) {
m_upper_open = (is_N0_old || other.is_P0()) ? false : (b_o || c_o);
m_lower = new_lower;
m_upper = new_upper;
m_lower_dep = m_lower.is_infinite() ? 0 : join_opt(a_d, d_d, b_d, c_d);
m_upper_dep = m_upper.is_infinite() ? 0 : join(b_d, c_d);
m_lower_dep = m_lower.is_infinite() ? nullptr : join_opt(a_d, d_d, b_d, c_d);
m_upper_dep = m_upper.is_infinite() ? nullptr : join(b_d, c_d);
}
}
else if (is_M()) {
@ -374,8 +374,8 @@ interval & interval::operator*=(interval const & other) {
m_upper_open = a_o || c_o; SASSERT(a.is_neg() && c.is_neg());
m_lower = new_lower;
m_upper = new_upper;
m_lower_dep = m_lower.is_infinite() ? 0 : join(b_d, c_d, d_d);
m_upper_dep = m_upper.is_infinite() ? 0 : join(a_d, c_d, d_d);
m_lower_dep = m_lower.is_infinite() ? nullptr : join(b_d, c_d, d_d);
m_upper_dep = m_upper.is_infinite() ? nullptr : join(a_d, c_d, d_d);
}
else if (other.is_M()) {
TRACE("interval_bug", tout << "(M, M)\n";);
@ -404,8 +404,8 @@ interval & interval::operator*=(interval const & other) {
m_upper = bd;
m_upper_open = bd_o;
}
m_lower_dep = m_lower.is_infinite() ? 0 : join(a_d, b_d, c_d, d_d);
m_upper_dep = m_upper.is_infinite() ? 0 : join(a_d, b_d, c_d, d_d);
m_lower_dep = m_lower.is_infinite() ? nullptr : join(a_d, b_d, c_d, d_d);
m_upper_dep = m_upper.is_infinite() ? nullptr : join(a_d, b_d, c_d, d_d);
}
else {
// a < 0, a <= x, 0 <= c <= y <= d --> a*d <= x*y (uses the fact that c is not negative)
@ -418,8 +418,8 @@ interval & interval::operator*=(interval const & other) {
m_upper_open = b_o || d_o; SASSERT(b.is_pos() && d.is_pos());
m_lower = new_lower;
m_upper = new_upper;
m_lower_dep = m_lower.is_infinite() ? 0 : join(a_d, d_d, c_d);
m_upper_dep = m_upper.is_infinite() ? 0 : join(b_d, d_d, c_d);
m_lower_dep = m_lower.is_infinite() ? nullptr : join(a_d, d_d, c_d);
m_upper_dep = m_upper.is_infinite() ? nullptr : join(b_d, d_d, c_d);
}
}
else {
@ -435,8 +435,8 @@ interval & interval::operator*=(interval const & other) {
m_upper_open = (is_P0_old || other.is_N0()) ? false : a_o || d_o;
m_lower = new_lower;
m_upper = new_upper;
m_lower_dep = m_lower.is_infinite() ? 0 : join_opt(b_d, c_d, a_d, d_d);
m_upper_dep = m_upper.is_infinite() ? 0 : join(a_d, d_d);
m_lower_dep = m_lower.is_infinite() ? nullptr : join_opt(b_d, c_d, a_d, d_d);
m_upper_dep = m_upper.is_infinite() ? nullptr : join(a_d, d_d);
}
else if (other.is_M()) {
// 0 <= a <= x <= b, c <= y --> b*c <= x*y (uses the fact that a is not negative)
@ -448,8 +448,8 @@ interval & interval::operator*=(interval const & other) {
m_upper_open = b_o || d_o;
m_lower = new_lower;
m_upper = new_upper;
m_lower_dep = m_lower.is_infinite() ? 0 : join(b_d, c_d, a_d);
m_upper_dep = m_upper.is_infinite() ? 0 : join(b_d, d_d, a_d);
m_lower_dep = m_lower.is_infinite() ? nullptr : join(b_d, c_d, a_d);
m_upper_dep = m_upper.is_infinite() ? nullptr : join(b_d, d_d, a_d);
}
else {
// 0 <= a <= x, 0 <= c <= y --> a*c <= x*y
@ -462,8 +462,8 @@ interval & interval::operator*=(interval const & other) {
m_upper_open = b_o || d_o; SASSERT(b.is_pos() && d.is_pos());
m_lower = new_lower;
m_upper = new_upper;
m_lower_dep = m_lower.is_infinite() ? 0 : join(a_d, c_d);
m_upper_dep = m_upper.is_infinite() ? 0 : join_opt(b_d, d_d, a_d, c_d);
m_lower_dep = m_lower.is_infinite() ? nullptr : join(a_d, c_d);
m_upper_dep = m_upper.is_infinite() ? nullptr : join_opt(b_d, d_d, a_d, c_d);
}
}
TRACE("interval_bug", tout << "operator*= result: " << *this << "\n";);
@ -590,7 +590,7 @@ void interval::expt(unsigned n) {
// 0 < a <= x <= b --> x^n <= b^n (use lower and upper bound -- need the fact that x is positive)
m_lower.expt(n);
m_upper.expt(n);
m_upper_dep = m_upper.is_infinite() ? 0 : m_manager.mk_join(m_lower_dep, m_upper_dep);
m_upper_dep = m_upper.is_infinite() ? nullptr : m_manager.mk_join(m_lower_dep, m_upper_dep);
}
else if (m_upper.is_neg()) {
// [l, u]^n = [u^n, l^n] if u < 0
@ -601,7 +601,7 @@ void interval::expt(unsigned n) {
std::swap(m_lower_dep, m_upper_dep);
m_lower.expt(n);
m_upper.expt(n);
m_upper_dep = m_upper.is_infinite() ? 0 : m_manager.mk_join(m_lower_dep, m_upper_dep);
m_upper_dep = m_upper.is_infinite() ? nullptr : m_manager.mk_join(m_lower_dep, m_upper_dep);
}
else {
// [l, u]^n = [0, max{l^n, u^n}] otherwise
@ -614,10 +614,10 @@ void interval::expt(unsigned n) {
m_upper = m_lower;
m_upper_open = m_lower_open;
}
m_upper_dep = m_upper.is_infinite() ? 0 : m_manager.mk_join(m_lower_dep, m_upper_dep);
m_upper_dep = m_upper.is_infinite() ? nullptr : m_manager.mk_join(m_lower_dep, m_upper_dep);
m_lower = ext_numeral(0);
m_lower_open = false;
m_lower_dep = 0;
m_lower_dep = nullptr;
}
}
else {

View file

@ -80,7 +80,7 @@ class old_interval {
public:
explicit old_interval(v_dependency_manager & m);
explicit old_interval(v_dependency_manager & m, rational const & lower, bool l_open, v_dependency * l_dep, rational const & upper, bool u_open, v_dependency * u_dep);
explicit old_interval(v_dependency_manager & m, rational const & val, v_dependency * l_dep = 0, v_dependency * u_dep = 0);
explicit old_interval(v_dependency_manager & m, rational const & val, v_dependency * l_dep = nullptr, v_dependency * u_dep = nullptr);
explicit old_interval(v_dependency_manager & m, rational const & val, bool open, bool lower, v_dependency * d);
explicit old_interval(v_dependency_manager & m, ext_numeral const& lower, bool l_open, v_dependency * l_dep, ext_numeral const & upper, bool u_open, v_dependency * u_dep);
old_interval(old_interval const & other);

View file

@ -99,7 +99,7 @@ struct qi_params {
m_mbqi_max_iterations(1000),
m_mbqi_trace(false),
m_mbqi_force_template(10),
m_mbqi_id(0)
m_mbqi_id(nullptr)
{
updt_params(p);
}

View file

@ -62,7 +62,7 @@ void array_factory::get_some_args_for(sort * s, ptr_buffer<expr> & args) {
expr * array_factory::get_some_value(sort * s) {
TRACE("array_factory", tout << mk_pp(s, m_manager) << "\n";);
value_set * set = 0;
value_set * set = nullptr;
if (m_sort2value_set.find(s, set) && !set->empty())
return *(set->begin());
func_interp * fi;
@ -99,7 +99,7 @@ bool array_factory::mk_two_diff_values_for(sort * s) {
}
bool array_factory::get_some_values(sort * s, expr_ref & v1, expr_ref & v2) {
value_set * set = 0;
value_set * set = nullptr;
if (!m_sort2value_set.find(s, set) || set->size() == 0) {
if (!mk_two_diff_values_for(s))
return false;
@ -111,7 +111,7 @@ bool array_factory::get_some_values(sort * s, expr_ref & v1, expr_ref & v2) {
if (set->size() == 1) {
v1 = *(set->begin());
v2 = get_fresh_value(s);
return v2.get() != 0;
return v2.get() != nullptr;
}
else {
SASSERT(set->size() >= 2);
@ -139,7 +139,7 @@ expr * array_factory::get_fresh_value(sort * s) {
}
sort * range = get_array_range(s);
expr * range_val = m_model.get_fresh_value(range);
if (range_val != 0) {
if (range_val != nullptr) {
// easy case
func_interp * fi;
expr * val = mk_array_interp(s, fi);
@ -170,7 +170,7 @@ expr * array_factory::get_fresh_value(sort * s) {
if (!found) {
expr * arg1 = m_model.get_fresh_value(d);
expr * arg2 = m_model.get_fresh_value(d);
if (arg1 != 0 && arg2 != 0) {
if (arg1 != nullptr && arg2 != nullptr) {
found = true;
args1.push_back(arg1);
args2.push_back(arg2);
@ -201,6 +201,6 @@ expr * array_factory::get_fresh_value(sort * s) {
// failed to create a fresh array value
TRACE("array_factory_bug", tout << "failed to build fresh array value\n";);
return 0;
return nullptr;
}

View file

@ -27,7 +27,7 @@ datatype_factory::datatype_factory(ast_manager & m, proto_model & md):
}
expr * datatype_factory::get_some_value(sort * s) {
value_set * set = 0;
value_set * set = nullptr;
if (m_sort2value_set.find(s, set) && !set->empty())
return *(set->begin());
func_decl * c = m_util.get_non_rec_constructor(s);
@ -46,7 +46,7 @@ expr * datatype_factory::get_some_value(sort * s) {
\brief Return the last fresh (or almost) fresh value of sort s.
*/
expr * datatype_factory::get_last_fresh_value(sort * s) {
expr * val = 0;
expr * val = nullptr;
if (m_last_fresh_value.find(s, val)) {
TRACE("datatype", tout << "cached fresh value: " << mk_pp(val, m_manager) << "\n";);
return val;
@ -98,7 +98,7 @@ expr * datatype_factory::get_almost_fresh_value(sort * s) {
sort * s_arg = constructor->get_domain(i);
if (!found_fresh_arg && (!m_util.is_datatype(s_arg) || !m_util.are_siblings(s, s_arg))) {
expr * new_arg = m_model.get_fresh_value(s_arg);
if (new_arg != 0) {
if (new_arg != nullptr) {
found_fresh_arg = true;
args.push_back(new_arg);
continue;
@ -131,7 +131,7 @@ expr * datatype_factory::get_almost_fresh_value(sort * s) {
}
}
SASSERT(!m_util.is_recursive(s));
return 0;
return nullptr;
}
@ -160,7 +160,7 @@ expr * datatype_factory::get_fresh_value(sort * s) {
sort * s_arg = constructor->get_domain(i);
if (!found_fresh_arg && (!m_util.is_recursive(s) || !m_util.is_datatype(s_arg) || !m_util.are_siblings(s, s_arg))) {
expr * new_arg = m_model.get_fresh_value(s_arg);
if (new_arg != 0) {
if (new_arg != nullptr) {
found_fresh_arg = true;
args.push_back(new_arg);
continue;
@ -204,7 +204,7 @@ expr * datatype_factory::get_fresh_value(sort * s) {
<< found_sibling << "\n";);
if (!found_sibling && m_util.is_datatype(s_arg) && m_util.are_siblings(s, s_arg)) {
found_sibling = true;
expr * maybe_new_arg = 0;
expr * maybe_new_arg = nullptr;
if (num_iterations <= 1) {
maybe_new_arg = get_almost_fresh_value(s_arg);
}
@ -245,6 +245,6 @@ expr * datatype_factory::get_fresh_value(sort * s) {
// Search for value that was not created before.
SASSERT(!m_util.is_recursive(s));
return 0;
return nullptr;
}

View file

@ -53,11 +53,11 @@ void proto_model::register_aux_decl(func_decl * d) {
*/
void proto_model::reregister_decl(func_decl * f, func_interp * new_fi, func_decl * f_aux) {
func_interp * fi = get_func_interp(f);
if (fi == 0) {
if (fi == nullptr) {
register_decl(f, new_fi);
}
else {
if (f_aux != 0) {
if (f_aux != nullptr) {
register_decl(f_aux, fi);
m_aux_decls.insert(f_aux);
}
@ -135,7 +135,7 @@ void proto_model::cleanup_func_interp(func_interp * fi, func_decl_set & found_au
todo.pop_back();
func_decl * a_decl = to_app(a)->get_decl();
expr * ai = get_const_interp(a_decl);
if (ai == 0) {
if (ai == nullptr) {
ai = get_some_value(a_decl->get_range());
register_decl(a_decl, ai);
}
@ -148,7 +148,7 @@ void proto_model::cleanup_func_interp(func_interp * fi, func_decl_set & found_au
bool visited = true;
args.reset();
for (expr* t_arg : *t) {
expr * arg = 0;
expr * arg = nullptr;
if (!cache.find(t_arg, arg)) {
visited = false;
todo.push_back(t_arg);
@ -346,7 +346,7 @@ void proto_model::complete_partial_func(func_decl * f) {
func_interp * fi = get_func_interp(f);
if (fi && fi->is_partial()) {
expr * else_value = fi->get_max_occ_result();
if (else_value == 0)
if (else_value == nullptr)
else_value = get_some_value(f->get_range());
fi->set_else(else_value);
}

View file

@ -20,7 +20,7 @@ Revision History:
#include "smt/proto_model/proto_model.h"
struct_factory::value_set * struct_factory::get_value_set(sort * s) {
value_set * set = 0;
value_set * set = nullptr;
if (!m_sort2value_set.find(s, set)) {
set = alloc(value_set);
m_sort2value_set.insert(s, set);

View file

@ -34,7 +34,7 @@ basic_factory::basic_factory(ast_manager & m):
expr * basic_factory::get_some_value(sort * s) {
if (m_manager.is_bool(s))
return m_manager.mk_false();
return 0;
return nullptr;
}
bool basic_factory::get_some_values(sort * s, expr_ref & v1, expr_ref & v2) {
@ -47,7 +47,7 @@ bool basic_factory::get_some_values(sort * s, expr_ref & v1, expr_ref & v2) {
}
expr * basic_factory::get_fresh_value(sort * s) {
return 0;
return nullptr;
}
user_sort_factory::user_sort_factory(ast_manager & m):
@ -56,7 +56,7 @@ user_sort_factory::user_sort_factory(ast_manager & m):
void user_sort_factory::freeze_universe(sort * s) {
if (!m_finite.contains(s)) {
value_set * set = 0;
value_set * set = nullptr;
m_sort2value_set.find(s, set);
if (!m_sort2value_set.find(s, set) || set->m_values.empty()) {
// we cannot freeze an empty universe.
@ -68,7 +68,7 @@ void user_sort_factory::freeze_universe(sort * s) {
}
obj_hashtable<expr> const & user_sort_factory::get_known_universe(sort * s) const {
value_set * set = 0;
value_set * set = nullptr;
if (m_sort2value_set.find(s, set)) {
return set->m_values;
}
@ -77,7 +77,7 @@ obj_hashtable<expr> const & user_sort_factory::get_known_universe(sort * s) cons
expr * user_sort_factory::get_some_value(sort * s) {
if (is_finite(s)) {
value_set * set = 0;
value_set * set = nullptr;
m_sort2value_set.find(s, set);
SASSERT(set != 0);
SASSERT(!set->m_values.empty());
@ -88,7 +88,7 @@ expr * user_sort_factory::get_some_value(sort * s) {
bool user_sort_factory::get_some_values(sort * s, expr_ref & v1, expr_ref & v2) {
if (is_finite(s)) {
value_set * set = 0;
value_set * set = nullptr;
if (m_sort2value_set.find(s, set) && set->m_values.size() >= 2) {
obj_hashtable<expr>::iterator it = set->m_values.begin();
v1 = *it;
@ -103,7 +103,7 @@ bool user_sort_factory::get_some_values(sort * s, expr_ref & v1, expr_ref & v2)
expr * user_sort_factory::get_fresh_value(sort * s) {
if (is_finite(s))
return 0;
return nullptr;
return simple_factory<unsigned>::get_fresh_value(s);
}

View file

@ -95,7 +95,7 @@ protected:
ptr_vector<value_set> m_sets;
value_set * get_value_set(sort * s) {
value_set * set = 0;
value_set * set = nullptr;
if (!m_sort2value_set.find(s, set)) {
set = alloc(value_set);
m_sort2value_set.insert(s, set);
@ -138,8 +138,8 @@ public:
}
expr * get_some_value(sort * s) override {
value_set * set = 0;
expr * result = 0;
value_set * set = nullptr;
expr * result = nullptr;
if (m_sort2value_set.find(s, set) && !set->m_values.empty())
result = *(set->m_values.begin());
else
@ -148,7 +148,7 @@ public:
}
bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2) override {
value_set * set = 0;
value_set * set = nullptr;
if (m_sort2value_set.find(s, set)) {
switch (set->m_values.size()) {
case 0:
@ -179,9 +179,9 @@ public:
expr * get_fresh_value(sort * s) override {
value_set * set = get_value_set(s);
bool is_new = false;
expr * result = 0;
expr * result = nullptr;
sort_info* s_info = s->get_info();
sort_size const* sz = s_info?&s_info->get_num_elements():0;
sort_size const* sz = s_info?&s_info->get_num_elements():nullptr;
bool has_max = false;
Number max_size(0);
if (sz && sz->is_finite() && sz->size() < UINT_MAX) {
@ -195,7 +195,7 @@ public:
result = mk_value(next, s, is_new);
next++;
if (has_max && next > max_size + start) {
return 0;
return nullptr;
}
}
SASSERT(result != 0);

View file

@ -128,7 +128,7 @@ namespace smt {
unsigned qi_queue::get_new_gen(quantifier * q, unsigned generation, float cost) {
// max_top_generation and min_top_generation are not available for computing inc_gen
set_values(q, 0, generation, 0, 0, cost);
set_values(q, nullptr, generation, 0, 0, cost);
float r = m_evaluator(m_new_gen_function, m_vals.size(), m_vals.c_ptr());
return static_cast<unsigned>(r);
}

View file

@ -23,7 +23,7 @@ Notes:
class include_cmd : public cmd {
char const * m_filename;
public:
include_cmd() : cmd("include"), m_filename(0) {}
include_cmd() : cmd("include"), m_filename(nullptr) {}
char const * get_usage() const override { return "<string>"; }
char const * get_descr(cmd_context & ctx) const override { return "include a file"; }
unsigned get_arity() const override { return 1; }
@ -38,7 +38,7 @@ public:
is.close();
}
void prepare(cmd_context & ctx) override { reset(ctx); }
void reset(cmd_context & ctx) override { m_filename = 0; }
void reset(cmd_context & ctx) override { m_filename = nullptr; }
void finalize(cmd_context & ctx) override { reset(ctx); }
};

View file

@ -108,8 +108,8 @@ namespace smt {
void almost_cg_table::insert(enode * n) {
table::entry * entry = m_table.find_core(n);
if (entry == 0) {
list<enode*> * new_lst = new (m_region) list<enode*>(n, 0);
if (entry == nullptr) {
list<enode*> * new_lst = new (m_region) list<enode*>(n, nullptr);
m_table.insert(n, new_lst);
}
else {
@ -119,7 +119,7 @@ namespace smt {
}
list<enode*> * almost_cg_table::find(enode * n) {
list<enode*> * result = 0;
list<enode*> * result = nullptr;
m_table.find(n, result);
return result;
}

View file

@ -57,7 +57,7 @@ namespace smt {
table m_table;
public:
almost_cg_table(enode * r1 = 0, enode * r2 = 0);
almost_cg_table(enode * r1 = nullptr, enode * r2 = nullptr);
void reset(enode * r1, enode * r2) { m_r1 = r1->get_root(); m_r2 = r2->get_root(); reset(); }
void reset();
void insert(enode *);

View file

@ -91,7 +91,7 @@ namespace smt {
}
};
const b_justification null_b_justification(static_cast<clause*>(0));
const b_justification null_b_justification(static_cast<clause*>(nullptr));
inline std::ostream& operator<<(std::ostream& out, b_justification::kind k) {
switch (k) {

View file

@ -419,7 +419,7 @@ namespace smt {
val = l_true;
}
if ((is_or && val == l_true) || (is_and && val == l_false)) {
expr * undef_child = 0;
expr * undef_child = nullptr;
if (!has_child_assigned_to(m_context, to_app(curr), val, undef_child, m_params.m_rel_case_split_order)) {
if (m_manager.has_trace_stream()) {
m_manager.trace_stream() << "[decide-and-or] #" << curr->get_id() << " #" << undef_child->get_id() << "\n";
@ -611,7 +611,7 @@ namespace smt {
val = l_true;
}
if ((is_or && val == l_true) || (is_and && val == l_false)) {
expr * undef_child = 0;
expr * undef_child = nullptr;
if (!has_child_assigned_to(m_context, to_app(curr), val, undef_child, m_params.m_rel_case_split_order)) {
TRACE("case_split", tout << "found AND/OR candidate: #" << curr->get_id() << " #" << undef_child->get_id() << "\n";);
literal l = m_context.get_literal(undef_child);
@ -747,7 +747,7 @@ namespace smt {
m_head(0),
m_bs_num_bool_vars(UINT_MAX),
m_priority_queue2(0, generation_lt(*this)),
m_current_goal(0) {
m_current_goal(nullptr) {
set_global_generation();
}
@ -875,7 +875,7 @@ namespace smt {
val = l_true;
}
if ((is_or && val == l_true) || (is_and && val == l_false)) {
expr * undef_child = 0;
expr * undef_child = nullptr;
if (!has_child_assigned_to(m_context, to_app(curr), val, undef_child, m_params.m_rel_case_split_order)) {
if (m_manager.has_trace_stream()) {
m_manager.trace_stream() << "[decide-and-or] #" << curr->get_id() << " #" << undef_child->get_id() << "\n";

View file

@ -307,17 +307,17 @@ namespace smt {
enode * find(enode * n) const {
SASSERT(n->get_num_args() > 0);
enode * r = 0;
enode * r = nullptr;
void * t = const_cast<cg_table*>(this)->get_table(n);
switch (static_cast<table_kind>(GET_TAG(t))) {
case UNARY:
return UNTAG(unary_table*, t)->find(n, r) ? r : 0;
return UNTAG(unary_table*, t)->find(n, r) ? r : nullptr;
case BINARY:
return UNTAG(binary_table*, t)->find(n, r) ? r : 0;
return UNTAG(binary_table*, t)->find(n, r) ? r : nullptr;
case BINARY_COMM:
return UNTAG(comm_table*, t)->find(n, r) ? r : 0;
return UNTAG(comm_table*, t)->find(n, r) ? r : nullptr;
default:
return UNTAG(table*, t)->find(n, r) ? r : 0;
return UNTAG(table*, t)->find(n, r) ? r : nullptr;
}
}

View file

@ -125,28 +125,28 @@ namespace smt {
unsigned num = n->get_num_args();
for (unsigned i = 0; i < num; i++) {
enode * arg = get_enode_eq_to(n->get_arg(i));
if (arg == 0)
return 0;
if (arg == nullptr)
return nullptr;
buffer.push_back(arg);
}
enode * e = m_context.get_enode_eq_to(n->get_decl(), num, buffer.c_ptr());
if (e == 0)
return 0;
return m_context.is_relevant(e) ? e : 0;
if (e == nullptr)
return nullptr;
return m_context.is_relevant(e) ? e : nullptr;
}
enode * checker::get_enode_eq_to(expr * n) {
if (is_var(n)) {
unsigned idx = to_var(n)->get_idx();
if (idx >= m_num_bindings)
return 0;
return nullptr;
return m_bindings[m_num_bindings - idx - 1];
}
if (m_context.e_internalized(n) && m_context.is_relevant(n))
return m_context.get_enode(n);
if (!is_app(n) || to_app(n)->get_num_args() == 0)
return 0;
enode * r = 0;
return nullptr;
enode * r = nullptr;
if (n->get_ref_count() > 1 && m_to_enode_cache.find(n, r))
return r;
r = get_enode_eq_to_core(to_app(n));
@ -179,7 +179,7 @@ namespace smt {
m_context(c),
m_manager(c.get_manager()),
m_num_bindings(0),
m_bindings(0) {
m_bindings(nullptr) {
}
};

View file

@ -47,8 +47,8 @@ namespace smt {
public:
checker(context & c);
bool is_sat(expr * n, unsigned num_bindings = 0, enode * const * bindings = 0);
bool is_unsat(expr * n, unsigned num_bindings = 0, enode * const * bindings = 0);
bool is_sat(expr * n, unsigned num_bindings = 0, enode * const * bindings = nullptr);
bool is_unsat(expr * n, unsigned num_bindings = 0, enode * const * bindings = nullptr);
};
};

View file

@ -29,7 +29,7 @@ namespace smt {
clause_del_eh * del_eh, bool save_atoms, expr * const * bool_var2expr_map) {
SASSERT(k == CLS_AUX || js == 0 || !js->in_region());
SASSERT(num_lits >= 2);
unsigned sz = get_obj_size(num_lits, k, save_atoms, del_eh != 0, js != 0);
unsigned sz = get_obj_size(num_lits, k, save_atoms, del_eh != nullptr, js != nullptr);
void * mem = m.get_allocator().allocate(sz);
clause * cls = new (mem) clause();
cls->m_num_literals = num_lits;
@ -38,8 +38,8 @@ namespace smt {
cls->m_reinit = save_atoms;
cls->m_reinternalize_atoms = save_atoms;
cls->m_has_atoms = save_atoms;
cls->m_has_del_eh = del_eh != 0;
cls->m_has_justification = js != 0;
cls->m_has_del_eh = del_eh != nullptr;
cls->m_has_justification = js != nullptr;
cls->m_deleted = false;
SASSERT(!m.proofs_enabled() || js != 0);
memcpy(cls->m_lits, lits, sizeof(literal) * num_lits);
@ -92,7 +92,7 @@ namespace smt {
unsigned num_atoms = get_num_atoms();
for (unsigned i = 0; i < num_atoms; i++) {
m.dec_ref(get_atom(i));
const_cast<expr**>(get_atoms_addr())[i] = 0;
const_cast<expr**>(get_atoms_addr())[i] = nullptr;
}
}

View file

@ -149,8 +149,8 @@ namespace smt {
void release_atoms(ast_manager & m);
public:
static clause * mk(ast_manager & m, unsigned num_lits, literal * lits, clause_kind k, justification * js = 0,
clause_del_eh * del_eh = 0, bool save_atoms = false, expr * const * bool_var2expr_map = 0);
static clause * mk(ast_manager & m, unsigned num_lits, literal * lits, clause_kind k, justification * js = nullptr,
clause_del_eh * del_eh = nullptr, bool save_atoms = false, expr * const * bool_var2expr_map = nullptr);
void deallocate(ast_manager & m);
@ -211,11 +211,11 @@ namespace smt {
}
clause_del_eh * get_del_eh() const {
return m_has_del_eh ? *(get_del_eh_addr()) : 0;
return m_has_del_eh ? *(get_del_eh_addr()) : nullptr;
}
justification * get_justification() const {
return m_has_justification ? *(get_justification_addr()) : 0;
return m_has_justification ? *(get_justification_addr()) : nullptr;
}
unsigned get_num_atoms() const {
@ -253,7 +253,7 @@ namespace smt {
clause_del_eh * del_eh = get_del_eh();
if (del_eh) {
(*del_eh)(m, this);
*(const_cast<clause_del_eh **>(get_del_eh_addr())) = 0;
*(const_cast<clause_del_eh **>(get_del_eh_addr())) = nullptr;
}
}

View file

@ -43,7 +43,7 @@ namespace smt {
m_assigned_literals(assigned_literals),
m_lemma_atoms(m),
m_todo_js_qhead(0),
m_antecedents(0),
m_antecedents(nullptr),
m_watches(watches),
m_new_proofs(m),
m_lemma_proof(m)
@ -204,7 +204,7 @@ namespace smt {
eq2literals(p.first, p.second);
}
if (m_todo_js_qhead == m_todo_js.size()) {
m_antecedents = 0;
m_antecedents = nullptr;
return;
}
}
@ -480,7 +480,7 @@ namespace smt {
// save space for first uip
m_lemma.push_back(null_literal);
m_lemma_atoms.push_back(0);
m_lemma_atoms.push_back(nullptr);
unsigned num_marks = 0;
if (not_l != null_literal) {
@ -758,7 +758,7 @@ namespace smt {
return pr;
}
m_todo_pr.push_back(tp_elem(n1, n2));
return 0;
return nullptr;
}
/**
@ -766,7 +766,7 @@ namespace smt {
*/
proof * conflict_resolution::norm_eq_proof(enode * n1, enode * n2, proof * pr) {
if (!pr)
return 0;
return nullptr;
SASSERT(m_manager.has_fact(pr));
app * fact = to_app(m_manager.get_fact(pr));
app * n1_owner = n1->get_owner();
@ -814,7 +814,7 @@ namespace smt {
switch (js.get_kind()) {
case eq_justification::AXIOM:
UNREACHABLE();
return 0;
return nullptr;
case eq_justification::EQUATION:
TRACE("proof_gen_bug", tout << js.get_literal() << "\n"; m_ctx.display_literal_info(tout, js.get_literal()););
return norm_eq_proof(n1, n2, get_proof(js.get_literal()));
@ -845,11 +845,11 @@ namespace smt {
visited = false;
}
if (!visited)
return 0;
return nullptr;
app * e1 = n1->get_owner();
app * e2 = n2->get_owner();
app * e2_prime = m_manager.mk_app(e2->get_decl(), e2->get_arg(1), e2->get_arg(0));
proof * pr1 = 0;
proof * pr1 = nullptr;
if (!prs.empty()) {
pr1 = m_manager.mk_congruence(e1, e2_prime, prs.size(), prs.c_ptr());
m_new_proofs.push_back(pr1);
@ -877,14 +877,14 @@ namespace smt {
}
}
if (!visited)
return 0;
return nullptr;
proof * pr = m_manager.mk_congruence(n1->get_owner(), n2->get_owner(), prs.size(), prs.c_ptr());
m_new_proofs.push_back(pr);
return pr;
}
default:
UNREACHABLE();
return 0;
return nullptr;
}
}
@ -899,7 +899,7 @@ namespace smt {
return pr;
}
m_todo_pr.push_back(tp_elem(l));
return 0;
return nullptr;
}
/**
@ -945,7 +945,7 @@ namespace smt {
SASSERT(js);
proof * pr = get_proof(js);
ptr_buffer<proof> prs;
bool visited = pr != 0;
bool visited = pr != nullptr;
TRACE("get_proof_bug", if (pr != 0) tout << js->get_name() << "\n";);
CTRACE("get_proof_bug_after", invocation_counter >= DUMP_AFTER_NUM_INVOCATIONS, if (pr != 0) tout << js->get_name() << "\n";);
CTRACE("get_proof_bug_after", invocation_counter >= DUMP_AFTER_NUM_INVOCATIONS, if (pr != 0) js->display_debug_info(*this, tout););
@ -973,7 +973,7 @@ namespace smt {
visited = false;
}
if (!visited)
return 0;
return nullptr;
expr_ref l_exr(m_manager);
m_ctx.literal2expr(l, l_exr);
TRACE("get_proof_bug",
@ -1034,7 +1034,7 @@ namespace smt {
}
SASSERT(js != 0);
m_todo_pr.push_back(tp_elem(js));
return 0;
return nullptr;
}
void conflict_resolution::init_mk_proof() {
@ -1061,7 +1061,7 @@ namespace smt {
SASSERT(js.get_kind() != b_justification::AXIOM);
if (js.get_kind() == b_justification::CLAUSE) {
clause * cls = js.get_clause();
bool visited = get_proof(cls->get_justification()) != 0;
bool visited = get_proof(cls->get_justification()) != nullptr;
unsigned num_lits = cls->get_num_literals();
unsigned i = 0;
if (l != false_literal) {
@ -1070,20 +1070,20 @@ namespace smt {
}
else {
SASSERT(cls->get_literal(1) == l);
if (get_proof(~cls->get_literal(0)) == 0)
if (get_proof(~cls->get_literal(0)) == nullptr)
visited = false;
i = 2;
}
}
for (; i < num_lits; i++) {
SASSERT(cls->get_literal(i) != l);
if (get_proof(~cls->get_literal(i)) == 0)
if (get_proof(~cls->get_literal(i)) == nullptr)
visited = false;
}
return visited;
}
else
return get_proof(js.get_justification()) != 0;
return get_proof(js.get_justification()) != nullptr;
}
void conflict_resolution::mk_proof(literal l, b_justification js) {
@ -1114,11 +1114,11 @@ namespace smt {
UNREACHABLE();
break;
case eq_justification::EQUATION:
if (get_proof(js.get_literal()) == 0)
if (get_proof(js.get_literal()) == nullptr)
visited = false;
break;
case eq_justification::JUSTIFICATION:
if (get_proof(js.get_justification()) == 0)
if (get_proof(js.get_justification()) == nullptr)
visited = false;
break;
case eq_justification::CONGRUENCE: {
@ -1132,16 +1132,16 @@ namespace smt {
enode * c1_2 = n1->get_arg(1);
enode * c2_1 = n2->get_arg(0);
enode * c2_2 = n2->get_arg(1);
if (c1_1 != c2_2 && get_proof(c1_1, c2_2) == 0)
if (c1_1 != c2_2 && get_proof(c1_1, c2_2) == nullptr)
visited = false;
if (c1_2 != c2_1 && get_proof(c1_2, c2_1) == 0)
if (c1_2 != c2_1 && get_proof(c1_2, c2_1) == nullptr)
visited = false;
}
else {
for (unsigned i = 0; i < num_args; i++) {
enode * c1 = n1->get_arg(i);
enode * c2 = n2->get_arg(i);
if (c1 != c2 && get_proof(c1, c2) == 0)
if (c1 != c2 && get_proof(c1, c2) == nullptr)
visited = false;
}
}
@ -1204,7 +1204,7 @@ namespace smt {
}
prs2.pop_back();
}
proof * pr = 0;
proof * pr = nullptr;
SASSERT(!prs1.empty());
if (prs1.size() == 1)
pr = prs1[0];
@ -1290,13 +1290,13 @@ namespace smt {
}
SASSERT(visit_b_justification(consequent, conflict));
proof * pr = 0;
proof * pr = nullptr;
if (not_l == null_literal) {
pr = get_proof(false_literal, conflict);
SASSERT(pr);
}
else {
proof * prs[2] = { 0, 0};
proof * prs[2] = { nullptr, nullptr};
m_lit2proof.find(not_l, prs[0]);
SASSERT(prs[0]);
prs[1] = get_proof(consequent, conflict);
@ -1310,13 +1310,13 @@ namespace smt {
m_ctx.literal2expr(lit, l_expr);
lits.push_back(l_expr);
}
expr * fact = 0;
expr * fact = nullptr;
switch (lits.size()) {
case 0: fact = 0; break;
case 0: fact = nullptr; break;
case 1: fact = lits[0]; break;
default: fact = m_manager.mk_or(lits.size(), lits.c_ptr());
}
if (fact == 0)
if (fact == nullptr)
m_lemma_proof = pr;
else
m_lemma_proof = m_manager.mk_lemma(pr, fact);

View file

@ -244,7 +244,7 @@ namespace smt {
}
literal lit = mk_diseq(k, v);
literals.push_back(lit);
mk_clause(literals.size(), literals.c_ptr(), 0);
mk_clause(literals.size(), literals.c_ptr(), nullptr);
TRACE("context", display_literals_verbose(tout, literals.size(), literals.c_ptr()););
}
}

View file

@ -51,7 +51,7 @@ namespace smt {
m_relevancy_propagator(mk_relevancy_propagator(*this)),
m_random(p.m_random_seed),
m_flushing(false),
m_progress_callback(0),
m_progress_callback(nullptr),
m_next_progress_sample(0),
m_fingerprints(m_region),
m_b_internalized_stack(m),
@ -59,7 +59,7 @@ namespace smt {
m_final_check_idx(0),
m_cg_table(m),
m_dyn_ack_manager(*this, p),
m_is_diseq_tmp(0),
m_is_diseq_tmp(nullptr),
m_units_to_reassert(m_manager),
m_qhead(0),
m_simp_qhead(0),
@ -176,7 +176,7 @@ namespace smt {
for (unsigned i = 0; i < src_ctx.m_assigned_literals.size(); ++i) {
literal lit;
lit = TRANSLATE(src_ctx.m_assigned_literals[i]);
dst_ctx.mk_clause(1, &lit, 0, CLS_AUX, 0);
dst_ctx.mk_clause(1, &lit, nullptr, CLS_AUX, nullptr);
}
#if 0
literal_vector lits;
@ -232,8 +232,8 @@ namespace smt {
}
context * context::mk_fresh(symbol const * l, smt_params * p) {
context * new_ctx = alloc(context, m_manager, p == 0 ? m_fparams : *p);
new_ctx->set_logic(l == 0 ? m_setup.get_logic() : *l);
context * new_ctx = alloc(context, m_manager, p == nullptr ? m_fparams : *p);
new_ctx->set_logic(l == nullptr ? m_setup.get_logic() : *l);
copy_plugins(*this, *new_ctx);
return new_ctx;
}
@ -741,9 +741,9 @@ namespace smt {
enode * curr = n->m_trans.m_target;
enode * prev = n;
eq_justification js = n->m_trans.m_justification;
prev->m_trans.m_target = 0;
prev->m_trans.m_target = nullptr;
prev->m_trans.m_justification = null_eq_justification;
while (curr != 0) {
while (curr != nullptr) {
SASSERT(prev->trans_reaches(n));
enode * new_curr = curr->m_trans.m_target;
eq_justification new_js = curr->m_trans.m_justification;
@ -798,7 +798,7 @@ namespace smt {
theory_var context::get_closest_var(enode * n, theory_id th_id) {
if (th_id == null_theory_id)
return null_theory_var;
while (n != 0) {
while (n != nullptr) {
theory_var v = n->get_th_var(th_id);
if (v != null_theory_var)
return v;
@ -826,7 +826,7 @@ namespace smt {
if (js.get_kind() == eq_justification::JUSTIFICATION)
from_th = js.get_justification()->get_from_theory();
if (r2->m_th_var_list.get_next() == 0 && r1->m_th_var_list.get_next() == 0) {
if (r2->m_th_var_list.get_next() == nullptr && r1->m_th_var_list.get_next() == nullptr) {
// Common case: r2 and r1 have at most one theory var.
theory_id t2 = r2->m_th_var_list.get_th_id();
theory_id t1 = r1->m_th_var_list.get_th_id();
@ -1023,7 +1023,7 @@ namespace smt {
}
// restore theory vars
if (r2->m_th_var_list.get_next() == 0) {
if (r2->m_th_var_list.get_next() == nullptr) {
// common case: r2 has at most one variable
theory_var v2 = r2->m_th_var_list.get_th_var();
if (v2 != null_theory_var) {
@ -1043,7 +1043,7 @@ namespace smt {
// r1 -> .. -> n1 -> n2 -> ... -> r2
SASSERT(r1->trans_reaches(r2));
SASSERT(r1->trans_reaches(n1));
n1->m_trans.m_target = 0;
n1->m_trans.m_target = nullptr;
n1->m_trans.m_justification = null_eq_justification;
invert_trans(r1);
// ---------------
@ -1067,7 +1067,7 @@ namespace smt {
*/
void context::restore_theory_vars(enode * r2, enode * r1) {
SASSERT(r2->get_root() == r2);
theory_var_list * new_l2 = 0;
theory_var_list * new_l2 = nullptr;
theory_var_list * l2 = r2->get_th_var_list();
while (l2) {
theory_var v2 = l2->get_th_var();
@ -1091,11 +1091,11 @@ namespace smt {
}
if (new_l2) {
new_l2->set_next(0);
new_l2->set_next(nullptr);
}
else {
r2->m_th_var_list.set_th_var(null_theory_var);
r2->m_th_var_list.set_next(0);
r2->m_th_var_list.set_next(nullptr);
}
}
@ -1128,7 +1128,7 @@ namespace smt {
}
// Propagate disequalities to theories
if (r1->m_th_var_list.get_next() == 0 && r2->m_th_var_list.get_next() == 0) {
if (r1->m_th_var_list.get_next() == nullptr && r2->m_th_var_list.get_next() == nullptr) {
// common case: r2 and r1 have at most one theory var.
theory_id t1 = r1->m_th_var_list.get_th_id();
theory_var v1 = m_fparams.m_new_core2th_eq ? get_closest_var(n1, t1) : r1->m_th_var_list.get_th_var();
@ -1646,11 +1646,11 @@ namespace smt {
m_qmanager->relevant_eh(e);
}
theory * propagated_th = 0;
theory * propagated_th = nullptr;
family_id fid = to_app(n)->get_family_id();
if (fid != m_manager.get_basic_family_id()) {
theory * th = get_theory(fid);
if (th != 0) {
if (th != nullptr) {
th->relevant_eh(to_app(n));
propagated_th = th; // <<< mark that relevancy_eh was already invoked for theory th.
}
@ -2412,7 +2412,7 @@ namespace smt {
if (!bs.m_inconsistent) {
m_conflict = null_b_justification;
m_not_l = null_literal;
m_unsat_proof = 0;
m_unsat_proof = nullptr;
}
m_base_scopes.shrink(new_lvl);
}
@ -2532,7 +2532,7 @@ namespace smt {
if (m_manager.proofs_enabled() && !simp_lits.empty()) {
SASSERT(m_scope_lvl == m_base_lvl);
justification * js = cls->get_justification();
justification * new_js = 0;
justification * new_js = nullptr;
if (js->in_region())
new_js = mk_justification(unit_resolution_justification(m_region,
js,
@ -2586,7 +2586,7 @@ namespace smt {
}
}
justification * cls_js = cls->get_justification();
justification * js = 0;
justification * js = nullptr;
if (!cls_js || cls_js->in_region()) {
// If cls_js is 0 or is allocated in a region, then
// we can allocate the new justification in a region too.
@ -2598,7 +2598,7 @@ namespace smt {
else {
js = alloc(unit_resolution_justification, cls_js, simp_lits.size(), simp_lits.c_ptr());
// js took ownership of the justification object.
cls->set_justification(0);
cls->set_justification(nullptr);
m_justifications.push_back(js);
}
set_justification(v0, m_bdata[v0], b_justification(js));
@ -2851,7 +2851,7 @@ namespace smt {
#endif
void context::register_plugin(theory * th) {
if (m_theories.get_plugin(th->get_family_id()) != 0) {
if (m_theories.get_plugin(th->get_family_id()) != nullptr) {
dealloc(th);
return; // context already has a theory for the given family id.
}
@ -2905,12 +2905,12 @@ namespace smt {
void context::flush() {
flet<bool> l1(m_flushing, true);
TRACE("flush", tout << "m_scope_lvl: " << m_scope_lvl << "\n";);
m_relevancy_propagator = 0;
m_relevancy_propagator = nullptr;
m_model_generator->reset();
for (theory* t : m_theory_set)
t->flush_eh();
undo_trail_stack(0);
m_qmanager = 0;
m_qmanager = nullptr;
del_clauses(m_aux_clauses, 0);
del_clauses(m_lemmas, 0);
del_justifications(m_justifications, 0);
@ -2918,7 +2918,7 @@ namespace smt {
m_is_diseq_tmp->del_eh(m_manager, false);
m_manager.dec_ref(m_is_diseq_tmp->get_owner());
enode::del_dummy(m_is_diseq_tmp);
m_is_diseq_tmp = 0;
m_is_diseq_tmp = nullptr;
}
std::for_each(m_almost_cg_tables.begin(), m_almost_cg_tables.end(), delete_proc<almost_cg_table>());
}
@ -2929,7 +2929,7 @@ namespace smt {
TRACE("begin_assert_expr", tout << mk_pp(e, m_manager) << "\n";);
TRACE("begin_assert_expr_ll", tout << mk_ll_pp(e, m_manager) << "\n";);
pop_to_base_lvl();
if (pr == 0)
if (pr == nullptr)
m_asserted_formulas.assert_expr(e);
else
m_asserted_formulas.assert_expr(e, pr);
@ -2937,7 +2937,7 @@ namespace smt {
}
void context::assert_expr(expr * e) {
assert_expr(e, 0);
assert_expr(e, nullptr);
}
void context::assert_expr(expr * e, proof * pr) {
@ -2966,7 +2966,7 @@ namespace smt {
for (unsigned j = i+1; j < num_lits; ++j) {
literal l1 = lits[i];
literal l2 = lits[j];
mk_clause(~l1, ~l2, (justification*) 0);
mk_clause(~l1, ~l2, (justification*) nullptr);
}
}
} else {
@ -3084,7 +3084,7 @@ namespace smt {
}
if (m_asserted_formulas.inconsistent() && !inconsistent()) {
proof * pr = m_asserted_formulas.get_inconsistency_proof();
if (pr == 0) {
if (pr == nullptr) {
set_conflict(b_justification::mk_axiom());
}
else {
@ -3404,7 +3404,7 @@ namespace smt {
m_luby_idx = 1;
m_lemma_gc_threshold = m_fparams.m_lemma_gc_initial;
m_last_search_failure = OK;
m_unsat_proof = 0;
m_unsat_proof = nullptr;
m_unsat_core .reset();
m_dyn_ack_manager .init_search_eh();
m_final_check_idx = 0;
@ -3866,7 +3866,7 @@ namespace smt {
expr_signs.push_back(l.sign());
}
#endif
proof * pr = 0;
proof * pr = nullptr;
if (m_manager.proofs_enabled()) {
pr = m_conflict_resolution->get_lemma_proof();
// check_proof(pr);
@ -3939,7 +3939,7 @@ namespace smt {
}
}
#endif
justification * js = 0;
justification * js = nullptr;
if (m_manager.proofs_enabled()) {
js = alloc(justification_proof_wrapper, *this, pr, false);
}
@ -4271,7 +4271,7 @@ namespace smt {
sort * s = m_manager.get_sort(n->get_owner());
family_id fid = s->get_family_id();
theory * th = get_theory(fid);
if (th == 0)
if (th == nullptr)
return false;
return th->get_value(n, value);
}
@ -4321,13 +4321,13 @@ namespace smt {
proof * context::get_proof() {
if (!m_manager.proofs_enabled())
return 0;
return nullptr;
return m_unsat_proof;
}
void context::get_model(model_ref & m) const {
if (inconsistent())
m = 0;
m = nullptr;
else
m = const_cast<model*>(m_model.get());
}

View file

@ -203,11 +203,11 @@ namespace smt {
struct scoped_mk_model {
context & m_ctx;
scoped_mk_model(context & ctx):m_ctx(ctx) {
m_ctx.m_proto_model = 0;
m_ctx.m_model = 0;
m_ctx.m_proto_model = nullptr;
m_ctx.m_model = nullptr;
}
~scoped_mk_model() {
if (m_ctx.m_proto_model.get() != 0) {
if (m_ctx.m_proto_model.get() != nullptr) {
m_ctx.m_model = m_ctx.m_proto_model->mk_model();
try {
m_ctx.add_rec_funs_to_model();
@ -215,7 +215,7 @@ namespace smt {
catch (...) {
// no op
}
m_ctx.m_proto_model = 0; // proto_model is not needed anymore.
m_ctx.m_proto_model = nullptr; // proto_model is not needed anymore.
}
}
};
@ -514,12 +514,12 @@ namespace smt {
enode_vector::const_iterator begin_enodes_of(func_decl const * decl) const {
unsigned id = decl->get_decl_id();
return id < m_decl2enodes.size() ? m_decl2enodes[id].begin() : 0;
return id < m_decl2enodes.size() ? m_decl2enodes[id].begin() : nullptr;
}
enode_vector::const_iterator end_enodes_of(func_decl const * decl) const {
unsigned id = decl->get_decl_id();
return id < m_decl2enodes.size() ? m_decl2enodes[id].end() : 0;
return id < m_decl2enodes.size() ? m_decl2enodes[id].end() : nullptr;
}
ptr_vector<enode>::const_iterator begin_enodes() const {
@ -822,17 +822,17 @@ namespace smt {
void internalize(expr * n, bool gate_ctx, unsigned generation);
clause * mk_clause(unsigned num_lits, literal * lits, justification * j, clause_kind k = CLS_AUX, clause_del_eh * del_eh = 0);
clause * mk_clause(unsigned num_lits, literal * lits, justification * j, clause_kind k = CLS_AUX, clause_del_eh * del_eh = nullptr);
void mk_clause(literal l1, literal l2, justification * j);
void mk_clause(literal l1, literal l2, literal l3, justification * j);
void mk_th_axiom(theory_id tid, unsigned num_lits, literal * lits, unsigned num_params = 0, parameter * params = 0);
void mk_th_axiom(theory_id tid, unsigned num_lits, literal * lits, unsigned num_params = 0, parameter * params = nullptr);
void mk_th_axiom(theory_id tid, literal l1, literal l2, unsigned num_params = 0, parameter * params = 0);
void mk_th_axiom(theory_id tid, literal l1, literal l2, unsigned num_params = 0, parameter * params = nullptr);
void mk_th_axiom(theory_id tid, literal l1, literal l2, literal l3, unsigned num_params = 0, parameter * params = 0);
void mk_th_axiom(theory_id tid, literal l1, literal l2, literal l3, unsigned num_params = 0, parameter * params = nullptr);
/*
* Provide a hint to the core solver that the specified literals form a "theory case split".
@ -1460,7 +1460,7 @@ namespace smt {
If l == 0, then the logic of this context is used in the new context.
If p == 0, then this->m_params is used
*/
context * mk_fresh(symbol const * l = 0, smt_params * p = 0);
context * mk_fresh(symbol const * l = nullptr, smt_params * p = nullptr);
static void copy(context& src, context& dst);
@ -1482,7 +1482,7 @@ namespace smt {
void pop(unsigned num_scopes);
lbool check(unsigned num_assumptions = 0, expr * const * assumptions = 0, bool reset_cancel = true, bool already_did_theory_assumptions = false);
lbool check(unsigned num_assumptions = 0, expr * const * assumptions = nullptr, bool reset_cancel = true, bool already_did_theory_assumptions = false);
lbool get_consequences(expr_ref_vector const& assumptions, expr_ref_vector const& vars, expr_ref_vector& conseq, expr_ref_vector& unfixed);

View file

@ -32,7 +32,7 @@ namespace smt {
n->m_owner = owner;
n->m_root = n;
n->m_next = n;
n->m_cg = 0;
n->m_cg = nullptr;
n->m_class_size = 1;
n->m_generation = generation;
n->m_func_decl_id = UINT_MAX;
@ -130,11 +130,11 @@ namespace smt {
if (m_th_var_list.get_th_var() == null_theory_var) {
m_th_var_list.set_th_var(v);
m_th_var_list.set_th_id(id);
m_th_var_list.set_next(0);
m_th_var_list.set_next(nullptr);
}
else {
theory_var_list * l = &m_th_var_list;
while (l->get_next() != 0) {
while (l->get_next() != nullptr) {
SASSERT(l->get_th_id() != id);
l = l->get_next();
}
@ -172,11 +172,11 @@ namespace smt {
SASSERT(get_th_var(id) != null_theory_var);
if (m_th_var_list.get_th_id() == id) {
theory_var_list * next = m_th_var_list.get_next();
if (next == 0) {
if (next == nullptr) {
// most common case
m_th_var_list.set_th_var(null_theory_var);
m_th_var_list.set_th_id(null_theory_id);
m_th_var_list.set_next(0);
m_th_var_list.set_next(nullptr);
}
else {
m_th_var_list = *next;
@ -405,7 +405,7 @@ namespace smt {
tmp_enode::tmp_enode():
m_app(0),
m_capacity(0),
m_enode_data(0) {
m_enode_data(nullptr) {
SASSERT(m_app.get_app()->get_decl() == 0);
set_capacity(5);
}

View file

@ -33,7 +33,7 @@ namespace smt {
enode * m_target;
eq_justification m_justification;
trans_justification():
m_target(0),
m_target(nullptr),
m_justification(null_eq_justification) {
}
};
@ -116,7 +116,7 @@ namespace smt {
theory_var_list * get_th_var_list() {
return m_th_var_list.get_th_var() == null_theory_var ? 0 : &m_th_var_list;
return m_th_var_list.get_th_var() == null_theory_var ? nullptr : &m_th_var_list;
}
friend class set_merge_tf_trail;
@ -306,7 +306,7 @@ namespace smt {
}
theory_var_list const * get_th_var_list() const {
return m_th_var_list.get_th_var() == null_theory_var ? 0 : &m_th_var_list;
return m_th_var_list.get_th_var() == null_theory_var ? nullptr : &m_th_var_list;
}
bool has_th_vars() const {

View file

@ -78,7 +78,7 @@ namespace smt {
}
};
const eq_justification null_eq_justification(static_cast<justification*>(0));
const eq_justification null_eq_justification(static_cast<justification*>(nullptr));
};
#endif /* SMT_EQ_JUSTIFICATION_H_ */

View file

@ -96,7 +96,7 @@ namespace smt {
++m_stats_calls;
m_solver.push();
m_solver.assert_expr(m.mk_not(m.mk_eq(s, t)));
bool is_eq = l_false == m_solver.check_sat(0,0);
bool is_eq = l_false == m_solver.check_sat(0,nullptr);
m_solver.pop(1);
TRACE("get_implied_equalities", tout << mk_pp(t, m) << " = " << mk_pp(s, m) << " " << (is_eq?"eq":"unrelated") << "\n";);
if (is_eq) {
@ -123,7 +123,7 @@ namespace smt {
m_stats_timer.start();
m_solver.push();
m_solver.assert_expr(m.mk_not(m.mk_eq(s, t)));
bool is_eq = l_false == m_solver.check_sat(0,0);
bool is_eq = l_false == m_solver.check_sat(0,nullptr);
m_solver.pop(1);
m_stats_timer.stop();
TRACE("get_implied_equalities", tout << mk_pp(t, m) << " = " << mk_pp(s, m) << " " << (is_eq?"eq":"unrelated") << "\n";);
@ -155,7 +155,7 @@ namespace smt {
m_solver.push();
unsigned arity = get_array_arity(srt);
expr_ref_vector args(m);
args.push_back(0);
args.push_back(nullptr);
for (unsigned i = 0; i < arity; ++i) {
sort* srt_i = get_array_domain(srt, i);
expr* idx = m.mk_fresh_const("index", srt_i);
@ -163,10 +163,10 @@ namespace smt {
}
for (unsigned i = 0; i < terms.size(); ++i) {
args[0] = terms[i].term;
terms[i].term = m.mk_app(m_array_util.get_family_id(), OP_SELECT, 0, 0, args.size(), args.c_ptr());
terms[i].term = m.mk_app(m_array_util.get_family_id(), OP_SELECT, 0, nullptr, args.size(), args.c_ptr());
}
assert_relevant(terms);
VERIFY(m_solver.check_sat(0,0) != l_false);
VERIFY(m_solver.check_sat(0,nullptr) != l_false);
model_ref model1;
m_solver.get_model(model1);
SASSERT(model1.get());
@ -215,7 +215,7 @@ namespace smt {
expr* s = terms[vec[j]].term;
m_solver.push();
m_solver.assert_expr(m.mk_not(m.mk_eq(t, s)));
lbool is_sat = m_solver.check_sat(0,0);
lbool is_sat = m_solver.check_sat(0,nullptr);
m_solver.pop(1);
TRACE("get_implied_equalities", tout << mk_pp(t, m) << " = " << mk_pp(s, m) << " " << is_sat << "\n";);
if (is_sat == l_false) {
@ -284,7 +284,7 @@ namespace smt {
}
lbool reduce_cond(model_ref& model, expr* e) {
expr* e1 = 0, *e2 = 0;
expr* e1 = nullptr, *e2 = nullptr;
if (m.is_eq(e, e1, e2) && m_array_util.is_as_array(e1) && m_array_util.is_as_array(e2)) {
if (e1 == e2) {
return l_true;
@ -335,7 +335,7 @@ namespace smt {
m_solver.push();
assert_relevant(num_terms, terms);
lbool is_sat = m_solver.check_sat(0,0);
lbool is_sat = m_solver.check_sat(0,nullptr);
if (is_sat != l_false) {
model_ref model;

View file

@ -121,7 +121,7 @@ namespace smt {
bool visited = true;
family_id fid = to_app(n)->get_family_id();
theory * th = m_theories.get_plugin(fid);
bool def_int = th == 0 || th->default_internalizer();
bool def_int = th == nullptr || th->default_internalizer();
if (!def_int) {
ptr_buffer<expr> descendants;
get_foreign_descendants(to_app(n), fid, descendants);
@ -301,7 +301,7 @@ namespace smt {
e->mark_as_interpreted();
app_ref eq(m_manager.mk_eq(fapp, val), m_manager);
TRACE("assert_distinct", tout << "eq: " << mk_pp(eq, m_manager) << "\n";);
assert_default(eq, 0);
assert_default(eq, nullptr);
mark_as_relevant(eq.get());
// TODO: we may want to hide the auxiliary values val and the function f from the model.
}
@ -695,7 +695,7 @@ namespace smt {
void context::internalize_term(app * n) {
if (e_internalized(n)) {
theory * th = m_theories.get_plugin(n->get_family_id());
if (th != 0) {
if (th != nullptr) {
// This code is necessary because some theories may decide
// not to create theory variables for a nested application.
// Example:
@ -1271,7 +1271,7 @@ namespace smt {
case CLS_AUX: {
literal_buffer simp_lits;
if (!simplify_aux_clause_literals(num_lits, lits, simp_lits))
return 0; // clause is equivalent to true;
return nullptr; // clause is equivalent to true;
DEBUG_CODE({
for (unsigned i = 0; i < simp_lits.size(); i++) {
SASSERT(get_assignment(simp_lits[i]) == l_true);
@ -1284,7 +1284,7 @@ namespace smt {
}
case CLS_AUX_LEMMA: {
if (!simplify_aux_lemma_literals(num_lits, lits))
return 0; // clause is equivalent to true
return nullptr; // clause is equivalent to true
// simplify_aux_lemma_literals does not delete literals assigned to false, so
// it is not necessary to create a unit_resolution_justification
break;
@ -1303,14 +1303,14 @@ namespace smt {
if (j && !j->in_region())
m_justifications.push_back(j);
TRACE("mk_clause", tout << "empty clause... setting conflict\n";);
set_conflict(j == 0 ? b_justification::mk_axiom() : b_justification(j));
set_conflict(j == nullptr ? b_justification::mk_axiom() : b_justification(j));
SASSERT(inconsistent());
return 0;
return nullptr;
case 1:
if (j && !j->in_region())
m_justifications.push_back(j);
assign(lits[0], j);
return 0;
return nullptr;
case 2:
if (use_binary_clause_opt(lits[0], lits[1], lemma)) {
literal l1 = lits[0];
@ -1321,7 +1321,7 @@ namespace smt {
assign(l1, b_justification(~l2));
m_stats.m_num_mk_bin_clause++;
return 0;
return nullptr;
}
default: {
m_stats.m_num_mk_clause++;
@ -1404,7 +1404,7 @@ namespace smt {
}
void context::mk_th_axiom(theory_id tid, unsigned num_lits, literal * lits, unsigned num_params, parameter * params) {
justification * js = 0;
justification * js = nullptr;
TRACE("mk_th_axiom",
display_literals_verbose(tout, num_lits, lits);
tout << "\n";);
@ -1449,12 +1449,12 @@ namespace smt {
void context::mk_gate_clause(unsigned num_lits, literal * lits) {
if (m_manager.proofs_enabled()) {
proof * pr = mk_clause_def_axiom(num_lits, lits, 0);
proof * pr = mk_clause_def_axiom(num_lits, lits, nullptr);
TRACE("gate_clause", tout << mk_ll_pp(pr, m_manager););
mk_clause(num_lits, lits, mk_justification(justification_proof_wrapper(*this, pr)));
}
else {
mk_clause(num_lits, lits, 0);
mk_clause(num_lits, lits, nullptr);
}
}
@ -1487,7 +1487,7 @@ namespace smt {
mk_clause(num_lits, lits, mk_justification(justification_proof_wrapper(*this, pr)));
}
else {
mk_clause(num_lits, lits, 0);
mk_clause(num_lits, lits, nullptr);
}
}

View file

@ -90,17 +90,17 @@ namespace smt {
SASSERT(m_antecedent);
ptr_buffer<proof> prs;
proof * pr = cr.get_proof(m_antecedent);
bool visited = pr != 0;
bool visited = pr != nullptr;
prs.push_back(pr);
for (unsigned i = 0; i < m_num_literals; i++) {
proof * pr = cr.get_proof(m_literals[i]);
if (pr == 0)
if (pr == nullptr)
visited = false;
else
prs.push_back(pr);
}
if (!visited)
return 0;
return nullptr;
ast_manager & m = cr.get_manager();
TRACE("unit_resolution_justification_bug",
tout << "in mk_proof\n";
@ -150,7 +150,7 @@ namespace smt {
}
if (!visited)
return 0;
return nullptr;
expr * lhs = m_node1->get_root()->get_owner();
expr * rhs = m_node2->get_root()->get_owner();
@ -178,7 +178,7 @@ namespace smt {
proof * pr2 = m.mk_rewrite(m.get_fact(pr1), lit);
return m.mk_modus_ponens(pr1, pr2);
}
return 0;
return nullptr;
}
void eq_propagation_justification::get_antecedents(conflict_resolution & cr) {
@ -241,7 +241,7 @@ namespace smt {
mk_pp(m.get_fact(pr), m) << "\n";);
return pr;
}
return 0;
return nullptr;
}
simple_justification::simple_justification(region & r, unsigned num_lits, literal const * lits):
@ -266,7 +266,7 @@ namespace smt {
bool visited = true;
for (unsigned i = 0; i < m_num_literals; i++) {
proof * pr = cr.get_proof(m_literals[i]);
if (pr == 0)
if (pr == nullptr)
visited = false;
else
result.push_back(pr);
@ -284,15 +284,15 @@ namespace smt {
lits.push_back(l);
}
if (lits.size() == 1)
return m.mk_th_lemma(m_th_id, lits.get(0), 0, 0, m_params.size(), m_params.c_ptr());
return m.mk_th_lemma(m_th_id, lits.get(0), 0, nullptr, m_params.size(), m_params.c_ptr());
else
return m.mk_th_lemma(m_th_id, m.mk_or(lits.size(), lits.c_ptr()), 0, 0, m_params.size(), m_params.c_ptr());
return m.mk_th_lemma(m_th_id, m.mk_or(lits.size(), lits.c_ptr()), 0, nullptr, m_params.size(), m_params.c_ptr());
}
proof * theory_propagation_justification::mk_proof(conflict_resolution & cr) {
ptr_buffer<proof> prs;
if (!antecedent2proof(cr, prs))
return 0;
return nullptr;
context & ctx = cr.get_context();
ast_manager & m = cr.get_manager();
expr_ref fact(m);
@ -303,7 +303,7 @@ namespace smt {
proof * theory_conflict_justification::mk_proof(conflict_resolution & cr) {
ptr_buffer<proof> prs;
if (!antecedent2proof(cr, prs))
return 0;
return nullptr;
ast_manager & m = cr.get_manager();
return m.mk_th_lemma(m_th_id, m.mk_false(), prs.size(), prs.c_ptr(), m_params.size(), m_params.c_ptr());
}
@ -334,7 +334,7 @@ namespace smt {
for (unsigned i = 0; i < m_num_eqs; i++) {
enode_pair const & p = m_eqs[i];
proof * pr = cr.get_proof(p.first, p.second);
if (pr == 0)
if (pr == nullptr)
visited = false;
else
result.push_back(pr);
@ -345,7 +345,7 @@ namespace smt {
proof * ext_theory_propagation_justification::mk_proof(conflict_resolution & cr) {
ptr_buffer<proof> prs;
if (!antecedent2proof(cr, prs))
return 0;
return nullptr;
context & ctx = cr.get_context();
ast_manager & m = cr.get_manager();
expr_ref fact(m);
@ -356,7 +356,7 @@ namespace smt {
proof * ext_theory_conflict_justification::mk_proof(conflict_resolution & cr) {
ptr_buffer<proof> prs;
if (!antecedent2proof(cr, prs))
return 0;
return nullptr;
ast_manager & m = cr.get_manager();
return m.mk_th_lemma(m_th_id, m.mk_false(), prs.size(), prs.c_ptr(), m_params.size(), m_params.c_ptr());
}
@ -364,7 +364,7 @@ namespace smt {
proof * ext_theory_eq_propagation_justification::mk_proof(conflict_resolution & cr) {
ptr_buffer<proof> prs;
if (!antecedent2proof(cr, prs))
return 0;
return nullptr;
ast_manager & m = cr.get_manager();
context & ctx = cr.get_context();
expr * fact = ctx.mk_eq_atom(m_lhs->get_owner(), m_rhs->get_owner());
@ -415,9 +415,9 @@ namespace smt {
lits.push_back(l);
}
if (lits.size() == 1)
return m.mk_th_lemma(m_th_id, lits.get(0), 0, 0, m_params.size(), m_params.c_ptr());
return m.mk_th_lemma(m_th_id, lits.get(0), 0, nullptr, m_params.size(), m_params.c_ptr());
else
return m.mk_th_lemma(m_th_id, m.mk_or(lits.size(), lits.c_ptr()), 0, 0, m_params.size(), m_params.c_ptr());
return m.mk_th_lemma(m_th_id, m.mk_or(lits.size(), lits.c_ptr()), 0, nullptr, m_params.size(), m_params.c_ptr());
}
};

View file

@ -255,7 +255,7 @@ namespace smt {
theory_axiom_justification(family_id fid, region & r,
unsigned num_lits, literal const * lits,
unsigned num_params = 0, parameter* params = 0):
unsigned num_params = 0, parameter* params = nullptr):
simple_theory_justification(fid, r, num_lits, lits, num_params, params) {}
void get_antecedents(conflict_resolution & cr) override {}
@ -269,7 +269,7 @@ namespace smt {
literal m_consequent;
public:
theory_propagation_justification(family_id fid, region & r, unsigned num_lits, literal const * lits, literal consequent,
unsigned num_params = 0, parameter* params = 0):
unsigned num_params = 0, parameter* params = nullptr):
simple_theory_justification(fid, r, num_lits, lits, num_params, params), m_consequent(consequent) {}
proof * mk_proof(conflict_resolution & cr) override;
@ -282,7 +282,7 @@ namespace smt {
class theory_conflict_justification : public simple_theory_justification {
public:
theory_conflict_justification(family_id fid, region & r, unsigned num_lits, literal const * lits,
unsigned num_params = 0, parameter* params = 0):
unsigned num_params = 0, parameter* params = nullptr):
simple_theory_justification(fid, r, num_lits, lits, num_params, params) {}
proof * mk_proof(conflict_resolution & cr) override;
@ -322,7 +322,7 @@ namespace smt {
public:
ext_theory_simple_justification(family_id fid, region & r, unsigned num_lits, literal const * lits,
unsigned num_eqs, enode_pair const * eqs,
unsigned num_params = 0, parameter* params = 0):
unsigned num_params = 0, parameter* params = nullptr):
ext_simple_justification(r, num_lits, lits, num_eqs, eqs), m_th_id(fid), m_params(num_params, params) {}
~ext_theory_simple_justification() override {}
@ -341,7 +341,7 @@ namespace smt {
unsigned num_lits, literal const * lits,
unsigned num_eqs, enode_pair const * eqs,
literal consequent,
unsigned num_params = 0, parameter* params = 0):
unsigned num_params = 0, parameter* params = nullptr):
ext_theory_simple_justification(fid, r, num_lits, lits, num_eqs, eqs, num_params, params),
m_consequent(consequent) {}
@ -354,7 +354,7 @@ namespace smt {
public:
ext_theory_conflict_justification(family_id fid, region & r, unsigned num_lits, literal const * lits,
unsigned num_eqs, enode_pair const * eqs,
unsigned num_params = 0, parameter* params = 0):
unsigned num_params = 0, parameter* params = nullptr):
ext_theory_simple_justification(fid, r, num_lits, lits, num_eqs, eqs, num_params, params) {}
proof * mk_proof(conflict_resolution & cr) override;
@ -371,7 +371,7 @@ namespace smt {
unsigned num_lits, literal const * lits,
unsigned num_eqs, enode_pair const * eqs,
enode * lhs, enode * rhs,
unsigned num_params = 0, parameter* params = 0):
unsigned num_params = 0, parameter* params = nullptr):
ext_theory_simple_justification(fid, r, num_lits, lits, num_eqs, eqs, num_params, params), m_lhs(lhs), m_rhs(rhs) {}
proof * mk_proof(conflict_resolution & cr) override;
@ -392,7 +392,7 @@ namespace smt {
public:
theory_lemma_justification(family_id fid, context & ctx, unsigned num_lits, literal const * lits,
unsigned num_params = 0, parameter* params = 0);
unsigned num_params = 0, parameter* params = nullptr);
~theory_lemma_justification() override;

View file

@ -126,7 +126,7 @@ namespace smt {
/**
\brief Satisfiability check.
*/
lbool check(unsigned num_assumptions = 0, expr * const * assumptions = 0);
lbool check(unsigned num_assumptions = 0, expr * const * assumptions = nullptr);
lbool check(expr_ref_vector const& asms) { return check(asms.size(), asms.c_ptr()); }

View file

@ -33,19 +33,19 @@ namespace smt {
m(m),
m_params(p),
m_autil(m),
m_qm(0),
m_context(0),
m_root2value(0),
m_qm(nullptr),
m_context(nullptr),
m_root2value(nullptr),
m_model_finder(mf),
m_max_cexs(1),
m_iteration_idx(0),
m_curr_model(0),
m_curr_model(nullptr),
m_pinned_exprs(m) {
}
model_checker::~model_checker() {
m_aux_context = 0; // delete aux context before fparams
m_fparams = 0;
m_aux_context = nullptr; // delete aux context before fparams
m_fparams = nullptr;
}
quantifier * model_checker::get_flat_quantifier(quantifier * q) {
@ -72,7 +72,7 @@ namespace smt {
m_value2expr.insert(val, n->get_owner());
}
}
expr * t = 0;
expr * t = nullptr;
m_value2expr.find(val, t);
return t;
}
@ -111,10 +111,10 @@ namespace smt {
ptr_buffer<expr> subst_args;
unsigned num_decls = q->get_num_decls();
subst_args.resize(num_decls, 0);
sks.resize(num_decls, 0);
sks.resize(num_decls, nullptr);
for (unsigned i = 0; i < num_decls; i++) {
sort * s = q->get_decl_sort(num_decls - i - 1);
expr * sk = m.mk_fresh_const(0, s);
expr * sk = m.mk_fresh_const(nullptr, s);
sks[num_decls - i - 1] = sk;
subst_args[num_decls - i - 1] = sk;
if (m_curr_model->is_finite(s)) {
@ -132,7 +132,7 @@ namespace smt {
}
bool model_checker::add_instance(quantifier * q, model * cex, expr_ref_vector & sks, bool use_inv) {
if (cex == 0) {
if (cex == nullptr) {
TRACE("model_checker", tout << "no model is available\n";);
return false;
}
@ -158,7 +158,7 @@ namespace smt {
if (use_inv) {
unsigned sk_term_gen;
expr * sk_term = m_model_finder.get_inv(q, i, sk_value, sk_term_gen);
if (sk_term != 0) {
if (sk_term != nullptr) {
TRACE("model_checker", tout << "Found inverse " << mk_pp(sk_term, m) << "\n";);
SASSERT(!m.is_model_value(sk_term));
if (sk_term_gen > max_generation)
@ -172,7 +172,7 @@ namespace smt {
}
else {
expr * sk_term = get_term_from_ctx(sk_value);
if (sk_term != 0) {
if (sk_term != nullptr) {
sk_value = sk_term;
}
}
@ -323,7 +323,7 @@ namespace smt {
bool is_undef = false;
expr_ref_vector args(m);
unsigned num_decls = q->get_num_decls();
args.resize(num_decls, 0);
args.resize(num_decls, nullptr);
var_subst sub(m);
expr_ref tmp(m), result(m);
for (; it != end; ++it) {
@ -502,7 +502,7 @@ namespace smt {
expr_ref inst_expr(m);
instantiate(m, q, inst->m_bindings, inst_expr);
tout << "(assert " << mk_ismt2_pp(inst_expr, m) << ")\n";);
m_context->add_instance(q, 0, num_decls, bindings.c_ptr(), gen, gen, gen, dummy);
m_context->add_instance(q, nullptr, num_decls, bindings.c_ptr(), gen, gen, gen, dummy);
TRACE("model_checker_bug_detail", tout << "after instantiating, inconsistent: " << m_context->inconsistent() << "\n";);
}
}

View file

@ -120,7 +120,7 @@ namespace smt {
}
expr * get_inv(expr * v) const {
expr * t = 0;
expr * t = nullptr;
m_inv.find(v, t);
return t;
}
@ -140,7 +140,7 @@ namespace smt {
if (!t_val) break;
TRACE("model_finder", tout << mk_pp(t, m_manager) << " " << mk_pp(t_val, m_manager) << "\n";);
expr * old_t = 0;
expr * old_t = nullptr;
if (m_inv.find(t_val, old_t)) {
unsigned old_t_gen = 0;
SASSERT(m_elems.contains(old_t));
@ -223,14 +223,14 @@ namespace smt {
public:
node(unsigned id, sort * s):
m_id(id),
m_find(0),
m_find(nullptr),
m_eqc_size(1),
m_sort(s),
m_mono_proj(false),
m_signed_proj(false),
m_set(0),
m_else(0),
m_proj(0) {
m_set(nullptr),
m_else(nullptr),
m_proj(nullptr) {
}
~node() {
@ -242,7 +242,7 @@ namespace smt {
sort * get_sort() const { return m_sort; }
bool is_root() const { return m_find == 0; }
bool is_root() const { return m_find == nullptr; }
node * get_root() const {
node * curr = const_cast<node*>(this);
@ -428,7 +428,7 @@ namespace smt {
}
node * mk_node(key2node & m, ast * n, unsigned i, sort * s) {
node * r = 0;
node * r = nullptr;
ast_idx_pair k(n, i);
if (m.find(k, r)) {
SASSERT(r->get_sort() == s);
@ -469,11 +469,11 @@ namespace smt {
m_arith(m),
m_bv(m),
m_next_node_id(0),
m_context(0),
m_context(nullptr),
m_ks(m),
m_model(0),
m_model(nullptr),
m_eval_cache_range(m),
m_new_constraints(0) {
m_new_constraints(nullptr) {
}
virtual ~auf_solver() {
@ -523,10 +523,10 @@ namespace smt {
instantiation_set const * get_uvar_inst_set(quantifier * q, unsigned i) const {
SASSERT(!has_quantifiers(q->get_expr()));
ast_idx_pair k(q, i);
node * r = 0;
node * r = nullptr;
if (m_uvars.find(k, r))
return r->get_instantiation_set();
return 0;
return nullptr;
}
void mk_instantiation_sets() {
@ -567,13 +567,13 @@ namespace smt {
}
expr * eval(expr * n, bool model_completion) override {
expr * r = 0;
expr * r = nullptr;
if (m_eval_cache[model_completion].find(n, r)) {
return r;
}
expr_ref tmp(m);
if (!m_model->eval(n, tmp, model_completion)) {
r = 0;
r = nullptr;
TRACE("model_finder", tout << "eval\n" << mk_pp(n, m) << "\n-----> null\n";);
}
else {
@ -602,7 +602,7 @@ namespace smt {
for (node* a : avoid_set) {
node * n = a->get_root();
if (!n->is_mono_proj() && n->get_else() != 0) {
if (!n->is_mono_proj() && n->get_else() != nullptr) {
expr * val = eval(n->get_else(), true);
SASSERT(val != 0);
r.push_back(val);
@ -621,7 +621,7 @@ namespace smt {
instantiation_set const * s = n->get_instantiation_set();
obj_map<expr, unsigned> const & elems = s->get_elems();
expr * t_result = 0;
expr * t_result = nullptr;
unsigned gen_result = UINT_MAX;
for (auto const& kv : elems) {
expr * t = kv.m_key;
@ -635,7 +635,7 @@ namespace smt {
break;
}
}
if (!found && (t_result == 0 || gen < gen_result)) {
if (!found && (t_result == nullptr || gen < gen_result)) {
t_result = t;
gen_result = gen;
}
@ -652,7 +652,7 @@ namespace smt {
*/
app * get_k_for(sort * s) {
SASSERT(is_infinite(s));
app * r = 0;
app * r = nullptr;
if (m_sort2k.find(s, r))
return r;
r = m.mk_fresh_const("k", s);
@ -674,11 +674,11 @@ namespace smt {
SASSERT(is_infinite(s));
func_decl * k_decl = k->get_decl();
expr * r = m_model->get_const_interp(k_decl);
if (r != 0)
if (r != nullptr)
return r;
r = m_model->get_fresh_value(s);
if (r == 0)
return 0;
if (r == nullptr)
return nullptr;
m_model->register_decl(k_decl, r);
SASSERT(m_model->get_const_interp(k_decl) == r);
TRACE("model_finder", tout << mk_pp(r, m) << "\n";);
@ -694,7 +694,7 @@ namespace smt {
TRACE("assert_k_diseq_exceptions", tout << "assert_k_diseq_exceptions, " << "k: " << mk_pp(k, m) << "\nexceptions:\n";
for (expr * e : exceptions) tout << mk_pp(e, m) << "\n";);
expr * k_interp = get_k_interp(k);
if (k_interp == 0)
if (k_interp == nullptr)
return false;
for (expr * ex : exceptions) {
expr * ex_val = eval(ex, true);
@ -720,7 +720,7 @@ namespace smt {
ptr_buffer<expr> ex_vals;
collect_exceptions_values(n, ex_vals);
expr * e = pick_instance_diff_exceptions(n, ex_vals);
if (e != 0) {
if (e != nullptr) {
n->set_else(e);
return;
}
@ -912,7 +912,7 @@ namespace smt {
func_decl * f = to_func_decl(kv.m_key.first);
if (!r.contains(f)) {
func_interp * fi = m_model->get_func_interp(f);
if (fi == 0) {
if (fi == nullptr) {
fi = alloc(func_interp, m, f->get_arity());
m_model->register_decl(f, fi);
SASSERT(fi->is_partial());
@ -1013,10 +1013,10 @@ namespace smt {
is irrelevant after the projections are applied.
*/
func_decl * get_f_i_proj(func_decl * f, unsigned i) {
node * r = 0;
node * r = nullptr;
ast_idx_pair k(f, i);
if (!m_A_f_is.find(k, r))
return 0;
return nullptr;
return r->get_proj();
}
@ -1039,7 +1039,7 @@ namespace smt {
for (unsigned i = 0; i < arity; i++) {
var * v = m.mk_var(i, f->get_domain(i));
func_decl * pi = get_f_i_proj(f, i);
if (pi != 0) {
if (pi != nullptr) {
args.push_back(m.mk_app(pi, v));
has_proj = true;
}
@ -1384,9 +1384,9 @@ namespace smt {
func_decl * get_array_func_decl(app * ground_array, auf_solver & s) {
expr * ground_array_interp = s.eval(ground_array, false);
if (ground_array_interp != 0 && m_array.is_as_array(ground_array_interp))
if (ground_array_interp != nullptr && m_array.is_as_array(ground_array_interp))
return m_array.get_as_array_func_decl(ground_array_interp);
return 0;
return nullptr;
}
public:
@ -1656,7 +1656,7 @@ namespace smt {
expr * get_cond() const { return m_cond; }
bool is_unconditional() const { return m_cond == 0 || m_manager.is_true(m_cond); }
bool is_unconditional() const { return m_cond == nullptr || m_manager.is_true(m_cond); }
bool satisfy_atom() const { return m_satisfy_atom; }
@ -1736,8 +1736,8 @@ namespace smt {
m_flat_q(m),
m_is_auf(true),
m_has_x_eq_y(false),
m_the_one(0),
m_uvar_inst_sets(0) {
m_the_one(nullptr),
m_uvar_inst_sets(nullptr) {
if (has_quantifiers(q->get_expr())) {
static bool displayed_flat_msg = false;
if (!displayed_flat_msg) {
@ -1850,30 +1850,30 @@ namespace smt {
void populate_macro_based_inst_sets(context * ctx, evaluator & ev) {
SASSERT(m_the_one != 0);
if (m_uvar_inst_sets != 0)
if (m_uvar_inst_sets != nullptr)
return;
m_uvar_inst_sets = alloc(ptr_vector<instantiation_set>);
for (qinfo* qi : m_qinfo_vect)
qi->populate_inst_sets(m_flat_q, m_the_one, *m_uvar_inst_sets, ctx);
for (instantiation_set * s : *m_uvar_inst_sets) {
if (s != 0)
if (s != nullptr)
s->mk_inverse(ev);
}
}
instantiation_set * get_macro_based_inst_set(unsigned vidx, context * ctx, evaluator & ev) {
if (m_the_one == 0)
return 0;
if (m_the_one == nullptr)
return nullptr;
populate_macro_based_inst_sets(ctx, ev);
return m_uvar_inst_sets->get(vidx, 0);
}
void reset_the_one() {
m_the_one = 0;
m_the_one = nullptr;
if (m_uvar_inst_sets) {
std::for_each(m_uvar_inst_sets->begin(), m_uvar_inst_sets->end(), delete_proc<instantiation_set>());
dealloc(m_uvar_inst_sets);
m_uvar_inst_sets = 0;
m_uvar_inst_sets = nullptr;
}
}
};
@ -2389,7 +2389,7 @@ namespace smt {
m_array_util(m),
m_arith_util(m),
m_bv_util(m),
m_info(0) {
m_info(nullptr) {
}
@ -2416,7 +2416,7 @@ namespace smt {
collect_macro_candidates(q);
m_info = 0;
m_info = nullptr;
}
};
@ -2431,7 +2431,7 @@ namespace smt {
proto_model * m_model;
quantifier_info * get_qinfo(quantifier * q) const {
quantifier_info * qi = 0;
quantifier_info * qi = nullptr;
m_q2info.find(q, qi);
SASSERT(qi != 0);
return qi;
@ -2440,7 +2440,7 @@ namespace smt {
void set_else_interp(func_decl * f, expr * f_else) {
SASSERT(f_else != 0);
func_interp * fi = m_model->get_func_interp(f);
if (fi == 0) {
if (fi == nullptr) {
fi = alloc(func_interp, m_manager, f->get_arity());
m_model->register_decl(f, fi);
}
@ -2453,7 +2453,7 @@ namespace smt {
base_macro_solver(ast_manager & m, obj_map<quantifier, quantifier_info *> const & q2i):
m_manager(m),
m_q2info(q2i),
m_model(0) {
m_model(nullptr) {
}
virtual ~base_macro_solver() {}
@ -2596,7 +2596,7 @@ namespace smt {
void insert_q_f(quantifier * q, func_decl * f) {
SASSERT(!m_forbidden.contains(f));
quantifier_set * s = 0;
quantifier_set * s = nullptr;
if (!m_q_f.find(f, s)) {
s = alloc(quantifier_set);
m_q_f.insert(f, s);
@ -2607,7 +2607,7 @@ namespace smt {
}
void insert_f2def(func_decl * f, expr * def) {
expr_set * s = 0;
expr_set * s = nullptr;
if (!m_f2defs.find(f, s)) {
s = alloc(expr_set);
m_f2defs.insert(f, s);
@ -2619,7 +2619,7 @@ namespace smt {
void insert_q_f_def(quantifier * q, func_decl * f, expr * def) {
SASSERT(!m_forbidden.contains(f));
quantifier_set * s = 0;
quantifier_set * s = nullptr;
if (!m_q_f_def.find(f, def, s)) {
s = alloc(quantifier_set);
m_q_f_def.insert(f, def, s);
@ -2631,21 +2631,21 @@ namespace smt {
}
quantifier_set * get_q_f(func_decl * f) {
quantifier_set * s = 0;
quantifier_set * s = nullptr;
m_q_f.find(f, s);
SASSERT(s != 0);
return s;
}
quantifier_set * get_q_f_def(func_decl * f, expr * def) {
quantifier_set * s = 0;
quantifier_set * s = nullptr;
m_q_f_def.find(f, def, s);
SASSERT(s != 0);
return s;
}
expr_set * get_f_defs(func_decl * f) {
expr_set * s = 0;
expr_set * s = nullptr;
m_f2defs.find(f, s);
SASSERT(s != 0);
return s;
@ -2762,7 +2762,7 @@ namespace smt {
void operator()(quantifier * q, bool ins) {
quantifier_info * qi = m_owner->get_qinfo(q);
qi->set_the_one(0);
qi->set_the_one(nullptr);
}
ev_handler(hint_solver * o):
@ -3020,7 +3020,7 @@ namespace smt {
// Return true if r1 is a better macro than r2.
bool is_better_macro(cond_macro * r1, cond_macro * r2) {
if (r2 == 0 || !r1->is_hint())
if (r2 == nullptr || !r1->is_hint())
return true;
if (!r2->is_hint())
return false;
@ -3031,7 +3031,7 @@ namespace smt {
}
cond_macro * get_macro_for(func_decl * f, quantifier * q) {
cond_macro * r = 0;
cond_macro * r = nullptr;
quantifier_info * qi = get_qinfo(q);
quantifier_info::macro_iterator it = qi->begin_macros();
quantifier_info::macro_iterator end = qi->end_macros();
@ -3094,14 +3094,14 @@ namespace smt {
if (m->is_unconditional())
return; // f is part of a full macro... ignoring it.
to_remove.push_back(q);
if (fi_else.get() == 0) {
if (fi_else.get() == nullptr) {
fi_else = m->get_def();
}
else {
fi_else = m_manager.mk_ite(m->get_cond(), m->get_def(), fi_else);
}
}
if (fi_else.get() != 0 && add_macro(f, fi_else)) {
if (fi_else.get() != nullptr && add_macro(f, fi_else)) {
for (quantifier * q : to_remove) {
get_qinfo(q)->set_the_one(f);
removed.insert(q);
@ -3139,7 +3139,7 @@ namespace smt {
non_auf_macro_solver(ast_manager & m, obj_map<quantifier, quantifier_info *> const & q2i, func_decl_dependencies & d):
base_macro_solver(m, q2i),
m_dependencies(d),
m_qi_params(0) {
m_qi_params(nullptr) {
}
void set_params(qi_params const & p) {
@ -3157,7 +3157,7 @@ namespace smt {
model_finder::model_finder(ast_manager & m):
m_manager(m),
m_context(0),
m_context(nullptr),
m_analyzer(alloc(quantifier_analyzer, *this, m)),
m_auf_solver(alloc(auf_solver, m)),
m_dependencies(m),
@ -3182,7 +3182,7 @@ namespace smt {
}
mf::quantifier_info * model_finder::get_quantifier_info(quantifier * q) const {
quantifier_info * info = 0;
quantifier_info * info = nullptr;
m_q2info.find(q, info);
SASSERT(info != 0);
return info;
@ -3348,7 +3348,7 @@ namespace smt {
instantiation_set const * r = m_auf_solver->get_uvar_inst_set(flat_q, flat_q->get_num_decls() - q->get_num_decls() + i);
TRACE("model_finder", tout << "q: #" << q->get_id() << "\n" << mk_pp(q,m_manager) << "\nflat_q: " << mk_pp(flat_q, m_manager)
<< "\ni: " << i << " " << flat_q->get_num_decls() - q->get_num_decls() + i << "\n";);
if (r != 0)
if (r != nullptr)
return r;
// quantifier was not processed by AUF solver...
// it must have been satisfied by "macro"/"hint".
@ -3368,10 +3368,10 @@ namespace smt {
*/
expr * model_finder::get_inv(quantifier * q, unsigned i, expr * val, unsigned & generation) const {
instantiation_set const * s = get_uvar_inst_set(q, i);
if (s == 0)
return 0;
if (s == nullptr)
return nullptr;
expr * t = s->get_inv(val);
if (t != 0) {
if (t != nullptr) {
generation = s->get_generation(t);
}
return t;
@ -3399,7 +3399,7 @@ namespace smt {
for (unsigned i = 0; i < num_decls; i++) {
expr * sk = sks.get(num_decls - i - 1);
instantiation_set const * s = get_uvar_inst_set(q, i);
if (s == 0)
if (s == nullptr)
continue; // nothing to do
obj_map<expr, expr *> const & inv = s->get_inv_map();
if (inv.empty())

View file

@ -29,10 +29,10 @@ namespace smt {
model_generator::model_generator(ast_manager & m):
m_manager(m),
m_context(0),
m_context(nullptr),
m_fresh_idx(1),
m_asts(m_manager),
m_model(0) {
m_model(nullptr) {
}
model_generator::~model_generator() {
@ -44,7 +44,7 @@ namespace smt {
m_fresh_idx = 1;
m_root2value.reset();
m_asts.reset();
m_model = 0;
m_model = nullptr;
}
void model_generator::init_model() {
@ -89,7 +89,7 @@ namespace smt {
if (r == r->get_root() && m_context->is_relevant(r)) {
roots.push_back(r);
sort * s = m_manager.get_sort(r->get_owner());
model_value_proc * proc = 0;
model_value_proc * proc = nullptr;
if (m_manager.is_bool(s)) {
CTRACE("model", m_context->get_assignment(r) == l_undef,
tout << mk_pp(r->get_owner(), m_manager) << "\n";);
@ -177,7 +177,7 @@ namespace smt {
if (m_manager.get_sort(r->get_owner()) != s)
continue;
SASSERT(r == r->get_root());
model_value_proc * proc = 0;
model_value_proc * proc = nullptr;
root2proc.find(r, proc);
SASSERT(proc);
if (proc->is_fresh())
@ -196,7 +196,7 @@ namespace smt {
enode * n = src.get_enode();
SASSERT(n == n->get_root());
bool visited = true;
model_value_proc * proc = 0;
model_value_proc * proc = nullptr;
root2proc.find(n, proc);
SASSERT(proc);
buffer<model_value_dependency> dependencies;
@ -283,7 +283,7 @@ namespace smt {
sz = roots.size();
for (unsigned i = 0; i < sz; i++) {
enode * r = roots[i];
model_value_proc * proc = 0;
model_value_proc * proc = nullptr;
root2proc.find(r, proc);
SASSERT(proc);
if (!proc->is_fresh())
@ -345,7 +345,7 @@ namespace smt {
TRACE("mg_top_sort", tout << "#" << n->get_owner_id() << "\n";);
dependencies.reset();
dependency_values.reset();
model_value_proc * proc = 0;
model_value_proc * proc = nullptr;
VERIFY(root2proc.find(n, proc));
SASSERT(proc);
proc->get_dependencies(dependencies);
@ -364,7 +364,7 @@ namespace smt {
enode * child = d.get_enode();
TRACE("mg_top_sort", tout << "#" << n->get_owner_id() << " (" << mk_pp(n->get_owner(), m_manager) << "): " << mk_pp(child->get_owner(), m_manager) << " " << mk_pp(child->get_root()->get_owner(), m_manager) << "\n";);
child = child->get_root();
app * val = 0;
app * val = nullptr;
m_root2value.find(child, val);
SASSERT(val);
dependency_values.push_back(val);
@ -395,7 +395,7 @@ namespace smt {
}
app * model_generator::get_value(enode * n) const {
app * val = 0;
app * val = nullptr;
m_root2value.find(n->get_root(), val);
SASSERT(val);
return val;
@ -438,7 +438,7 @@ namespace smt {
args.push_back(arg);
}
func_interp * fi = m_model->get_func_interp(f);
if (fi == 0) {
if (fi == nullptr) {
fi = alloc(func_interp, m_manager, f->get_arity());
m_model->register_decl(f, fi);
}
@ -454,7 +454,7 @@ namespace smt {
tout << "value: #" << n->get_owner_id() << "\n" << mk_ismt2_pp(result, m_manager) << "\n";);
if (m_context->get_last_search_failure() == smt::THEORY) {
// if the theory solvers are incomplete, then we cannot assume the e-graph is close under congruence
if (fi->get_entry(args.c_ptr()) == 0)
if (fi->get_entry(args.c_ptr()) == nullptr)
fi->insert_new_entry(args.c_ptr(), result);
}
else {

View file

@ -80,7 +80,7 @@ namespace smt {
unsigned m_idx;
expr * m_value;
public:
extra_fresh_value(sort * s, unsigned idx):m_sort(s), m_idx(idx), m_value(0) {}
extra_fresh_value(sort * s, unsigned idx):m_sort(s), m_idx(idx), m_value(nullptr) {}
sort * get_sort() const { return m_sort; }
unsigned get_idx() const { return m_idx; }
void set_value(expr * n) { SASSERT(m_value == 0); m_value = n; }
@ -100,7 +100,7 @@ namespace smt {
extra_fresh_value * m_value; //!< When m_fresh == true, contains the sort of the fresh value
};
public:
model_value_dependency():m_fresh(true), m_value(0) {}
model_value_dependency():m_fresh(true), m_value(nullptr) {}
model_value_dependency(enode * n):m_fresh(false), m_enode(n->get_root()) {}
model_value_dependency(extra_fresh_value * v):m_fresh(true), m_value(v) {}
bool is_fresh_value() const { return m_fresh; }

View file

@ -143,7 +143,7 @@ namespace smt {
tout << "inserted: " << (f != 0) << "\n";
);
return f != 0;
return f != nullptr;
}
void init_search_eh() {
@ -300,7 +300,7 @@ namespace smt {
bool quantifier_manager::add_instance(quantifier * q, unsigned num_bindings, enode * const * bindings, unsigned generation) {
ptr_vector<enode> tmp;
return add_instance(q, 0, num_bindings, bindings, generation, generation, generation, tmp);
return add_instance(q, nullptr, num_bindings, bindings, generation, generation, generation, tmp);
}
void quantifier_manager::init_search_eh() {
@ -408,8 +408,8 @@ namespace smt {
bool m_active;
public:
default_qm_plugin():
m_qm(0),
m_context(0),
m_qm(nullptr),
m_context(nullptr),
m_new_enode_qhead(0),
m_lazy_matching_idx(0),
m_active(false) {

View file

@ -119,7 +119,7 @@ namespace smt {
expr * m_expr;
unsigned m_depth:31;
bool m_depth_only:1; //!< track only the depth of this entry.
entry():m_expr(0), m_depth(0), m_depth_only(false) {}
entry():m_expr(nullptr), m_depth(0), m_depth_only(false) {}
entry(expr * n, unsigned depth = 0, bool depth_only = false):m_expr(n), m_depth(depth), m_depth_only(depth_only) {}
};
ast_manager & m_manager;

View file

@ -108,7 +108,7 @@ namespace smt {
if (n->get_family_id() != m_manager.get_basic_family_id())
collect(arg, n->get_decl(), j);
else
collect(arg, 0, 0);
collect(arg, nullptr, 0);
}
}
}
@ -157,7 +157,7 @@ namespace smt {
flet<bool> l(m_conservative, conservative);
init(q);
TRACE("collector", tout << "model checking: #" << q->get_id() << "\n" << mk_pp(q, m_manager) << "\n";);
collect(q->get_expr(), 0, 0);
collect(q->get_expr(), nullptr, 0);
save_result(candidates);
}
@ -251,7 +251,7 @@ namespace smt {
TRACE("quick_checker_sizes", tout << "found new candidate\n";
for (unsigned i = 0; i < m_num_bindings; i++) tout << "#" << m_bindings[i]->get_owner_id() << " "; tout << "\n";);
unsigned max_generation = get_max_generation(m_num_bindings, m_bindings.c_ptr());
if (m_context.add_instance(q, 0 /* no pattern was used */, m_num_bindings, m_bindings.c_ptr(), max_generation,
if (m_context.add_instance(q, nullptr /* no pattern was used */, m_num_bindings, m_bindings.c_ptr(), max_generation,
0, // min_top_generation is only available for instances created by the MAM
0, // max_top_generation is only available for instances created by the MAM
empty_used_enodes))

View file

@ -50,7 +50,7 @@ namespace smt {
expr * m_expr;
func_decl * m_parent;
unsigned m_parent_pos;
entry(expr * n = 0, func_decl * d = 0, unsigned p = 0):m_expr(n), m_parent(d), m_parent_pos(p) {}
entry(expr * n = nullptr, func_decl * d = nullptr, unsigned p = 0):m_expr(n), m_parent(d), m_parent_pos(p) {}
unsigned hash() const { return m_parent ? mk_mix(m_expr->get_id(), m_parent->get_id(), m_parent_pos) : m_expr->get_id(); }
bool operator==(entry const & e) const { return m_expr == e.m_expr && m_parent == e.m_parent && m_parent_pos == e.m_parent_pos; }
};

View file

@ -159,28 +159,28 @@ namespace smt {
}
relevancy_ehs * get_handlers(expr * n) {
relevancy_ehs * r = 0;
relevancy_ehs * r = nullptr;
m_relevant_ehs.find(n, r);
SASSERT(m_relevant_ehs.contains(n) || r == 0);
return r;
}
void set_handlers(expr * n, relevancy_ehs * ehs) {
if (ehs == 0)
if (ehs == nullptr)
m_relevant_ehs.erase(n);
else
m_relevant_ehs.insert(n, ehs);
}
relevancy_ehs * get_watches(expr * n, bool val) {
relevancy_ehs * r = 0;
relevancy_ehs * r = nullptr;
m_watches[val ? 1 : 0].find(n, r);
SASSERT(m_watches[val ? 1 : 0].contains(n) || r == 0);
return r;
}
void set_watches(expr * n, bool val, relevancy_ehs * ehs) {
if (ehs == 0)
if (ehs == nullptr)
m_watches[val ? 1 : 0].erase(n);
else
m_watches[val ? 1 : 0].insert(n, ehs);
@ -330,7 +330,7 @@ namespace smt {
return;
if (!is_relevant_core(n)) {
enode * e = m_context.find_enode(n);
if (e != 0) {
if (e != nullptr) {
enode * curr = e;
do {
set_relevant(curr->get_owner());
@ -376,7 +376,7 @@ namespace smt {
case l_undef:
break;
case l_true: {
expr * true_arg = 0;
expr * true_arg = nullptr;
unsigned num_args = n->get_num_args();
for (unsigned i = 0; i < num_args; i++) {
expr * arg = n->get_arg(i);
@ -400,7 +400,7 @@ namespace smt {
lbool val = m_context.find_assignment(n);
switch (val) {
case l_false: {
expr * false_arg = 0;
expr * false_arg = nullptr;
unsigned num_args = n->get_num_args();
for (unsigned i = 0; i < num_args; i++) {
expr * arg = n->get_arg(i);
@ -487,7 +487,7 @@ namespace smt {
}
relevancy_ehs * ehs = get_handlers(n);
while (ehs != 0) {
while (ehs != nullptr) {
ehs->head()->operator()(*this, n);
ehs = ehs->tail();
}
@ -510,7 +510,7 @@ namespace smt {
propagate_relevant_and(to_app(n));
}
relevancy_ehs * ehs = get_watches(n, val);
while (ehs != 0) {
while (ehs != nullptr) {
ehs->head()->operator()(*this, n, val);
ehs = ehs->tail();
}

View file

@ -195,7 +195,7 @@ namespace smt {
void get_labels(svector<symbol> & r) override {
buffer<symbol> tmp;
m_context.get_relevant_labels(0, tmp);
m_context.get_relevant_labels(nullptr, tmp);
r.append(tmp.size(), tmp.c_ptr());
}

View file

@ -130,8 +130,8 @@ namespace smt {
theory::theory(family_id fid):
m_id(fid),
m_context(0),
m_manager(0) {
m_context(nullptr),
m_manager(nullptr) {
}
theory::~theory() {

View file

@ -235,7 +235,7 @@ namespace smt {
disequality propagation.
*/
virtual justification * why_is_diseq(theory_var v1, theory_var v2) {
return 0;
return nullptr;
}
/**
@ -369,7 +369,7 @@ namespace smt {
theory_var other = null_theory_var;
TRACE("assume_eqs",
tout << "#" << n->get_owner_id() << " is_relevant_and_shared: " << is_relevant_and_shared(n) << "\n";);
if (n != 0 && is_relevant_and_shared(n)) {
if (n != nullptr && is_relevant_and_shared(n)) {
other = table.insert_if_not_there(v);
if (other != v) {
enode * n2 = get_enode(other);
@ -423,7 +423,7 @@ namespace smt {
\brief Return a functor that can build the value (interpretation) for n.
*/
virtual model_value_proc * mk_value(enode * n, model_generator & mg) {
return 0;
return nullptr;
}
virtual bool include_func_interp(func_decl* f) {

View file

@ -32,10 +32,10 @@ namespace smt {
theory_var_list():
m_th_id(null_theory_id),
m_th_var(null_theory_var),
m_next(0) {
m_next(nullptr) {
}
theory_var_list(theory_id t, theory_var v, theory_var_list * n = 0):
theory_var_list(theory_id t, theory_var v, theory_var_list * n = nullptr):
m_th_id(t),
m_th_var(v),
m_next(n) {

View file

@ -74,7 +74,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;
reduce(*(in.get()));
in->inc_depth();
result.push_back(in.get());
@ -126,7 +126,7 @@ protected:
m_solver.pop(1);
});
g.reset();
g.assert_expr(fml, 0, 0);
g.assert_expr(fml, nullptr, nullptr);
IF_VERBOSE(TACTIC_VERBOSITY_LVL, verbose_stream() << "(ctx-solver-simplify :num-steps " << m_num_steps << ")\n";);
SASSERT(g.is_well_sorted());
}
@ -140,7 +140,7 @@ protected:
m_parent(p), m_self(s), m_idx(i), m_expr(e)
{}
expr_pos():
m_parent(0), m_self(0), m_idx(0), m_expr(0)
m_parent(0), m_self(0), m_idx(0), m_expr(nullptr)
{}
};
@ -193,7 +193,7 @@ protected:
a = to_app(e);
sz = a->get_num_args();
n2 = 0;
n2 = nullptr;
for (unsigned i = 0; i < sz; ++i) {
expr* arg = a->get_arg(i);

View file

@ -47,8 +47,8 @@ class smt_tactic : public tactic {
public:
smt_tactic(params_ref const & p):
m_params_ref(p),
m_ctx(0),
m_callback(0) {
m_ctx(nullptr),
m_callback(nullptr) {
updt_params_core(p);
TRACE("smt_tactic", tout << "p: " << p << "\n";);
}
@ -136,7 +136,7 @@ public:
~scoped_init_ctx() {
smt::kernel * d = m_owner.m_ctx;
m_owner.m_ctx = 0;
m_owner.m_ctx = nullptr;
if (d)
dealloc(d);
@ -151,7 +151,7 @@ public:
expr_dependency_ref & core) override {
try {
IF_VERBOSE(10, verbose_stream() << "(smt.tactic start)\n";);
mc = 0; pc = 0; core = 0;
mc = nullptr; pc = nullptr; core = nullptr;
SASSERT(in->is_well_sorted());
ast_manager & m = in->m();
TRACE("smt_tactic", tout << this << "\nAUTO_CONFIG: " << fparams().m_auto_config << " HIDIV0: " << fparams().m_hi_div0 << " "
@ -220,7 +220,7 @@ public:
model_ref md;
m_ctx->get_model(md);
buffer<symbol> r;
m_ctx->get_relevant_labels(0, r);
m_ctx->get_relevant_labels(nullptr, r);
mc = model_and_labels2model_converter(md.get(), r);
mc = concat(fmc.get(), mc.get());
}
@ -233,8 +233,8 @@ public:
}
// formula is unsat, reset the goal, and store false there.
in->reset();
proof * pr = 0;
expr_dependency * lcore = 0;
proof * pr = nullptr;
expr_dependency * lcore = nullptr;
if (in->proofs_enabled())
pr = m_ctx->get_proof();
if (in->unsat_core_enabled()) {
@ -269,7 +269,7 @@ public:
model_ref md;
m_ctx->get_model(md);
buffer<symbol> r;
m_ctx->get_relevant_labels(0, r);
m_ctx->get_relevant_labels(nullptr, r);
mc = model_and_labels2model_converter(md.get(), r);
}
return;

View file

@ -561,16 +561,16 @@ namespace smt {
bound * upper(theory_var v) const { return m_bounds[1][v]; }
inf_numeral const & lower_bound(theory_var v) const { SASSERT(lower(v) != 0); return lower(v)->get_value(); }
inf_numeral const & upper_bound(theory_var v) const { SASSERT(upper(v) != 0); return upper(v)->get_value(); }
bool below_lower(theory_var v) const { bound * l = lower(v); return l != 0 && get_value(v) < l->get_value(); }
bool above_upper(theory_var v) const { bound * u = upper(v); return u != 0 && get_value(v) > u->get_value(); }
bool below_upper(theory_var v) const { bound * u = upper(v); return u == 0 || get_value(v) < u->get_value(); }
bool above_lower(theory_var v) const { bound * l = lower(v); return l == 0 || get_value(v) > l->get_value(); }
bool below_lower(theory_var v) const { bound * l = lower(v); return l != nullptr && get_value(v) < l->get_value(); }
bool above_upper(theory_var v) const { bound * u = upper(v); return u != nullptr && get_value(v) > u->get_value(); }
bool below_upper(theory_var v) const { bound * u = upper(v); return u == nullptr || get_value(v) < u->get_value(); }
bool above_lower(theory_var v) const { bound * l = lower(v); return l == nullptr || get_value(v) > l->get_value(); }
bool at_bound(theory_var v) const;
bool at_lower(theory_var v) const { bound * l = lower(v); return l != 0 && get_value(v) == l->get_value(); }
bool at_upper(theory_var v) const { bound * u = upper(v); return u != 0 && get_value(v) == u->get_value(); }
bool is_free(theory_var v) const { return lower(v) == 0 && upper(v) == 0; }
bool is_non_free(theory_var v) const { return lower(v) != 0 || upper(v) != 0; }
bool is_bounded(theory_var v) const { return lower(v) != 0 && upper(v) != 0; }
bool at_lower(theory_var v) const { bound * l = lower(v); return l != nullptr && get_value(v) == l->get_value(); }
bool at_upper(theory_var v) const { bound * u = upper(v); return u != nullptr && get_value(v) == u->get_value(); }
bool is_free(theory_var v) const { return lower(v) == nullptr && upper(v) == nullptr; }
bool is_non_free(theory_var v) const { return lower(v) != nullptr || upper(v) != nullptr; }
bool is_bounded(theory_var v) const { return lower(v) != nullptr && upper(v) != nullptr; }
bool is_free(expr * n) const {
SASSERT(get_context().e_internalized(n) && get_context().get_enode(n)->get_th_var(get_id()) != null_theory_var);
return is_free(get_context().get_enode(n)->get_th_var(get_id()));

View file

@ -279,7 +279,7 @@ namespace smt {
return it;
}
}
return 0;
return nullptr;
}
template<typename Ext>
@ -357,7 +357,7 @@ namespace smt {
template<typename Ext>
parameter * theory_arith<Ext>::antecedents_t::params(char const* name) {
if (empty()) return 0;
if (empty()) return nullptr;
init();
m_params[0] = parameter(symbol(name));
return m_params.c_ptr();
@ -444,19 +444,19 @@ namespace smt {
template<typename Ext>
bool theory_arith<Ext>::at_bound(theory_var v) const {
bound * l = lower(v);
if (l != 0 && get_value(v) == l->get_value())
if (l != nullptr && get_value(v) == l->get_value())
return true;
bound * u = upper(v);
return u != 0 && get_value(v) == u->get_value();
return u != nullptr && get_value(v) == u->get_value();
}
template<typename Ext>
bool theory_arith<Ext>::is_fixed(theory_var v) const {
bound * l = lower(v);
if (l == 0)
if (l == nullptr)
return false;
bound * u = upper(v);
if (u == 0)
if (u == nullptr)
return false;
return l->get_value() == u->get_value();
}
@ -483,7 +483,7 @@ namespace smt {
while (true) {
column const & c = m_columns[v];
if (c.size() == 0)
return 0;
return nullptr;
int quasi_base_rid = -1;
typename svector<col_entry>::const_iterator it = c.begin_entries();
typename svector<col_entry>::const_iterator end = c.end_entries();
@ -533,7 +533,7 @@ namespace smt {
typename theory_arith<Ext>::col_entry const * theory_arith<Ext>::get_row_for_eliminating(theory_var v) const {
column const & c = m_columns[v];
if (c.size() == 0)
return 0;
return nullptr;
typename svector<col_entry>::const_iterator it = c.begin_entries();
typename svector<col_entry>::const_iterator end = c.end_entries();
for (; it != end; ++it) {
@ -556,7 +556,7 @@ namespace smt {
return it;
}
}
return 0;
return nullptr;
}
template<typename Ext>

View file

@ -472,7 +472,7 @@ namespace smt {
tout << s_ante << "\n" << s_conseq << "\n";);
// literal lits[2] = {l_ante, l_conseq};
mk_clause(l_ante, l_conseq, 0, 0);
mk_clause(l_ante, l_conseq, 0, nullptr);
if (ctx.relevancy()) {
if (l_ante == false_literal) {
ctx.mark_as_relevant(l_conseq);
@ -1347,8 +1347,8 @@ namespace smt {
std::swap(n1, n2);
}
rational k;
bound * b1 = 0;
bound * b2 = 0;
bound * b1 = nullptr;
bound * b2 = nullptr;
if (m_util.is_numeral(n2->get_owner(), k)) {
inf_numeral val(k);
b1 = alloc(eq_bound, v1, val, B_LOWER, n1, n2);
@ -2342,7 +2342,7 @@ namespace smt {
row const & r = m_rows[get_var_row(x_i)];
int idx = r.get_idx_of(x_i);
SASSERT(idx >= 0);
bound * b = 0;
bound * b = nullptr;
// Remark:
// if x_i is an integer variable, then delta can be negative:
@ -2616,7 +2616,7 @@ namespace smt {
return;
}
bool is_pos = it->m_coeff.is_pos();
if (lower(it->m_var) == 0) {
if (lower(it->m_var) == nullptr) {
if (is_pos) {
UPDATE_IDX(upper_idx);
}
@ -2624,7 +2624,7 @@ namespace smt {
UPDATE_IDX(lower_idx);
}
}
if (upper(it->m_var) == 0) {
if (upper(it->m_var) == nullptr) {
if (is_pos) {
UPDATE_IDX(lower_idx);
}
@ -2661,7 +2661,7 @@ namespace smt {
if (entry.m_coeff.is_pos() == is_lower) {
// implied_k is a lower bound for entry.m_var
bound * curr = lower(entry.m_var);
if (curr == 0 || implied_k > curr->get_value()) {
if (curr == nullptr || implied_k > curr->get_value()) {
TRACE("arith_imply_bound",
tout << "implying lower bound for v" << entry.m_var << " " << implied_k << " using row:\n";
display_row_info(tout, r);
@ -2672,7 +2672,7 @@ namespace smt {
else {
// implied_k is an upper bound for it->m_var
bound * curr = upper(entry.m_var);
if (curr == 0 || implied_k < curr->get_value()) {
if (curr == nullptr || implied_k < curr->get_value()) {
TRACE("arith_imply_bound",
tout << "implying upper bound for v" << entry.m_var << " " << implied_k << " using row:\n";
display_row_info(tout, r);
@ -2722,7 +2722,7 @@ namespace smt {
if (it->m_coeff.is_pos() == is_lower) {
// implied_k is a lower bound for it->m_var
bound * curr = lower(it->m_var);
if (curr == 0 || implied_k > curr->get_value()) {
if (curr == nullptr || implied_k > curr->get_value()) {
// improved lower bound
TRACE("arith_imply_bound",
tout << "implying lower bound for v" << it->m_var << " " << implied_k << " using row:\n";
@ -2734,7 +2734,7 @@ namespace smt {
else {
// implied_k is an upper bound for it->m_var
bound * curr = upper(it->m_var);
if (curr == 0 || implied_k < curr->get_value()) {
if (curr == nullptr || implied_k < curr->get_value()) {
// improved upper bound
TRACE("arith_imply_bound",
tout << "implying upper bound for v" << it->m_var << " " << implied_k << " using row:\n";
@ -2809,7 +2809,7 @@ namespace smt {
TRACE("propagate_bounds_bug", tout << "is_b_lower: " << is_b_lower << " k1: " << k_1 << " limit_k1: "
<< limit_k1 << " delta: " << delta << " coeff: " << coeff << "\n";);
inf_numeral k_2 = k_1;
atom * new_atom = 0;
atom * new_atom = nullptr;
atoms const & as = m_var_occs[it->m_var];
typename atoms::const_iterator it = as.begin();
typename atoms::const_iterator end = as.end();
@ -2844,7 +2844,7 @@ namespace smt {
}
SASSERT(!is_b_lower || k_2 <= k_1);
SASSERT(is_b_lower || k_2 >= k_1);
if (new_atom == 0) {
if (new_atom == nullptr) {
b->push_justification(ante, coeff, coeffs_enabled());
continue;
}
@ -2976,12 +2976,12 @@ namespace smt {
literal_vector::const_iterator end = ante.lits().end();
for (; it != end; ++it)
lits.push_back(~(*it));
justification * js = 0;
justification * js = nullptr;
if (proofs_enabled()) {
js = alloc(theory_lemma_justification, get_id(), ctx, lits.size(), lits.c_ptr(),
ante.num_params(), ante.params("assign-bounds"));
}
ctx.mk_clause(lits.size(), lits.c_ptr(), js, CLS_AUX_LEMMA, 0);
ctx.mk_clause(lits.size(), lits.c_ptr(), js, CLS_AUX_LEMMA, nullptr);
}
else {
region & r = ctx.get_region();
@ -3169,9 +3169,9 @@ namespace smt {
for (theory_var v = 0; v < num; v++) {
bound * l = lower(v);
bound * u = upper(v);
if (l != 0)
if (l != nullptr)
update_epsilon(l->get_value(), get_value(v));
if (u != 0)
if (u != nullptr)
update_epsilon(get_value(v), u->get_value());
}
TRACE("epsilon_bug", tout << "epsilon: " << m_epsilon << "\n";);
@ -3289,14 +3289,14 @@ namespace smt {
template<typename Ext>
bool theory_arith<Ext>::get_lower(enode * n, expr_ref & r) {
theory_var v = n->get_th_var(get_id());
bound* b = (v == null_theory_var) ? 0 : lower(v);
bound* b = (v == null_theory_var) ? nullptr : lower(v);
return b && to_expr(b->get_value(), is_int(v), r);
}
template<typename Ext>
bool theory_arith<Ext>::get_upper(enode * n, expr_ref & r) {
theory_var v = n->get_th_var(get_id());
bound* b = (v == null_theory_var) ? 0 : upper(v);
bound* b = (v == null_theory_var) ? nullptr : upper(v);
return b && to_expr(b->get_value(), is_int(v), r);
}
@ -3388,7 +3388,7 @@ namespace smt {
bound * b = it->get_old_bound();
SASSERT(is_base(v) || is_non_base(v));
restore_bound(v, b, it->is_upper());
if (lazy_pivoting_lvl() > 2 && b == 0 && is_base(v) && is_free(v)) {
if (lazy_pivoting_lvl() > 2 && b == nullptr && is_base(v) && is_free(v)) {
SASSERT(!has_var_kind(get_var_row(v), BASE));
SASSERT(!has_var_kind(get_var_row(v), QUASI_BASE));
eliminate<false>(v, false);

View file

@ -117,7 +117,7 @@ namespace smt {
for (; it != end; ++it) {
if (!it->is_dead()) {
theory_var v = it->m_var;
if (lower(v) != 0 && upper(v) != 0)
if (lower(v) != nullptr && upper(v) != nullptr)
continue;
bad++;
if (bad > 2) {

View file

@ -50,15 +50,15 @@ namespace smt {
bound * l = lower(v);
bound * u = upper(v);
const inf_numeral & val = get_value(v);
if (l != 0 && u != 0) {
if (l != nullptr && u != nullptr) {
if (val != l->get_value() && val != u->get_value())
set_value(v, l->get_value());
}
else if (l != 0) {
else if (l != nullptr) {
if (val != l->get_value())
set_value(v, l->get_value());
}
else if (u != 0) {
else if (u != nullptr) {
if (val != u->get_value())
set_value(v, u->get_value());
}
@ -245,12 +245,12 @@ namespace smt {
numeral const_coeff(0);
bound* l = lower(b), *u = upper(b);
if (l != 0 && get_value(b) - inf_numeral(1) < l->get_value()) {
if (l != nullptr && get_value(b) - inf_numeral(1) < l->get_value()) {
SASSERT(l->get_value() <= get_value(b));
is_tight = true;
const_coeff = l->get_value().get_rational();
}
else if (u != 0 && get_value(b) + inf_numeral(1) > u->get_value()) {
else if (u != nullptr && get_value(b) + inf_numeral(1) > u->get_value()) {
SASSERT(get_value(b) <= u->get_value());
is_tight = true;
const_coeff = u->get_value().get_rational();
@ -1074,7 +1074,7 @@ namespace smt {
derived_bound * new_bound = alloc(derived_bound, v, inf_numeral(k), lower ? B_LOWER : B_UPPER);
t.m_tmp_lit_set.reset();
t.m_tmp_eq_set.reset();
if (old_bound != 0) {
if (old_bound != nullptr) {
t.accumulate_justification(*old_bound, *new_bound, numeral(0) /* refine for proof gen */, t.m_tmp_lit_set, t.m_tmp_eq_set);
}
unsigned_vector::const_iterator it = js.begin();
@ -1174,8 +1174,8 @@ namespace smt {
c2 = rational(c);
TRACE("euclidean_solver_new", tout << "new fixed: " << c2 << "\n";);
propagated = true;
mk_lower(v, c2, 0, m_js);
mk_upper(v, c2, 0, m_js);
mk_lower(v, c2, nullptr, m_js);
mk_upper(v, c2, nullptr, m_js);
}
else {
TRACE("euclidean_solver", tout << "inequality can be tightned, since all coefficients are multiple of: " << g << "\n";);
@ -1187,7 +1187,7 @@ namespace smt {
bound * l = t.lower(v);
bound * u = t.upper(v);
c2 = rational(c);
if (l != 0) {
if (l != nullptr) {
rational l_old = l->get_value().get_rational().to_rational();
rational l_new = g*ceil((l_old - c2)/g) + c2;
TRACE("euclidean_solver_new", tout << "new lower: " << l_new << " old: " << l_old << "\n";
@ -1197,7 +1197,7 @@ namespace smt {
mk_lower(v, l_new, l, m_js);
}
}
if (u != 0) {
if (u != nullptr) {
rational u_old = u->get_value().get_rational().to_rational();
rational u_new = g*floor((u_old - c2)/g) + c2;
TRACE("euclidean_solver_new", tout << "new upper: " << u_new << " old: " << u_old << "\n";);
@ -1223,7 +1223,7 @@ namespace smt {
continue; // skip equations...
if (!t.is_int(v))
continue; // skip non integer definitions...
if (t.lower(v) == 0 && t.upper(v) == 0)
if (t.lower(v) == nullptr && t.upper(v) == nullptr)
continue; // there is nothing to be tightned
if (tight_bounds(v))
propagated = true;

View file

@ -161,14 +161,14 @@ namespace smt {
template<typename Ext>
std::pair<unsigned, int> theory_arith<Ext>::analyze_monomial(expr * m) const {
SASSERT(is_pure_monomial(m));
expr * var = 0;
expr * var = nullptr;
unsigned power = 0;
unsigned c = 0;
int free_var_idx = -1;
int idx = 0;
for (unsigned i = 0; i < to_app(m)->get_num_args(); i++) {
expr * arg = to_app(m)->get_arg(i);
if (var == 0) {
if (var == nullptr) {
var = arg;
power = 1;
}
@ -227,7 +227,7 @@ namespace smt {
SASSERT(!m_util.is_numeral(m));
if (m_util.is_mul(m)) {
unsigned num_vars = 0;
expr * var = 0;
expr * var = nullptr;
for (unsigned i = 0; i < to_app(m)->get_num_args(); i++) {
expr * curr = to_app(m)->get_arg(i);
if (var != curr) {
@ -252,12 +252,12 @@ namespace smt {
m = get_monomial_body(m);
if (m_util.is_mul(m)) {
unsigned curr_idx = 0;
expr * var = 0;
expr * var = nullptr;
unsigned power = 0;
unsigned j;
for (j = 0; j < to_app(m)->get_num_args(); j++) {
expr * arg = to_app(m)->get_arg(j);
if (var == 0) {
if (var == nullptr) {
var = arg;
power = 1;
}
@ -471,7 +471,7 @@ namespace smt {
}
}
bound * old_lower = lower(v);
if (old_lower == 0 || new_lower > old_lower->get_value()) {
if (old_lower == nullptr || new_lower > old_lower->get_value()) {
TRACE("non_linear", tout << "NEW lower bound for v" << v << " " << new_lower << "\n";
display_interval(tout, i); tout << "\n";);
mk_derived_nl_bound(v, new_lower, B_LOWER, i.get_lower_dependencies());
@ -494,7 +494,7 @@ namespace smt {
}
}
bound * old_upper = upper(v);
if (old_upper == 0 || new_upper < old_upper->get_value()) {
if (old_upper == nullptr || new_upper < old_upper->get_value()) {
TRACE("non_linear", tout << "NEW upper bound for v" << v << " " << new_upper << "\n";
display_interval(tout, i); tout << "\n";);
mk_derived_nl_bound(v, new_upper, B_UPPER, i.get_upper_dependencies());
@ -788,7 +788,7 @@ namespace smt {
TRACE("non_linear", tout << "BRANCHING on v" << v << "\n";);
m_stats.m_nl_branching++;
SASSERT(is_int(v));
expr * bound = 0;
expr * bound = nullptr;
if (lower(v))
bound = m_util.mk_le(var2expr(v), m_util.mk_numeral(lower_bound(v).get_rational().to_rational(), true));
else if (upper(v))
@ -857,7 +857,7 @@ namespace smt {
if (!is_fixed(_var))
return arg;
}
return 0;
return nullptr;
}
/**
@ -882,12 +882,12 @@ namespace smt {
numeral k = get_monomial_fixed_var_product(m);
TRACE("non_linear", tout << "new linear monomial... k: " << k << "\n";);
expr * x_n = k.is_zero() ? 0 : get_monomial_non_fixed_var(m);
expr * x_n = k.is_zero() ? nullptr : get_monomial_non_fixed_var(m);
TRACE("non_linear_bug", if (x_n != 0) { tout << "x_n: " << mk_bounded_pp(x_n, get_manager()) << "\nx_n: #" << x_n->get_id() << "\n"; });
context & ctx = get_context();
derived_bound * new_lower = 0;
derived_bound * new_upper = 0;
if (x_n != 0) {
derived_bound * new_lower = nullptr;
derived_bound * new_upper = nullptr;
if (x_n != nullptr) {
// All but one of the x_i variables are assigned.
// Let x_n be the unassigned variable.
// Then, we know that x_1*...*x_n = k*x_n, where k is the product of beta(x_1)*...*beta(x_{n-1})
@ -1267,7 +1267,7 @@ namespace smt {
expr * var = ce.second;
if (!c.is_one()) {
rational c2;
expr * m = 0;
expr * m = nullptr;
if (m_util.is_numeral(var, c2))
m = m_util.mk_numeral(c*c2, m_util.is_int(var) && c.is_int() && c2.is_int());
else
@ -1492,7 +1492,7 @@ namespace smt {
r.push_back(coeff_expr(kv.first, f));
}
}
expr * s = cross_nested(e, 0);
expr * s = cross_nested(e, nullptr);
if (!r.empty()) {
expr * q = horner(r, var);
// TODO: improve here
@ -1519,7 +1519,7 @@ namespace smt {
template<typename Ext>
expr * theory_arith<Ext>::cross_nested(sbuffer<coeff_expr> & p, expr * var) {
TRACE("non_linear", tout << "p.size: " << p.size() << "\n";);
if (var == 0) {
if (var == nullptr) {
sbuffer<var_num_occs> varinfo;
get_polynomial_info(p, varinfo);
if (varinfo.empty())
@ -1556,7 +1556,7 @@ namespace smt {
tout << "b: " << b << "\n";
tout << "nm: " << nm << "\n";);
SASSERT(n != nm);
expr * new_expr = 0;
expr * new_expr = nullptr;
if (nm < n) {
std::swap(n, nm);
std::swap(a, b);
@ -1576,7 +1576,7 @@ namespace smt {
expr * xm_a2b = m_util.mk_add(m_util.mk_numeral(a2b, m_util.is_int(var)), xm);
expr * xm_a2b2 = m_util.mk_mul(xm_a2b, xm_a2b);
expr * rhs = m_util.mk_add(xm_a2b2, m_util.mk_numeral(ma2b2, m_util.is_int(var)));
expr * rhs2 = 0;
expr * rhs2 = nullptr;
if (n > m)
rhs2 = m_util.mk_mul(power(var, n - m), rhs);
else
@ -1593,7 +1593,7 @@ namespace smt {
if (rest.empty())
return new_expr;
TRACE("non_linear", tout << "rest size: " << rest.size() << ", i1: " << i1 << ", i2: " << i2 << "\n";);
expr * h = cross_nested(rest, 0);
expr * h = cross_nested(rest, nullptr);
expr * r = m_util.mk_add(new_expr, h);
m_nl_new_exprs.push_back(r);
return r;
@ -1631,7 +1631,7 @@ namespace smt {
tout << "c:\n" << mk_ismt2_pp(cn, get_manager()) << "\n";);
interval i = evaluate_as_interval(cn);
TRACE("cross_nested", tout << "interval: " << i << "\n";);
v_dependency * d = 0;
v_dependency * d = nullptr;
if (!i.minus_infinity() && (i.get_lower_value().is_pos() || (i.get_lower_value().is_zero() && i.is_lower_open())))
d = i.get_lower_dependencies();
else if (!i.plus_infinity() && (i.get_upper_value().is_neg() || (i.get_upper_value().is_zero() && i.is_upper_open())))
@ -1823,7 +1823,7 @@ namespace smt {
if (!coeff.is_zero())
return gb.mk_monomial(coeff, vars.size(), vars.c_ptr());
else
return 0;
return nullptr;
}
/**
@ -1834,7 +1834,7 @@ namespace smt {
void theory_arith<Ext>::add_row_to_gb(row const & r, grobner & gb) {
TRACE("non_linear", tout << "adding row to gb\n"; display_row(tout, r););
ptr_buffer<grobner::monomial> monomials;
v_dependency * dep = 0;
v_dependency * dep = nullptr;
m_tmp_var_set.reset();
typename vector<row_entry>::const_iterator it = r.begin_entries();
typename vector<row_entry>::const_iterator end = r.end_entries();
@ -1860,7 +1860,7 @@ namespace smt {
template<typename Ext>
void theory_arith<Ext>::add_monomial_def_to_gb(theory_var v, grobner & gb) {
ptr_buffer<grobner::monomial> monomials;
v_dependency * dep = 0;
v_dependency * dep = nullptr;
m_tmp_var_set.reset();
expr * m = var2expr(v);
SASSERT(is_pure_monomial(m));
@ -1872,7 +1872,7 @@ namespace smt {
dep = m_dep_manager.mk_join(dep, m_dep_manager.mk_join(m_dep_manager.mk_leaf(lower(v)), m_dep_manager.mk_leaf(upper(v))));
coeff *= lower_bound(v).get_rational().to_rational();
if (!coeff.is_zero())
monomials.push_back(gb.mk_monomial(coeff, 0, 0));
monomials.push_back(gb.mk_monomial(coeff, 0, nullptr));
}
else {
monomials.push_back(gb.mk_monomial(coeff, 1, &m));
@ -1904,12 +1904,12 @@ namespace smt {
template<typename Ext>
interval theory_arith<Ext>::mk_interval_for(grobner::monomial const * m) {
interval r(m_dep_manager, rational(m->get_coeff()));
expr * var = 0;
expr * var = nullptr;
unsigned power = 0;
unsigned num_vars = m->get_degree();
for (unsigned i = 0; i < num_vars; i++) {
expr * curr = m->get_var(i);
if (var == 0) {
if (var == nullptr) {
var = curr;
power = 1;
}
@ -1922,7 +1922,7 @@ namespace smt {
power = 1;
}
}
if (var != 0)
if (var != nullptr)
mul_bound_of(var, power, r);
return r;
}
@ -1957,7 +1957,7 @@ namespace smt {
return false;
}
TRACE("non_linear_bug", tout << "is_inconsistent, r: " << r << "\n";);
v_dependency * interval_deps = 0;
v_dependency * interval_deps = nullptr;
bool conflict = false;
if (!r.minus_infinity() && (r.get_lower_value().is_pos() || (r.get_lower_value().is_zero() && r.is_lower_open()))) {
interval_deps = r.get_lower_dependencies();
@ -2002,11 +2002,11 @@ namespace smt {
return false;
if (!m->get_coeff().is_perfect_square(r))
return false;
expr * var = 0;
expr * var = nullptr;
unsigned power = 0;
for (unsigned i = 0; i < num_vars; i++) {
expr * curr = m->get_var(i);
if (var == 0) {
if (var == nullptr) {
var = curr;
power = 1;
}
@ -2050,18 +2050,18 @@ namespace smt {
unsigned i1, i2, i12;
i1 = i2 = i12 = 0;
while (true) {
expr * v1 = 0;
expr * v2 = 0;
expr * v12 = 0;
expr * v1 = nullptr;
expr * v2 = nullptr;
expr * v12 = nullptr;
if (i1 < num1)
v1 = m1_sq->get_var(i1);
if (i2 < num2)
v2 = m2_sq->get_var(i2);
if (i12 < num12)
v12 = m1m2->get_var(i12);
if (v1 == 0 && v2 == 0 && v12 == 0)
if (v1 == nullptr && v2 == nullptr && v12 == nullptr)
return true;
if (v12 == 0)
if (v12 == nullptr)
return false;
if (v1 == v12) {
SASSERT(m1_sq->get_var(i1+1) == v1);
@ -2162,7 +2162,7 @@ namespace smt {
}
if (monomials.size() == num)
return false; // didn't find any perfect square.
interval ge_zero(m_dep_manager, rational(0), false, true, 0);
interval ge_zero(m_dep_manager, rational(0), false, true, nullptr);
if (is_inconsistent(ge_zero, monomials.size(), monomials.c_ptr(), eq->get_dependency())) {
TRACE("non_linear", tout << "found conflict\n"; gb.display_equation(tout, *eq););
return true;

View file

@ -504,7 +504,7 @@ namespace smt {
pp.add_assumption(eq);
}
else {
if (lower(v) != 0) {
if (lower(v) != nullptr) {
inf_numeral k_inf = lower_bound(v);
rational k = k_inf.get_rational().to_rational();
expr_ref ineq(m);
@ -514,7 +514,7 @@ namespace smt {
ineq = m_util.mk_lt(m_util.mk_numeral(k, is_int(v)), n);
pp.add_assumption(ineq);
}
if (upper(v) != 0) {
if (upper(v) != nullptr) {
inf_numeral k_inf = upper_bound(v);
rational k = k_inf.get_rational().to_rational();
expr_ref ineq(m);

View file

@ -41,7 +41,7 @@ namespace smt {
}
app * theory_array_base::mk_select(unsigned num_args, expr * const * args) {
app * r = get_manager().mk_app(get_family_id(), OP_SELECT, 0, 0, num_args, args);
app * r = get_manager().mk_app(get_family_id(), OP_SELECT, 0, nullptr, num_args, args);
TRACE("mk_var_bug", tout << "mk_select: " << r->get_id() << " num_args: " << num_args;
for (unsigned i = 0; i < num_args; i++) tout << " " << args[i]->get_id();
tout << "\n";);
@ -49,7 +49,7 @@ namespace smt {
}
app * theory_array_base::mk_store(unsigned num_args, expr * const * args) {
return get_manager().mk_app(get_family_id(), OP_STORE, 0, 0, num_args, args);
return get_manager().mk_app(get_family_id(), OP_STORE, 0, nullptr, num_args, args);
}
app * theory_array_base::mk_default(expr * a) {
@ -152,7 +152,7 @@ namespace smt {
expr_ref sel1(m), sel2(m);
bool init = false;
literal conseq = null_literal;
expr * conseq_expr = 0;
expr * conseq_expr = nullptr;
for (unsigned i = 0; i < num_args; i++) {
enode * idx1 = js[i];
@ -212,7 +212,7 @@ namespace smt {
func_decl_ref_vector * theory_array_base::register_sort(sort * s_array) {
unsigned dimension = get_dimension(s_array);
func_decl_ref_vector * ext_skolems = 0;
func_decl_ref_vector * ext_skolems = nullptr;
if (!m_sort2skolem.find(s_array, ext_skolems)) {
array_util util(get_manager());
ast_manager & m = get_manager();
@ -305,7 +305,7 @@ namespace smt {
context & ctx = get_context();
ast_manager & m = get_manager();
func_decl_ref_vector * funcs = 0;
func_decl_ref_vector * funcs = nullptr;
sort * s = m.get_sort(e1);
VERIFY(m_sort2skolem.find(s, funcs));
@ -495,7 +495,7 @@ namespace smt {
void theory_array_base::restore_sorts(unsigned old_size) {
while (m_sorts_trail.size() > old_size) {
sort * s = m_sorts_trail.back();
func_decl_ref_vector * funcs = 0;
func_decl_ref_vector * funcs = nullptr;
if (m_sort2skolem.find(s, funcs)) {
m_sort2skolem.remove(s);
dealloc(funcs);
@ -672,9 +672,9 @@ namespace smt {
theory_array_base::select_set * theory_array_base::get_select_set(enode * n) {
enode * r = n->get_root();
select_set * set = 0;
select_set * set = nullptr;
m_selects.find(r, set);
if (set == 0) {
if (set == nullptr) {
set = alloc(select_set);
m_selects.insert(r, set);
m_selects_domain.push_back(r);
@ -795,7 +795,7 @@ namespace smt {
m_sort(s),
m_num_entries(0),
m_dim(0),
m_else(0),
m_else(nullptr),
m_unspecified_else(false) {
m_dependencies.push_back(model_value_dependency(v));
}
@ -814,7 +814,7 @@ namespace smt {
m_sort(s),
m_num_entries(0),
m_dim(0),
m_else(0),
m_else(nullptr),
m_unspecified_else(false) {
m_dependencies.push_back(model_value_dependency(else_value));
}
@ -824,7 +824,7 @@ namespace smt {
m_sort(s),
m_num_entries(0),
m_dim(0),
m_else(0),
m_else(nullptr),
m_unspecified_else(true) {
}
@ -888,14 +888,14 @@ namespace smt {
SASSERT(v != null_theory_var);
sort * s = get_manager().get_sort(n->get_owner());
enode * else_val_n = get_default(v);
array_value_proc * result = 0;
array_value_proc * result = nullptr;
if (m_use_unspecified_default) {
SASSERT(else_val_n == 0);
result = alloc(array_value_proc, get_id(), s);
}
else {
if (else_val_n != 0) {
if (else_val_n != nullptr) {
SASSERT(get_context().is_relevant(else_val_n));
result = alloc(array_value_proc, get_id(), s, else_val_n);
}
@ -905,7 +905,7 @@ namespace smt {
// DISABLED. It seems wrong, since different nodes can share the same
// else_val according to the mg class.
// SASSERT(else_val == 0 || get_context().is_relevant(UNTAG(app*, else_val)));
if (else_val == 0) {
if (else_val == nullptr) {
sort * range = to_sort(s->get_parameter(s->get_num_parameters() - 1).get_ast());
// IMPORTANT:
// The implementation should not assume a fresh value is created for
@ -925,9 +925,9 @@ namespace smt {
}
}
SASSERT(result != 0);
select_set * sel_set = 0;
select_set * sel_set = nullptr;
m_selects.find(n->get_root(), sel_set);
if (sel_set != 0) {
if (sel_set != nullptr) {
ptr_buffer<enode> args;
select_set::iterator it = sel_set->begin();
select_set::iterator end = sel_set->end();

View file

@ -746,7 +746,7 @@ namespace smt {
}
app* theory_array_full::mk_epsilon(sort* s) {
app* eps = 0;
app* eps = nullptr;
if (m_sort2epsilon.find(s, eps)) {
return eps;
}

View file

@ -373,7 +373,7 @@ namespace smt {
void get_proof(conflict_resolution & cr, literal l, ptr_buffer<proof> & prs, bool & visited) {
if (l.var() == true_bool_var)
return;
proof * pr = 0;
proof * pr = nullptr;
if (cr.get_context().get_assignment(l) == l_true)
pr = cr.get_proof(l);
else
@ -408,7 +408,7 @@ namespace smt {
get_proof(cr, *it2, prs, visited);
}
if (!visited)
return 0;
return nullptr;
expr * fact = ctx.mk_eq_atom(m_th.get_enode(m_var1)->get_owner(), m_th.get_enode(m_var2)->get_owner());
ast_manager & m = ctx.get_manager();
return m.mk_th_lemma(get_from_theory(), fact, prs.size(), prs.c_ptr());
@ -1532,7 +1532,7 @@ namespace smt {
visited = false;
}
if (!visited)
return 0;
return nullptr;
context & ctx = cr.get_context();
ast_manager & m = cr.get_manager();
expr_ref fact(m);

View file

@ -52,12 +52,12 @@ namespace smt {
theory_var m_var;
unsigned m_idx;
var_pos_occ * m_next;
var_pos_occ(theory_var v = null_theory_var, unsigned idx = 0, var_pos_occ * next = 0):m_var(v), m_idx(idx), m_next(next) {}
var_pos_occ(theory_var v = null_theory_var, unsigned idx = 0, var_pos_occ * next = nullptr):m_var(v), m_idx(idx), m_next(next) {}
};
struct bit_atom : public atom {
var_pos_occ * m_occs;
bit_atom():m_occs(0) {}
bit_atom():m_occs(nullptr) {}
~bit_atom() override {}
bool is_bit() const override { return true; }
};

View file

@ -30,7 +30,7 @@ namespace smt {
class dt_eq_justification : public ext_theory_eq_propagation_justification {
public:
dt_eq_justification(family_id fid, region & r, literal antecedent, enode * lhs, enode * rhs):
ext_theory_eq_propagation_justification(fid, r, 1, &antecedent, 0, 0, lhs, rhs) {
ext_theory_eq_propagation_justification(fid, r, 1, &antecedent, 0, nullptr, lhs, rhs) {
}
// Remark: the assignment must be propagated back to the datatype theory.
theory_id get_from_theory() const override { return null_theory_id; }
@ -340,12 +340,12 @@ namespace smt {
func_decl * c = m_util.get_recognizer_constructor(r);
if (is_true) {
SASSERT(tv != null_theory_var);
if (d->m_constructor != 0 && d->m_constructor->get_decl() == c)
if (d->m_constructor != nullptr && d->m_constructor->get_decl() == c)
return; // do nothing
assert_is_constructor_axiom(arg, c, literal(v));
}
else {
if (d->m_constructor != 0) {
if (d->m_constructor != nullptr) {
if (d->m_constructor->get_decl() == c) {
// conflict
sign_recognizer_conflict(d->m_constructor, n);
@ -400,7 +400,7 @@ namespace smt {
if (m_params.m_dt_lazy_splits > 0) {
// using lazy case splits...
var_data * d = m_var_data[v];
if (d->m_constructor == 0) {
if (d->m_constructor == nullptr) {
mk_split(v);
r = FC_CONTINUE;
}
@ -427,7 +427,7 @@ namespace smt {
if (res) {
context & ctx = get_context();
region & r = ctx.get_region();
ctx.set_conflict(ctx.mk_justification(ext_theory_conflict_justification(get_id(), r, 0, 0, m_used_eqs.size(), m_used_eqs.c_ptr())));
ctx.set_conflict(ctx.mk_justification(ext_theory_conflict_justification(get_id(), r, 0, nullptr, m_used_eqs.size(), m_used_eqs.c_ptr())));
TRACE("occurs_check",
tout << "occurs_check: true\n";
for (enode_pair const& p : m_used_eqs) {
@ -581,21 +581,21 @@ namespace smt {
SASSERT(v1 == static_cast<int>(m_find.find(v1)));
var_data * d1 = m_var_data[v1];
var_data * d2 = m_var_data[v2];
if (d2->m_constructor != 0) {
if (d2->m_constructor != nullptr) {
context & ctx = get_context();
if (d1->m_constructor != 0 && d1->m_constructor->get_decl() != d2->m_constructor->get_decl()) {
if (d1->m_constructor != nullptr && d1->m_constructor->get_decl() != d2->m_constructor->get_decl()) {
region & r = ctx.get_region();
enode_pair p(d1->m_constructor, d2->m_constructor);
SASSERT(d1->m_constructor->get_root() == d2->m_constructor->get_root());
ctx.set_conflict(ctx.mk_justification(ext_theory_conflict_justification(get_id(), r, 0, 0, 1, &p)));
ctx.set_conflict(ctx.mk_justification(ext_theory_conflict_justification(get_id(), r, 0, nullptr, 1, &p)));
}
if (d1->m_constructor == 0) {
if (d1->m_constructor == nullptr) {
m_trail_stack.push(set_ptr_trail<theory_datatype, enode>(d1->m_constructor));
// check whether there is a recognizer in d1 that conflicts with d2->m_constructor;
if (!d1->m_recognizers.empty()) {
unsigned c_idx = m_util.get_constructor_idx(d2->m_constructor->get_decl());
enode * recognizer = d1->m_recognizers[c_idx];
if (recognizer != 0 && ctx.get_assignment(recognizer) == l_false) {
if (recognizer != nullptr && ctx.get_assignment(recognizer) == l_false) {
sign_recognizer_conflict(d2->m_constructor, recognizer);
return;
}
@ -634,7 +634,7 @@ namespace smt {
// Otherwise, it will be set when assign_eh is invoked.
return;
}
if (val == l_false && d->m_constructor != 0) {
if (val == l_false && d->m_constructor != nullptr) {
func_decl * c_decl = m_util.get_recognizer_constructor(recognizer->get_decl());
if (d->m_constructor->get_decl() == c_decl) {
// conflict
@ -747,7 +747,7 @@ namespace smt {
unsigned non_rec_idx = m_util.get_constructor_idx(non_rec_c);
var_data * d = m_var_data[v];
SASSERT(d->m_constructor == 0);
func_decl * r = 0;
func_decl * r = nullptr;
m_stats.m_splits++;
if (d->m_recognizers.empty()) {
@ -755,7 +755,7 @@ namespace smt {
}
else {
enode * recognizer = d->m_recognizers[non_rec_idx];
if (recognizer == 0) {
if (recognizer == nullptr) {
r = m_util.get_constructor_recognizer(non_rec_c);
}
else if (!ctx.is_relevant(recognizer)) {
@ -773,7 +773,7 @@ namespace smt {
ptr_vector<enode>::const_iterator end = d->m_recognizers.end();
for (unsigned idx = 0; it != end; ++it, ++idx) {
enode * curr = *it;
if (curr == 0) {
if (curr == nullptr) {
ptr_vector<func_decl> const & constructors = *m_util.get_datatype_constructors(s);
// found empty slot...
r = m_util.get_constructor_recognizer(constructors[idx]);
@ -787,7 +787,7 @@ namespace smt {
return;
}
}
if (r == 0)
if (r == nullptr)
return; // all recognizers are asserted to false... conflict will be detected...
}
}

View file

@ -35,7 +35,7 @@ namespace smt {
ptr_vector<enode> m_recognizers; //!< recognizers of this equivalence class that are being watched.
enode * m_constructor; //!< constructor of this equivalence class, 0 if there is no constructor in the eqc.
var_data():
m_constructor(0) {
m_constructor(nullptr) {
}
};

View file

@ -867,7 +867,7 @@ namespace smt {
}
else {
context& ctx = get_context();
enode * e = 0;
enode * e = nullptr;
theory_var v = 0;
if (ctx.e_internalized(n)) {
e = ctx.get_enode(to_app(n));

View file

@ -234,7 +234,7 @@ namespace smt {
m_agility(0.5),
m_is_lia(true),
m_non_diff_logic_exprs(false),
m_factory(0),
m_factory(nullptr),
m_nc_functor(*this),
m_S(m.limit()),
m_num_simplex_edges(0) {
@ -297,7 +297,7 @@ namespace smt {
justification * why_is_diseq(theory_var v1, theory_var v2) override {
NOT_IMPLEMENTED_YET();
return 0;
return nullptr;
}
// virtual void flush_eh();

View file

@ -298,7 +298,7 @@ void theory_diff_logic<Ext>::internalize_eq_eh(app * atom, bool_var v) {
template<typename Ext>
void theory_diff_logic<Ext>::assign_eh(bool_var v, bool is_true) {
m_stats.m_num_assertions++;
atom * a = 0;
atom * a = nullptr;
VERIFY (m_bool_var2atom.find(v, a));
SASSERT(a);
SASSERT(get_context().get_assignment(v) != l_undef);
@ -602,7 +602,7 @@ void theory_diff_logic<Ext>::new_edge(dl_var src, dl_var dst, unsigned num_edges
ctx.mark_as_relevant(le.get());
literal lit(ctx.get_literal(le));
bool_var bv = lit.var();
atom* a = 0;
atom* a = nullptr;
m_bool_var2atom.find(bv, a);
SASSERT(a);
@ -619,7 +619,7 @@ void theory_diff_logic<Ext>::new_edge(dl_var src, dl_var dst, unsigned num_edges
tout << "\n";
);
justification * js = 0;
justification * js = nullptr;
if (get_manager().proofs_enabled()) {
vector<parameter> params;
params.push_back(parameter(symbol("farkas")));
@ -628,7 +628,7 @@ void theory_diff_logic<Ext>::new_edge(dl_var src, dl_var dst, unsigned num_edges
lits.size(), lits.c_ptr(),
params.size(), params.c_ptr());
}
ctx.mk_clause(lits.size(), lits.c_ptr(), js, CLS_AUX_LEMMA, 0);
ctx.mk_clause(lits.size(), lits.c_ptr(), js, CLS_AUX_LEMMA, nullptr);
if (dump_lemmas()) {
symbol logic(m_is_lia ? "QF_LIA" : "QF_LRA");
ctx.display_lemma_as_smt_problem(lits.size(), lits.c_ptr(), false_literal, logic);
@ -692,7 +692,7 @@ void theory_diff_logic<Ext>::set_neg_cycle_conflict() {
ctx.mk_justification(
ext_theory_conflict_justification(
get_id(), ctx.get_region(),
lits.size(), lits.c_ptr(), 0, 0, params.size(), params.c_ptr())));
lits.size(), lits.c_ptr(), 0, nullptr, params.size(), params.c_ptr())));
}
@ -774,7 +774,7 @@ theory_var theory_diff_logic<Ext>::mk_term(app* n) {
template<typename Ext>
theory_var theory_diff_logic<Ext>::mk_num(app* n, rational const& r) {
theory_var v = null_theory_var;
enode* e = 0;
enode* e = nullptr;
context& ctx = get_context();
if (r.is_zero()) {
v = get_zero();
@ -813,7 +813,7 @@ theory_var theory_diff_logic<Ext>::mk_var(enode* n) {
template<typename Ext>
theory_var theory_diff_logic<Ext>::mk_var(app* n) {
context & ctx = get_context();
enode* e = 0;
enode* e = nullptr;
theory_var v = null_theory_var;
if (ctx.e_internalized(n)) {
e = ctx.get_enode(n);

View file

@ -78,7 +78,7 @@ namespace smt {
app * mk_value(smt::model_generator & mg, ptr_vector<expr> & ) override {
smt::context& ctx = m_th.get_context();
app* result = 0;
app* result = nullptr;
expr* n = m_node->get_owner();
sort* s = m_th.m().get_sort(n);
func_decl* r, *v;
@ -204,8 +204,8 @@ namespace smt {
if(!m_reps.find(s, r) || !m_vals.find(s,v)) {
SASSERT(!m_reps.contains(s));
sort* bv = b().mk_sort(64);
r = m().mk_func_decl(m_util.get_family_id(), datalog::OP_DL_REP, 0, 0, 1, &s, bv);
v = m().mk_func_decl(m_util.get_family_id(), datalog::OP_DL_ABS, 0, 0, 1, &bv, s);
r = m().mk_func_decl(m_util.get_family_id(), datalog::OP_DL_REP, 0, nullptr, 1, &s, bv);
v = m().mk_func_decl(m_util.get_family_id(), datalog::OP_DL_ABS, 0, nullptr, 1, &bv, s);
m_reps.insert(s, r);
m_vals.insert(s, v);
add_trail(r);
@ -218,7 +218,7 @@ namespace smt {
bool mk_rep(app* n) {
context & ctx = get_context();
unsigned num_args = n->get_num_args();
enode * e = 0;
enode * e = nullptr;
for (unsigned i = 0; i < num_args; i++) {
ctx.internalize(n->get_arg(i), false);
}

View file

@ -38,7 +38,7 @@ namespace smt {
m_map.remove(key);
m.dec_ref(key);
m.dec_ref(val);
key = 0;
key = nullptr;
}
};
@ -208,7 +208,7 @@ namespace smt {
for (unsigned i = 0; i < values.size(); i++)
tout << "value[" << i << "] = " << mk_ismt2_pp(values[i], m) << std::endl;);
app * result = 0;
app * result = nullptr;
unsigned bv_sz;
rational val(0);
@ -256,7 +256,7 @@ namespace smt {
}
func_decl_ref wrap_fd(m);
wrap_fd = m.mk_func_decl(get_family_id(), OP_FPA_BVWRAP, 0, 0, 1, &es, bv_srt);
wrap_fd = m.mk_func_decl(get_family_id(), OP_FPA_BVWRAP, 0, nullptr, 1, &es, bv_srt);
res = m.mk_app(wrap_fd, e);
}
@ -705,7 +705,7 @@ namespace smt {
m_trail_stack.pop_scope(m_trail_stack.get_num_scopes());
if (m_factory) {
dealloc(m_factory);
m_factory = 0;
m_factory = nullptr;
}
ast_manager & m = get_manager();
dec_ref_map_key_values(m, m_conversions);
@ -743,7 +743,7 @@ namespace smt {
return alloc(expr_wrapper_proc, owner);
}
model_value_proc * res = 0;
model_value_proc * res = nullptr;
app_ref wrapped(m);
wrapped = wrap(owner);

View file

@ -658,12 +658,12 @@ namespace smt {
m_internalize_head(0),
m_delay_constraints(false),
m_delayed_terms(m),
m_not_handled(0),
m_not_handled(nullptr),
m_asserted_qhead(0),
m_assume_eq_head(0),
m_num_conflicts(0),
m_model_eqs(DEFAULT_HASHTABLE_INITIAL_CAPACITY, var_value_hash(*this), var_value_eq(*this)),
m_solver(0),
m_solver(nullptr),
m_resource_limit(*this) {
}
@ -689,7 +689,7 @@ namespace smt {
SASSERT(!ctx().b_internalized(atom));
bool_var bv = ctx().mk_bool_var(atom);
ctx().set_var_theory(bv, get_id());
expr* n1 = 0, *n2 = 0;
expr* n1 = nullptr, *n2 = nullptr;
rational r;
lra_lp::bound_kind k;
theory_var v = null_theory_var;
@ -721,7 +721,7 @@ namespace smt {
SASSERT(!ctx().b_internalized(atom));
bool_var bv = ctx().mk_bool_var(atom);
ctx().set_var_theory(bv, get_id());
expr* n1 = 0, *n2 = 0;
expr* n1 = nullptr, *n2 = nullptr;
rational r;
lra_lp::bound_kind k;
theory_var v = null_theory_var;
@ -771,7 +771,7 @@ namespace smt {
}
void internalize_eq_eh(app * atom, bool_var) {
expr* lhs = 0, *rhs = 0;
expr* lhs = nullptr, *rhs = nullptr;
VERIFY(m.is_eq(atom, lhs, rhs));
enode * n1 = get_enode(lhs);
enode * n2 = get_enode(rhs);
@ -862,7 +862,7 @@ namespace smt {
void relevant_eh(app* n) {
TRACE("arith", tout << mk_pp(n, m) << "\n";);
expr* n1 = 0, *n2 = 0;
expr* n1 = nullptr, *n2 = nullptr;
if (a.is_mod(n, n1, n2))
mk_idiv_mod_axioms(n1, n2);
else if (a.is_rem(n, n1, n2))
@ -898,7 +898,7 @@ namespace smt {
// to_int (to_real x) = x
// to_real(to_int(x)) <= x < to_real(to_int(x)) + 1
void mk_to_int_axiom(app* n) {
expr* x = 0, *y = 0;
expr* x = nullptr, *y = nullptr;
VERIFY (a.is_to_int(n, x));
if (a.is_to_real(x, y)) {
mk_axiom(th.mk_eq(y, n, false));
@ -914,7 +914,7 @@ namespace smt {
// is_int(x) <=> to_real(to_int(x)) = x
void mk_is_int_axiom(app* n) {
expr* x = 0;
expr* x = nullptr;
VERIFY(a.is_is_int(n, x));
literal eq = th.mk_eq(a.mk_to_real(a.mk_to_int(x)), x, false);
literal is_int = ctx().get_literal(n);
@ -1180,7 +1180,7 @@ namespace smt {
if (assume_eqs()) {
return FC_CONTINUE;
}
if (m_not_handled != 0) {
if (m_not_handled != nullptr) {
return FC_GIVEUP;
}
return FC_DONE;
@ -1439,12 +1439,12 @@ namespace smt {
m_core2.push_back(~m_core[i]);
}
m_core2.push_back(lit);
justification * js = 0;
justification * js = nullptr;
if (proofs_enabled()) {
js = alloc(theory_lemma_justification, get_id(), ctx(), m_core2.size(), m_core2.c_ptr(),
m_params.size(), m_params.c_ptr());
}
ctx().mk_clause(m_core2.size(), m_core2.c_ptr(), js, CLS_AUX_LEMMA, 0);
ctx().mk_clause(m_core2.size(), m_core2.c_ptr(), js, CLS_AUX_LEMMA, nullptr);
}
else {
ctx().assign(
@ -1499,7 +1499,7 @@ namespace smt {
rational const& k1 = b.get_value();
lp_bounds & bounds = m_bounds[v];
lra_lp::bound* end = 0;
lra_lp::bound* end = nullptr;
lra_lp::bound* lo_inf = end, *lo_sup = end;
lra_lp::bound* hi_inf = end, *hi_sup = end;
@ -1764,7 +1764,7 @@ namespace smt {
bool find_glb = (is_true == (k == lra_lp::lower_t));
if (find_glb) {
rational glb;
lra_lp::bound* lb = 0;
lra_lp::bound* lb = nullptr;
for (unsigned i = 0; i < bounds.size(); ++i) {
lra_lp::bound* b2 = bounds[i];
if (b2 == &b) continue;
@ -1780,7 +1780,7 @@ namespace smt {
}
else {
rational lub;
lra_lp::bound* ub = 0;
lra_lp::bound* ub = nullptr;
for (unsigned i = 0; i < bounds.size(); ++i) {
lra_lp::bound* b2 = bounds[i];
if (b2 == &b) continue;
@ -2111,7 +2111,7 @@ namespace smt {
justification* js =
ctx().mk_justification(
ext_theory_eq_propagation_justification(
get_id(), ctx().get_region(), m_core.size(), m_core.c_ptr(), m_eqs.size(), m_eqs.c_ptr(), x, y, 0, 0));
get_id(), ctx().get_region(), m_core.size(), m_core.c_ptr(), m_eqs.size(), m_eqs.c_ptr(), x, y, 0, nullptr));
TRACE("arith",
for (unsigned i = 0; i < m_core.size(); ++i) {
@ -2236,12 +2236,12 @@ namespace smt {
}
justification * why_is_diseq(theory_var v1, theory_var v2) {
return 0;
return nullptr;
}
void reset_eh() {
m_arith_eq_adapter.reset_eh();
m_solver = 0;
m_solver = nullptr;
m_not_handled = nullptr;
del_bounds(0);
m_unassigned_bounds.reset();

View file

@ -403,12 +403,12 @@ namespace smt {
}
m_stats.m_num_conflicts++;
justification* js = 0;
justification* js = nullptr;
if (proofs_enabled()) {
js = alloc(theory_lemma_justification, get_id(), ctx, lits.size(), lits.c_ptr());
}
TRACE("pb", tout << lits << "\n";);
ctx.mk_clause(lits.size(), lits.c_ptr(), js, CLS_AUX_LEMMA, 0);
ctx.mk_clause(lits.size(), lits.c_ptr(), js, CLS_AUX_LEMMA, nullptr);
return false;
}
@ -697,7 +697,7 @@ namespace smt {
void theory_pb::watch_literal(literal lit, ineq* c) {
init_watch(lit.var());
ptr_vector<ineq>* ineqs = m_var_infos[lit.var()].m_lit_watch[lit.sign()];
if (ineqs == 0) {
if (ineqs == nullptr) {
ineqs = alloc(ptr_vector<ineq>);
m_var_infos[lit.var()].m_lit_watch[lit.sign()] = ineqs;
}
@ -707,7 +707,7 @@ namespace smt {
void theory_pb::watch_var(bool_var v, ineq* c) {
init_watch(v);
ptr_vector<ineq>* ineqs = m_var_infos[v].m_var_watch;
if (ineqs == 0) {
if (ineqs == nullptr) {
ineqs = alloc(ptr_vector<ineq>);
m_var_infos[v].m_var_watch = ineqs;
}
@ -770,12 +770,12 @@ namespace smt {
}
void theory_pb::assign_eh(bool_var v, bool is_true) {
ptr_vector<ineq>* ineqs = 0;
ptr_vector<ineq>* ineqs = nullptr;
literal nlit(v, is_true);
init_watch(v);
TRACE("pb", tout << "assign: " << ~nlit << "\n";);
ineqs = m_var_infos[v].m_lit_watch[nlit.sign()];
if (ineqs != 0) {
if (ineqs != nullptr) {
if (m_enable_simplex) {
mpq_inf num(mpq(is_true?1:0),mpq(0));
if (!update_bound(v, ~nlit, is_true, num)) {
@ -796,14 +796,14 @@ namespace smt {
}
}
ineqs = m_var_infos[v].m_var_watch;
if (ineqs != 0) {
if (ineqs != nullptr) {
for (unsigned i = 0; i < ineqs->size(); ++i) {
ineq* c = (*ineqs)[i];
assign_watch(v, is_true, *c);
}
}
ineq* c = m_var_infos[v].m_ineq;
if (c != 0) {
if (c != nullptr) {
if (m_enable_simplex) {
row_info const& info = m_ineq_row_info.find(v);
unsynch_mpq_manager mgr;
@ -1197,7 +1197,7 @@ namespace smt {
void mk_clause(unsigned n, literal const* ls) {
literal_vector tmp(n, ls);
ctx.mk_clause(n, tmp.c_ptr(), th.justify(tmp), CLS_AUX, 0);
ctx.mk_clause(n, tmp.c_ptr(), th.justify(tmp), CLS_AUX, nullptr);
}
literal mk_false() { return false_literal; }
@ -1319,7 +1319,7 @@ namespace smt {
bool_var v = m_ineqs_trail.back();
ineq* c = m_var_infos[v].m_ineq;
clear_watch(*c);
m_var_infos[v].m_ineq = 0;
m_var_infos[v].m_ineq = nullptr;
m_ineqs_trail.pop_back();
if (m_enable_simplex) {
row_info r_info;
@ -1449,7 +1449,7 @@ namespace smt {
tout << "\n";
display(tout, c, true););
justification* js = 0;
justification* js = nullptr;
if (m_conflict_frequency == 0 || (m_conflict_frequency -1 == (c.m_num_propagations % m_conflict_frequency))) {
resolve_conflict(c);
@ -1458,7 +1458,7 @@ namespace smt {
js = alloc(theory_lemma_justification, get_id(), ctx, lits.size(), lits.c_ptr());
}
TRACE("pb", tout << lits << "\n";);
ctx.mk_clause(lits.size(), lits.c_ptr(), js, CLS_AUX_LEMMA, 0);
ctx.mk_clause(lits.size(), lits.c_ptr(), js, CLS_AUX_LEMMA, nullptr);
}
@ -1702,18 +1702,18 @@ namespace smt {
break;
case b_justification::JUSTIFICATION: {
justification* j = js.get_justification();
pb_justification* pbj = 0;
pb_justification* pbj = nullptr;
if (!conseq.sign() && j->get_from_theory() == get_id()) {
pbj = dynamic_cast<pb_justification*>(j);
}
if (pbj && pbj->get_ineq().is_eq()) {
// only resolve >= that are positive consequences.
pbj = 0;
pbj = nullptr;
}
if (pbj && pbj->get_ineq().lit() == conseq) {
// can't resolve against literal representing inequality.
pbj = 0;
pbj = nullptr;
}
if (pbj) {
// weaken the lemma and resolve.
@ -1765,7 +1765,7 @@ namespace smt {
m_ineq_literals[i].neg();
}
TRACE("pb", tout << m_ineq_literals << "\n";);
ctx.mk_clause(m_ineq_literals.size(), m_ineq_literals.c_ptr(), justify(m_ineq_literals), CLS_AUX_LEMMA, 0);
ctx.mk_clause(m_ineq_literals.size(), m_ineq_literals.c_ptr(), justify(m_ineq_literals), CLS_AUX_LEMMA, nullptr);
break;
default: {
app_ref tmp = m_lemma.to_expr(false, ctx, get_manager());
@ -1785,7 +1785,7 @@ namespace smt {
justification* theory_pb::justify(literal l1, literal l2) {
literal lits[2] = { l1, l2 };
justification* js = 0;
justification* js = nullptr;
if (proofs_enabled()) {
js = get_context().mk_justification(theory_axiom_justification(get_id(), get_context().get_region(), 2, lits));
}
@ -1793,7 +1793,7 @@ namespace smt {
}
justification* theory_pb::justify(literal_vector const& lits) {
justification* js = 0;
justification* js = nullptr;
if (proofs_enabled()) {
js = get_context().mk_justification(theory_axiom_justification(get_id(), get_context().get_region(), lits.size(), lits.c_ptr()));
}
@ -2038,9 +2038,9 @@ namespace smt {
return (sum >= k)?m.mk_true():m.mk_false();
default:
UNREACHABLE();
return 0;
return nullptr;
}
return 0;
return nullptr;
}
};
@ -2058,7 +2058,7 @@ namespace smt {
return true;
}
expr * get_fresh_value(sort * s) override {
return 0;
return nullptr;
}
void register_value(expr * n) override { }
};

View file

@ -198,10 +198,10 @@ namespace smt {
watch_list* m_var_watch;
ineq* m_ineq;
var_info(): m_var_watch(0), m_ineq(0)
var_info(): m_var_watch(nullptr), m_ineq(nullptr)
{
m_lit_watch[0] = 0;
m_lit_watch[1] = 0;
m_lit_watch[0] = nullptr;
m_lit_watch[1] = nullptr;
}
void reset() {

View file

@ -87,7 +87,7 @@ bool theory_seq::solution_map::is_root(expr* e) const {
// e1 -> ... x, e2 -> ... x
void theory_seq::solution_map::find_rec(expr* e, svector<std::pair<expr*, dependency*> >& finds) {
dependency* d = 0;
dependency* d = nullptr;
std::pair<expr*, dependency*> value(e, d);
do {
e = value.first;
@ -111,7 +111,7 @@ bool theory_seq::solution_map::find1(expr* e, expr*& r, dependency*& d) {
expr* theory_seq::solution_map::find(expr* e, dependency*& d) {
std::pair<expr*, dependency*> value;
d = 0;
d = nullptr;
expr* result = e;
while (m_map.find(result, value)) {
d = m_dm.mk_join(d, value.second);
@ -199,12 +199,12 @@ theory_seq::theory_seq(ast_manager& m):
m_reset_cache(false),
m_eq_id(0),
m_find(*this),
m_factory(0),
m_factory(nullptr),
m_exclude(m),
m_axioms(m),
m_axioms_head(0),
m_int_string(m),
m_mg(0),
m_mg(nullptr),
m_rewrite(m),
m_seq_rewrite(m),
m_util(m),
@ -381,7 +381,7 @@ bool theory_seq::branch_binary_variable(eq const& e) {
// |x| - |y| = |ys| - |xs|
expr_ref a(mk_sub(m_util.str.mk_length(x), m_util.str.mk_length(y)), m);
expr_ref b(m_autil.mk_int(ys.size()-xs.size()), m);
propagate_lit(e.dep(), 0, 0, mk_eq(a, b, false));
propagate_lit(e.dep(), 0, nullptr, mk_eq(a, b, false));
return true;
}
if (lenX <= rational(ys.size())) {
@ -456,7 +456,7 @@ void theory_seq::branch_unit_variable(dependency* dep, expr* X, expr_ref_vector
if (lenX > rational(units.size())) {
expr_ref le(m_autil.mk_le(m_util.str.mk_length(X), m_autil.mk_int(units.size())), m);
TRACE("seq", tout << "propagate length on " << mk_pp(X, m) << "\n";);
propagate_lit(dep, 0, 0, mk_literal(le));
propagate_lit(dep, 0, nullptr, mk_literal(le));
return;
}
SASSERT(lenX.is_unsigned());
@ -1003,7 +1003,7 @@ bool theory_seq::fixed_length(expr* e) {
*/
void theory_seq::propagate_non_empty(literal lit, expr* s) {
SASSERT(get_context().get_assignment(lit) == l_true);
propagate_lit(0, 1, &lit, ~mk_eq_empty(s));
propagate_lit(nullptr, 1, &lit, ~mk_eq_empty(s));
}
bool theory_seq::propagate_is_conc(expr* e, expr* conc) {
@ -1011,7 +1011,7 @@ bool theory_seq::propagate_is_conc(expr* e, expr* conc) {
context& ctx = get_context();
literal lit = ~mk_eq_empty(e);
if (ctx.get_assignment(lit) == l_true) {
propagate_lit(0, 1, &lit, mk_eq(e, conc, false));
propagate_lit(nullptr, 1, &lit, mk_eq(e, conc, false));
expr_ref e1(e, m), e2(conc, m);
new_eq_eh(m_dm.mk_leaf(assumption(lit)), ctx.get_enode(e1), ctx.get_enode(e2));
return true;
@ -1060,9 +1060,9 @@ bool theory_seq::is_post(expr* e, expr*& s, expr*& i) {
expr_ref theory_seq::mk_nth(expr* s, expr* idx) {
sort* char_sort = 0;
sort* char_sort = nullptr;
VERIFY(m_util.is_seq(m.get_sort(s), char_sort));
return mk_skolem(m_nth, s, idx, 0, char_sort);
return mk_skolem(m_nth, s, idx, nullptr, char_sort);
}
expr_ref theory_seq::mk_sk_ite(expr* c, expr* t, expr* e) {
@ -1074,9 +1074,9 @@ expr_ref theory_seq::mk_last(expr* s) {
if (m_util.str.is_string(s, str) && str.length() > 0) {
return expr_ref(m_util.str.mk_char(str, str.length()-1), m);
}
sort* char_sort = 0;
sort* char_sort = nullptr;
VERIFY(m_util.is_seq(m.get_sort(s), char_sort));
return mk_skolem(m_seq_last, s, 0, 0, char_sort);
return mk_skolem(m_seq_last, s, nullptr, nullptr, char_sort);
}
expr_ref theory_seq::mk_first(expr* s) {
@ -1089,7 +1089,7 @@ expr_ref theory_seq::mk_first(expr* s) {
void theory_seq::mk_decompose(expr* e, expr_ref& head, expr_ref& tail) {
expr* e1 = 0, *e2 = 0;
expr* e1 = nullptr, *e2 = nullptr;
zstring s;
if (m_util.str.is_empty(e)) {
head = m_util.str.mk_unit(mk_nth(e, m_autil.mk_int(0)));
@ -1136,7 +1136,7 @@ bool theory_seq::check_extensionality() {
continue;
}
if (!seqs.empty() && ctx.is_relevant(n1) && m_util.is_seq(o1) && ctx.is_shared(n1)) {
dependency* dep = 0;
dependency* dep = nullptr;
expr_ref e1 = canonize(o1, dep);
for (unsigned i = 0; i < seqs.size(); ++i) {
enode* n2 = get_enode(seqs[i]);
@ -1237,7 +1237,7 @@ bool theory_seq::linearize(dependency* dep, enode_pair_vector& eqs, literal_vect
lits.push_back(a.lit);
asserted &= ctx.get_assignment(a.lit) == l_true;
}
if (a.n1 != 0) {
if (a.n1 != nullptr) {
eqs.push_back(enode_pair(a.n1, a.n2));
}
}
@ -1286,7 +1286,7 @@ void theory_seq::set_conflict(dependency* dep, literal_vector const& _lits) {
ctx.set_conflict(
ctx.mk_justification(
ext_theory_conflict_justification(
get_id(), ctx.get_region(), lits.size(), lits.c_ptr(), eqs.size(), eqs.c_ptr(), 0, 0)));
get_id(), ctx.get_region(), lits.size(), lits.c_ptr(), eqs.size(), eqs.c_ptr(), 0, nullptr)));
}
void theory_seq::propagate_eq(dependency* dep, enode* n1, enode* n2) {
@ -1438,7 +1438,7 @@ bool theory_seq::occurs(expr* a, expr* b) {
// true if a occurs under an interpreted function or under left/right selector.
SASSERT(is_var(a));
SASSERT(m_todo.empty());
expr* e1 = 0, *e2 = 0;
expr* e1 = nullptr, *e2 = nullptr;
m_todo.push_back(b);
while (!m_todo.empty()) {
b = m_todo.back();
@ -1508,7 +1508,7 @@ bool theory_seq::solve_eq(expr_ref_vector const& l, expr_ref_vector const& r, de
expr_ref_vector& ls = m_ls;
expr_ref_vector& rs = m_rs;
rs.reset(); ls.reset();
dependency* dep2 = 0;
dependency* dep2 = nullptr;
bool change = canonize(l, ls, dep2);
change = canonize(r, rs, dep2) || change;
deps = m_dm.mk_join(dep2, deps);
@ -1545,7 +1545,7 @@ bool theory_seq::propagate_max_length(expr* l, expr* r, dependency* deps) {
}
rational hi;
if (is_tail(l, s, idx) && has_length(s) && m_util.str.is_empty(r) && !upper_bound(s, hi)) {
propagate_lit(deps, 0, 0, mk_literal(m_autil.mk_le(m_util.str.mk_length(s), m_autil.mk_int(idx+1))));
propagate_lit(deps, 0, nullptr, mk_literal(m_autil.mk_le(m_util.str.mk_length(s), m_autil.mk_int(idx+1))));
return true;
}
return false;
@ -1737,7 +1737,7 @@ bool theory_seq::solve_binary_eq(expr_ref_vector const& ls, expr_ref_vector cons
}
ctx.mark_as_relevant(eq);
if (sz == 1) {
propagate_lit(dep, 0, 0, eq);
propagate_lit(dep, 0, nullptr, eq);
return true;
}
m_new_propagation = true;
@ -1885,7 +1885,7 @@ bool theory_seq::solve_ne(unsigned idx) {
expr_ref_vector& lhs = m_lhs;
expr_ref_vector& rhs = m_rhs;
ls.reset(); rs.reset(); lhs.reset(); rhs.reset();
dependency* deps = 0;
dependency* deps = nullptr;
bool change = false;
change = canonize(n.ls(i), ls, deps) || change;
change = canonize(n.rs(i), rs, deps) || change;
@ -1991,7 +1991,7 @@ bool theory_seq::solve_ne(unsigned idx) {
if (num_undef_lits == 0 && new_ls.empty()) {
TRACE("seq", tout << "conflict\n";);
dependency* deps1 = 0;
dependency* deps1 = nullptr;
if (explain_eq(n.l(), n.r(), deps1)) {
literal diseq = mk_eq(n.l(), n.r(), false);
if (ctx.get_assignment(diseq) == l_false) {
@ -2034,10 +2034,10 @@ bool theory_seq::solve_nc(unsigned idx) {
return true;
}
expr* e1 = 0, *e2 = 0;
expr* e1 = nullptr, *e2 = nullptr;
if (m.is_eq(c, e1, e2)) {
literal eq = mk_eq(e1, e2, false);
propagate_lit(deps, 0, 0, ~eq);
propagate_lit(deps, 0, nullptr, ~eq);
return true;
}
@ -2059,7 +2059,7 @@ theory_seq::cell* theory_seq::mk_cell(cell* p, expr* e, dependency* d) {
}
void theory_seq::unfold(cell* c, ptr_vector<cell>& cons) {
dependency* dep = 0;
dependency* dep = nullptr;
expr* a, *e1, *e2;
if (m_rep.find1(c->m_expr, a, dep)) {
cell* c1 = mk_cell(c, a, m_dm.mk_join(dep, c->m_dep));
@ -2067,7 +2067,7 @@ void theory_seq::unfold(cell* c, ptr_vector<cell>& cons) {
}
else if (m_util.str.is_concat(c->m_expr, e1, e2)) {
cell* c1 = mk_cell(c, e1, c->m_dep);
cell* c2 = mk_cell(0, e2, 0);
cell* c2 = mk_cell(nullptr, e2, nullptr);
unfold(c1, cons);
unfold(c2, cons);
}
@ -2085,7 +2085,7 @@ void theory_seq::unfold(cell* c, ptr_vector<cell>& cons) {
void theory_seq::display_explain(std::ostream& out, unsigned indent, expr* e) {
expr* e1, *e2, *a;
dependency* dep = 0;
dependency* dep = nullptr;
smt2_pp_environment_dbg env(m);
params_ref p;
for (unsigned i = 0; i < indent; ++i) out << " ";
@ -2109,8 +2109,8 @@ bool theory_seq::explain_eq(expr* e1, expr* e2, dependency*& dep) {
expr* a1, *a2;
ptr_vector<cell> v1, v2;
unsigned cells_sz = m_all_cells.size();
cell* c1 = mk_cell(0, e1, 0);
cell* c2 = mk_cell(0, e2, 0);
cell* c1 = mk_cell(nullptr, e1, nullptr);
cell* c2 = mk_cell(nullptr, e2, nullptr);
unfold(c1, v1);
unfold(c2, v2);
unsigned i = 0, j = 0;
@ -2300,7 +2300,7 @@ bool theory_seq::internalize_term(app* term) {
ctx.mark_as_relevant(bv);
}
enode* e = 0;
enode* e = nullptr;
if (ctx.e_internalized(term)) {
e = ctx.get_enode(term);
}
@ -2358,7 +2358,7 @@ bool theory_seq::check_int_string() {
bool theory_seq::add_stoi_axiom(expr* e) {
context& ctx = get_context();
expr* n = 0;
expr* n = nullptr;
rational val;
TRACE("seq", tout << mk_pp(e, m) << "\n";);
VERIFY(m_util.str.is_stoi(e, n));
@ -2426,7 +2426,7 @@ bool theory_seq::add_stoi_axiom(expr* e) {
literal theory_seq::is_digit(expr* ch) {
bv_util bv(m);
literal isd = mk_literal(mk_skolem(symbol("seq.is_digit"), ch, 0, 0, m.mk_bool_sort()));
literal isd = mk_literal(mk_skolem(symbol("seq.is_digit"), ch, nullptr, nullptr, m.mk_bool_sort()));
expr_ref d2i = digit2int(ch);
expr_ref _lo(bv.mk_ule(bv.mk_numeral(rational('0'), bv.mk_sort(8)), ch), m);
expr_ref _hi(bv.mk_ule(ch, bv.mk_numeral(rational('9'), bv.mk_sort(8))), m);
@ -2442,13 +2442,13 @@ literal theory_seq::is_digit(expr* ch) {
}
expr_ref theory_seq::digit2int(expr* ch) {
return expr_ref(mk_skolem(symbol("seq.digit2int"), ch, 0, 0, m_autil.mk_int()), m);
return expr_ref(mk_skolem(symbol("seq.digit2int"), ch, nullptr, nullptr, m_autil.mk_int()), m);
}
bool theory_seq::add_itos_axiom(expr* e) {
context& ctx = get_context();
rational val;
expr* n = 0;
expr* n = nullptr;
TRACE("seq", tout << mk_pp(e, m) << "\n";);
VERIFY(m_util.str.is_itos(e, n));
if (get_num_value(n, val)) {
@ -2656,7 +2656,7 @@ void theory_seq::init_search_eh() {
void theory_seq::init_model(expr_ref_vector const& es) {
expr_ref new_s(m);
for (expr* e : es) {
dependency* eqs = 0;
dependency* eqs = nullptr;
expr_ref s = canonize(e, eqs);
if (is_var(s)) {
new_s = m_factory->get_fresh_value(m.get_sort(s));
@ -2734,7 +2734,7 @@ public:
break;
}
case string_source: {
dependency* deps = 0;
dependency* deps = nullptr;
expr_ref tmp = th.canonize(m_strings[k], deps);
zstring zs;
if (th.m_util.str.is_string(tmp, zs)) {
@ -2848,7 +2848,7 @@ app* theory_seq::mk_value(app* e) {
}
m_factory->add_trail(result);
TRACE("seq", tout << mk_pp(e, m) << " -> " << result << "\n";);
m_rep.update(e, result, 0);
m_rep.update(e, result, nullptr);
return to_app(result);
}
@ -2944,7 +2944,7 @@ expr_ref theory_seq::expand1(expr* e0, dependency*& eqs) {
expr_ref result(m);
result = try_expand(e0, eqs);
if (result) return result;
dependency* deps = 0;
dependency* deps = nullptr;
expr* e = m_rep.find(e0, deps);
expr* e1, *e2, *e3;
expr_ref arg1(m), arg2(m);
@ -3074,7 +3074,7 @@ expr_ref theory_seq::expand1(expr* e0, dependency*& eqs) {
result = e;
}
if (result == e0) {
deps = 0;
deps = nullptr;
}
expr_dep edr(result, deps);
m_rep.add_cache(e0, edr);
@ -3204,7 +3204,7 @@ void theory_seq::tightest_prefix(expr* s, expr* x) {
(len(s) <= len(t) -> i <= len(t)-len(s))
*/
void theory_seq::add_indexof_axiom(expr* i) {
expr* s = 0, *t = 0, *offset = 0;
expr* s = nullptr, *t = nullptr, *offset = nullptr;
rational r;
VERIFY(m_util.str.is_index(i, t, s) ||
m_util.str.is_index(i, t, s, offset));
@ -3289,7 +3289,7 @@ void theory_seq::add_indexof_axiom(expr* i) {
*/
void theory_seq::add_replace_axiom(expr* r) {
context& ctx = get_context();
expr* a = 0, *s = 0, *t = 0;
expr* a = nullptr, *s = nullptr, *t = nullptr;
VERIFY(m_util.str.is_replace(r, a, s, t));
expr_ref x = mk_skolem(m_indexof_left, a, s);
expr_ref y = mk_skolem(m_indexof_right, a, s);
@ -3319,7 +3319,7 @@ void theory_seq::add_elim_string_axiom(expr* n) {
result = mk_concat(m_util.str.mk_unit(m_util.str.mk_char(s, i)), result);
}
add_axiom(mk_eq(n, result, false));
m_rep.update(n, result, 0);
m_rep.update(n, result, nullptr);
m_new_solution = true;
}
@ -3335,7 +3335,7 @@ void theory_seq::add_elim_string_axiom(expr* n) {
*/
void theory_seq::add_length_axiom(expr* n) {
context& ctx = get_context();
expr* x = 0;
expr* x = nullptr;
VERIFY(m_util.str.is_length(n, x));
if (m_util.str.is_concat(x) ||
m_util.str.is_unit(x) ||
@ -3358,7 +3358,7 @@ void theory_seq::add_length_axiom(expr* n) {
}
void theory_seq::add_itos_length_axiom(expr* len) {
expr* x = 0, *n = 0;
expr* x = nullptr, *n = nullptr;
VERIFY(m_util.str.is_length(len, x));
VERIFY(m_util.str.is_itos(x, n));
@ -3423,7 +3423,7 @@ void theory_seq::add_itos_length_axiom(expr* len) {
void theory_seq::propagate_in_re(expr* n, bool is_true) {
TRACE("seq", tout << mk_pp(n, m) << " <- " << (is_true?"true":"false") << "\n";);
expr* e1 = 0, *e2 = 0;
expr* e1 = nullptr, *e2 = nullptr;
VERIFY(m_util.str.is_in_re(n, e1, e2));
expr_ref tmp(n, m);
@ -3432,7 +3432,7 @@ void theory_seq::propagate_in_re(expr* n, bool is_true) {
if (!is_true) {
literal_vector lits;
lits.push_back(mk_literal(n));
set_conflict(0, lits);
set_conflict(nullptr, lits);
}
return;
}
@ -3440,7 +3440,7 @@ void theory_seq::propagate_in_re(expr* n, bool is_true) {
if (is_true) {
literal_vector lits;
lits.push_back(~mk_literal(n));
set_conflict(0, lits);
set_conflict(nullptr, lits);
}
return;
}
@ -3474,7 +3474,7 @@ void theory_seq::propagate_in_re(expr* n, bool is_true) {
lits.push_back(mk_accept(e1, zero, e3, states[i]));
}
if (lits.size() == 2) {
propagate_lit(0, 1, &lit, lits[1]);
propagate_lit(nullptr, 1, &lit, lits[1]);
}
else {
TRACE("seq", ctx.display_literals_verbose(tout, lits); tout << "\n";);
@ -3506,7 +3506,7 @@ static T* get_th_arith(context& ctx, theory_id afid, expr* e) {
return dynamic_cast<T*>(th);
}
else {
return 0;
return nullptr;
}
}
@ -3566,7 +3566,7 @@ bool theory_seq::get_length(expr* e, rational& val) const {
context& ctx = get_context();
rational val1;
expr_ref len(m), len_val(m);
expr* e1 = 0, *e2 = 0;
expr* e1 = nullptr, *e2 = nullptr;
ptr_vector<expr> todo;
todo.push_back(e);
val.reset();
@ -3638,7 +3638,7 @@ this translates to:
void theory_seq::add_extract_axiom(expr* e) {
TRACE("seq", tout << mk_pp(e, m) << "\n";);
expr* s = 0, *i = 0, *l = 0;
expr* s = nullptr, *i = nullptr, *l = nullptr;
VERIFY(m_util.str.is_extract(e, s, i, l));
if (is_tail(s, i, l)) {
add_tail_axiom(e, s);
@ -3769,7 +3769,7 @@ void theory_seq::add_extract_suffix_axiom(expr* e, expr* s, expr* i) {
*/
void theory_seq::add_at_axiom(expr* e) {
expr* s = 0, *i = 0;
expr* s = nullptr, *i = nullptr;
VERIFY(m_util.str.is_at(e, s, i));
expr_ref len_e(m_util.str.mk_length(e), m);
expr_ref len_s(m_util.str.mk_length(s), m);
@ -3798,17 +3798,17 @@ void theory_seq::add_at_axiom(expr* e) {
*/
void theory_seq::propagate_step(literal lit, expr* step) {
SASSERT(get_context().get_assignment(lit) == l_true);
expr* re = 0, *acc = 0, *s = 0, *idx = 0, *i = 0, *j = 0;
expr* re = nullptr, *acc = nullptr, *s = nullptr, *idx = nullptr, *i = nullptr, *j = nullptr;
VERIFY(is_step(step, s, idx, re, i, j, acc));
TRACE("seq", tout << mk_pp(step, m) << " -> " << mk_pp(acc, m) << "\n";);
propagate_lit(0, 1, &lit, mk_simplified_literal(acc));
propagate_lit(nullptr, 1, &lit, mk_simplified_literal(acc));
rational lo;
rational _idx;
if (lower_bound(s, lo) && lo.is_unsigned() && m_autil.is_numeral(idx, _idx) && lo >= _idx) {
// skip
}
else {
propagate_lit(0, 1, &lit, ~mk_literal(m_autil.mk_le(m_util.str.mk_length(s), idx)));
propagate_lit(nullptr, 1, &lit, ~mk_literal(m_autil.mk_le(m_util.str.mk_length(s), idx)));
}
ensure_nth(lit, s, idx);
}
@ -3854,7 +3854,7 @@ literal theory_seq::mk_literal(expr* _e) {
literal theory_seq::mk_seq_eq(expr* a, expr* b) {
SASSERT(m_util.is_seq(a));
return mk_literal(mk_skolem(m_eq, a, b, 0, m.mk_bool_sort()));
return mk_literal(mk_skolem(m_eq, a, b, nullptr, m.mk_bool_sort()));
}
literal theory_seq::mk_eq_empty(expr* _e, bool phase) {
@ -3927,7 +3927,7 @@ theory_seq::dependency* theory_seq::mk_join(dependency* deps, literal_vector con
void theory_seq::propagate_eq(literal lit, expr* e1, expr* e2, bool add_to_eqs) {
literal_vector lits;
lits.push_back(lit);
propagate_eq(0, lits, e1, e2, add_to_eqs);
propagate_eq(nullptr, lits, e1, e2, add_to_eqs);
}
void theory_seq::propagate_eq(dependency* deps, literal_vector const& _lits, expr* e1, expr* e2, bool add_to_eqs) {
@ -3966,7 +3966,7 @@ void theory_seq::propagate_eq(dependency* deps, literal_vector const& _lits, exp
void theory_seq::assign_eh(bool_var v, bool is_true) {
context & ctx = get_context();
expr* e = ctx.bool_var2expr(v);
expr* e1 = 0, *e2 = 0;
expr* e1 = nullptr, *e2 = nullptr;
expr_ref f(m);
bool change = false;
literal lit(v, !is_true);
@ -4231,7 +4231,7 @@ void theory_seq::relevant_eh(app* n) {
eautomaton* theory_seq::get_automaton(expr* re) {
eautomaton* result = 0;
eautomaton* result = nullptr;
if (m_re2aut.find(re, result)) {
return result;
}
@ -4312,9 +4312,9 @@ expr_ref theory_seq::mk_step(expr* s, expr* idx, expr* re, unsigned i, unsigned
rej(s, idx, re, i) -> len(s) > idx if i is final
*/
void theory_seq::propagate_acc_rej_length(literal lit, expr* e) {
expr *s = 0, *idx = 0, *re = 0;
expr *s = nullptr, *idx = nullptr, *re = nullptr;
unsigned src;
eautomaton* aut = 0;
eautomaton* aut = nullptr;
bool is_acc;
is_acc = is_accept(e, s, idx, re, src, aut);
if (!is_acc) {
@ -4324,15 +4324,15 @@ void theory_seq::propagate_acc_rej_length(literal lit, expr* e) {
SASSERT(m_autil.is_numeral(idx));
SASSERT(get_context().get_assignment(lit) == l_true);
if (aut->is_sink_state(src)) {
propagate_lit(0, 1, &lit, false_literal);
propagate_lit(nullptr, 1, &lit, false_literal);
return;
}
bool is_final = aut->is_final_state(src);
if (is_final == is_acc) {
propagate_lit(0, 1, &lit, mk_literal(m_autil.mk_ge(m_util.str.mk_length(s), idx)));
propagate_lit(nullptr, 1, &lit, mk_literal(m_autil.mk_ge(m_util.str.mk_length(s), idx)));
}
else {
propagate_lit(0, 1, &lit, ~mk_literal(m_autil.mk_le(m_util.str.mk_length(s), idx)));
propagate_lit(nullptr, 1, &lit, ~mk_literal(m_autil.mk_le(m_util.str.mk_length(s), idx)));
}
}
@ -4345,10 +4345,10 @@ bool theory_seq::add_accept2step(expr* acc, bool& change) {
TRACE("seq", tout << mk_pp(acc, m) << "\n";);
SASSERT(ctx.get_assignment(acc) == l_true);
expr *e = 0, *idx = 0, *re = 0;
expr *e = nullptr, *idx = nullptr, *re = nullptr;
expr_ref step(m);
unsigned src;
eautomaton* aut = 0;
eautomaton* aut = nullptr;
VERIFY(is_accept(acc, e, idx, re, src, aut));
if (!aut || m_util.str.is_length(idx)) {
return false;
@ -4401,7 +4401,7 @@ bool theory_seq::add_accept2step(expr* acc, bool& change) {
for (unsigned i = 0; i < lits.size(); ++i) {
lits[i].neg();
}
propagate_lit(0, lits.size(), lits.c_ptr(), lit);
propagate_lit(nullptr, lits.size(), lits.c_ptr(), lit);
return false;
}
if (has_undef) {
@ -4412,7 +4412,7 @@ bool theory_seq::add_accept2step(expr* acc, bool& change) {
SASSERT(ctx.get_assignment(lits[i]) == l_false);
lits[i].neg();
}
set_conflict(0, lits);
set_conflict(nullptr, lits);
return false;
}
@ -4424,7 +4424,7 @@ bool theory_seq::add_accept2step(expr* acc, bool& change) {
bool theory_seq::add_step2accept(expr* step, bool& change) {
context& ctx = get_context();
SASSERT(ctx.get_assignment(step) == l_true);
expr* re = 0, *_acc = 0, *s = 0, *idx = 0, *i = 0, *j = 0;
expr* re = nullptr, *_acc = nullptr, *s = nullptr, *idx = nullptr, *i = nullptr, *j = nullptr;
VERIFY(is_step(step, s, idx, re, i, j, _acc));
literal acc1 = mk_accept(s, idx, re, i);
switch (ctx.get_assignment(acc1)) {
@ -4445,12 +4445,12 @@ bool theory_seq::add_step2accept(expr* step, bool& change) {
lits.push_back(~acc2);
switch (ctx.get_assignment(acc2)) {
case l_undef:
propagate_lit(0, 2, lits.c_ptr(), acc2);
propagate_lit(nullptr, 2, lits.c_ptr(), acc2);
break;
case l_true:
break;
case l_false:
set_conflict(0, lits);
set_conflict(nullptr, lits);
break;
}
break;
@ -4473,10 +4473,10 @@ Recall we also have:
bool theory_seq::add_reject2reject(expr* rej, bool& change) {
context& ctx = get_context();
SASSERT(ctx.get_assignment(rej) == l_true);
expr* s = 0, *idx = 0, *re = 0;
expr* s = nullptr, *idx = nullptr, *re = nullptr;
unsigned src;
rational r;
eautomaton* aut = 0;
eautomaton* aut = nullptr;
VERIFY(is_reject(rej, s, idx, re, src, aut));
if (!aut || m_util.str.is_length(idx)) return false;
VERIFY(m_autil.is_numeral(idx, r) && r.is_unsigned());
@ -4535,7 +4535,7 @@ bool theory_seq::add_reject2reject(expr* rej, bool& change) {
void theory_seq::propagate_not_prefix(expr* e) {
context& ctx = get_context();
expr* e1 = 0, *e2 = 0;
expr* e1 = nullptr, *e2 = nullptr;
VERIFY(m_util.str.is_prefix(e, e1, e2));
literal lit = ctx.get_literal(e);
SASSERT(ctx.get_assignment(lit) == l_false);
@ -4545,13 +4545,13 @@ void theory_seq::propagate_not_prefix(expr* e) {
propagate_non_empty(~lit, e1);
expr_ref emp(m_util.str.mk_empty(m.get_sort(e1)), m);
literal e2_is_emp = mk_seq_eq(e2, emp);
sort* char_sort = 0;
sort* char_sort = nullptr;
VERIFY(m_util.is_seq(m.get_sort(e1), char_sort));
expr_ref x = mk_skolem(symbol("seq.prefix.x"), e1, e2);
expr_ref y = mk_skolem(symbol("seq.prefix.y"), e1, e2);
expr_ref z = mk_skolem(symbol("seq.prefix.z"), e1, e2);
expr_ref c = mk_skolem(symbol("seq.prefix.c"), e1, e2, 0, char_sort);
expr_ref d = mk_skolem(symbol("seq.prefix.d"), e1, e2, 0, char_sort);
expr_ref c = mk_skolem(symbol("seq.prefix.c"), e1, e2, nullptr, char_sort);
expr_ref d = mk_skolem(symbol("seq.prefix.d"), e1, e2, nullptr, char_sort);
add_axiom(lit, e2_is_emp, mk_seq_eq(e1, mk_concat(x, m_util.str.mk_unit(c), y)));
add_axiom(lit, e2_is_emp, mk_seq_eq(e2, mk_concat(x, m_util.str.mk_unit(d), z)), mk_seq_eq(e2, x));
add_axiom(lit, e2_is_emp, ~mk_eq(c, d, false), mk_seq_eq(e2, x));
@ -4564,7 +4564,7 @@ void theory_seq::propagate_not_prefix(expr* e) {
void theory_seq::propagate_not_prefix2(expr* e) {
context& ctx = get_context();
expr* e1 = 0, *e2 = 0;
expr* e1 = nullptr, *e2 = nullptr;
VERIFY(m_util.str.is_prefix(e, e1, e2));
literal lit = ctx.get_literal(e);
SASSERT(ctx.get_assignment(lit) == l_false);
@ -4591,7 +4591,7 @@ void theory_seq::propagate_not_prefix2(expr* e) {
void theory_seq::propagate_not_suffix(expr* e) {
context& ctx = get_context();
expr* e1 = 0, *e2 = 0;
expr* e1 = nullptr, *e2 = nullptr;
VERIFY(m_util.str.is_suffix(e, e1, e2));
literal lit = ctx.get_literal(e);
SASSERT(ctx.get_assignment(lit) == l_false);
@ -4602,13 +4602,13 @@ void theory_seq::propagate_not_suffix(expr* e) {
expr_ref emp(m_util.str.mk_empty(m.get_sort(e1)), m);
literal e2_is_emp = mk_seq_eq(e2, emp);
sort* char_sort = 0;
sort* char_sort = nullptr;
VERIFY(m_util.is_seq(m.get_sort(e1), char_sort));
expr_ref x = mk_skolem(symbol("seq.suffix.x"), e1, e2);
expr_ref y = mk_skolem(symbol("seq.suffix.y"), e1, e2);
expr_ref z = mk_skolem(symbol("seq.suffix.z"), e1, e2);
expr_ref c = mk_skolem(symbol("seq.suffix.c"), e1, e2, 0, char_sort);
expr_ref d = mk_skolem(symbol("seq.suffix.d"), e1, e2, 0, char_sort);
expr_ref c = mk_skolem(symbol("seq.suffix.c"), e1, e2, nullptr, char_sort);
expr_ref d = mk_skolem(symbol("seq.suffix.d"), e1, e2, nullptr, char_sort);
add_axiom(lit, e2_is_emp, mk_seq_eq(e1, mk_concat(y, m_util.str.mk_unit(c), x)));
add_axiom(lit, e2_is_emp, mk_seq_eq(e2, mk_concat(z, m_util.str.mk_unit(d), x)), mk_seq_eq(e2, x));
add_axiom(lit, e2_is_emp, ~mk_eq(c, d, false), mk_seq_eq(e2, x));
@ -4620,7 +4620,7 @@ void theory_seq::propagate_not_suffix(expr* e) {
*/
bool theory_seq::add_prefix2prefix(expr* e, bool& change) {
context& ctx = get_context();
expr* e1 = 0, *e2 = 0;
expr* e1 = nullptr, *e2 = nullptr;
VERIFY(m_util.str.is_prefix(e, e1, e2));
SASSERT(ctx.get_assignment(e) == l_false);
if (canonizes(false, e)) {
@ -4682,7 +4682,7 @@ bool theory_seq::add_prefix2prefix(expr* e, bool& change) {
lits.push_back(~ctx.get_literal(e));
lits.push_back(~e2_is_emp);
lits.push_back(lit);
propagate_lit(0, lits.size(), lits.c_ptr(), ~mk_literal(m_util.str.mk_prefix(tail1, tail2)));
propagate_lit(nullptr, lits.size(), lits.c_ptr(), ~mk_literal(m_util.str.mk_prefix(tail1, tail2)));
TRACE("seq", tout << mk_pp(e, m) << " saturate: " << tail1 << " = " << tail2 << "\n";);
return false;
}
@ -4692,7 +4692,7 @@ bool theory_seq::add_prefix2prefix(expr* e, bool& change) {
*/
bool theory_seq::add_suffix2suffix(expr* e, bool& change) {
context& ctx = get_context();
expr* e1 = 0, *e2 = 0;
expr* e1 = nullptr, *e2 = nullptr;
VERIFY(m_util.str.is_suffix(e, e1, e2));
SASSERT(ctx.get_assignment(e) == l_false);
if (canonizes(false, e)) {
@ -4746,21 +4746,21 @@ bool theory_seq::add_suffix2suffix(expr* e, bool& change) {
lits.push_back(~ctx.get_literal(e));
lits.push_back(~e2_is_emp);
lits.push_back(last_eq);
propagate_lit(0, lits.size(), lits.c_ptr(), ~mk_literal(m_util.str.mk_suffix(first1, first2)));
propagate_lit(nullptr, lits.size(), lits.c_ptr(), ~mk_literal(m_util.str.mk_suffix(first1, first2)));
TRACE("seq", tout << mk_pp(e, m) << " saturate\n";);
return false;
}
bool theory_seq::canonizes(bool sign, expr* e) {
context& ctx = get_context();
dependency* deps = 0;
dependency* deps = nullptr;
expr_ref cont = canonize(e, deps);
TRACE("seq", tout << mk_pp(e, m) << " -> " << cont << "\n";
if (deps) display_deps(tout, deps););
if ((m.is_true(cont) && !sign) ||
(m.is_false(cont) && sign)) {
TRACE("seq", display(tout); tout << ctx.get_assignment(ctx.get_literal(e)) << "\n";);
propagate_lit(deps, 0, 0, ctx.get_literal(e));
propagate_lit(deps, 0, nullptr, ctx.get_literal(e));
return true;
}
if ((m.is_false(cont) && !sign) ||
@ -4778,7 +4778,7 @@ bool theory_seq::canonizes(bool sign, expr* e) {
bool theory_seq::add_contains2contains(expr* e, bool& change) {
context& ctx = get_context();
expr* e1 = 0, *e2 = 0;
expr* e1 = nullptr, *e2 = nullptr;
VERIFY(m_util.str.is_contains(e, e1, e2));
SASSERT(ctx.get_assignment(e) == l_false);
if (canonizes(false, e)) {
@ -4803,7 +4803,7 @@ bool theory_seq::add_contains2contains(expr* e, bool& change) {
propagate_eq(~e1_is_emp, e1, conc, true);
literal lits[2] = { ~ctx.get_literal(e), ~e1_is_emp };
propagate_lit(0, 2, lits, ~mk_literal(m_util.str.mk_contains(tail, e2)));
propagate_lit(nullptr, 2, lits, ~mk_literal(m_util.str.mk_contains(tail, e2)));
return false;
}
@ -4848,7 +4848,7 @@ bool theory_seq::propagate_automata() {
}
void theory_seq::get_concat(expr* e, ptr_vector<expr>& concats) {
expr* e1 = 0, *e2 = 0;
expr* e1 = nullptr, *e2 = nullptr;
while (true) {
e = m_rep.find(e);
if (m_util.str.is_concat(e, e1, e2)) {

View file

@ -37,7 +37,7 @@ namespace smt {
enode* n1, *n2;
literal lit;
assumption(enode* n1, enode* n2): n1(n1), n2(n2), lit(null_literal) {}
assumption(literal lit): n1(0), n2(0), lit(lit) {}
assumption(literal lit): n1(nullptr), n2(nullptr), lit(lit) {}
};
typedef scoped_dependency_manager<assumption> dependency_manager;
typedef dependency_manager::dependency dependency;
@ -434,7 +434,7 @@ namespace smt {
// asserting consequences
bool linearize(dependency* dep, enode_pair_vector& eqs, literal_vector& lits) const;
void propagate_lit(dependency* dep, literal lit) { propagate_lit(dep, 0, 0, lit); }
void propagate_lit(dependency* dep, literal lit) { propagate_lit(dep, 0, nullptr, lit); }
void propagate_lit(dependency* dep, unsigned n, literal const* lits, literal lit);
void propagate_eq(dependency* dep, enode* n1, enode* n2);
void propagate_eq(literal lit, expr* e1, expr* e2, bool add_to_eqs);
@ -531,7 +531,7 @@ namespace smt {
bool get_length(expr* s, rational& val) const;
void mk_decompose(expr* e, expr_ref& head, expr_ref& tail);
expr_ref mk_skolem(symbol const& s, expr* e1, expr* e2 = 0, expr* e3 = 0, sort* range = 0);
expr_ref mk_skolem(symbol const& s, expr* e1, expr* e2 = nullptr, expr* e3 = nullptr, sort* range = nullptr);
bool is_skolem(symbol const& s, expr* e) const;
void set_incomplete(app* term);

View file

@ -67,12 +67,12 @@ namespace smt {
if (u.is_seq(s)) {
return u.str.mk_empty(s);
}
sort* seq = 0;
sort* seq = nullptr;
if (u.is_re(s, seq)) {
return u.re.mk_to_re(u.str.mk_empty(seq));
}
UNREACHABLE();
return 0;
return nullptr;
}
bool get_some_values(sort* s, expr_ref& v1, expr_ref& v2) override {
if (u.is_string(s)) {
@ -105,7 +105,7 @@ namespace smt {
return u.str.mk_string(sym);
}
}
sort* seq = 0, *ch = 0;
sort* seq = nullptr, *ch = nullptr;
if (u.is_re(s, seq)) {
expr* v0 = get_fresh_value(seq);
return u.re.mk_to_re(v0);
@ -120,7 +120,7 @@ namespace smt {
return u.str.mk_unit(v);
}
UNREACHABLE();
return 0;
return nullptr;
}
void register_value(expr* n) override {
symbol sym;
@ -150,7 +150,7 @@ namespace smt {
bool m_used;
final_check_status final_check_eh() override { return m_used?FC_GIVEUP:FC_DONE; }
bool internalize_atom(app*, bool) override { if (!m_used) { get_context().push_trail(value_trail<context,bool>(m_used)); m_used = true; } return false; }
bool internalize_term(app*) override { return internalize_atom(0,false); }
bool internalize_term(app*) override { return internalize_atom(nullptr,false); }
void new_eq_eh(theory_var, theory_var) override { }
void new_diseq_eh(theory_var, theory_var) override {}
theory* mk_fresh(context* new_ctx) override { return alloc(theory_seq_empty, new_ctx->get_manager()); }

View file

@ -458,7 +458,7 @@ namespace smt {
buffer << "!tmp";
buffer << m_fresh_id;
m_fresh_id++;
return u.mk_skolem(symbol(buffer.c_str()), 0, 0, s);
return u.mk_skolem(symbol(buffer.c_str()), 0, nullptr, s);
}
@ -617,7 +617,7 @@ namespace smt {
ast_manager & m = get_manager();
expr * args[2] = {n, bound};
app * unrollFunc = get_manager().mk_app(get_id(), _OP_RE_UNROLL, 0, 0, 2, args);
app * unrollFunc = get_manager().mk_app(get_id(), _OP_RE_UNROLL, 0, nullptr, 2, args);
m_trail.push_back(unrollFunc);
expr_ref_vector items(m);
@ -659,7 +659,7 @@ namespace smt {
} else {
if (false) {
// use cache
app * lenTerm = NULL;
app * lenTerm = nullptr;
if (!length_ast_map.find(e, lenTerm)) {
lenTerm = u.str.mk_length(e);
length_ast_map.insert(e, lenTerm);
@ -705,14 +705,14 @@ namespace smt {
return n1;
}
}
return NULL;
return nullptr;
}
expr * theory_str::mk_concat(expr * n1, expr * n2) {
context & ctx = get_context();
ast_manager & m = get_manager();
ENSURE(n1 != NULL);
ENSURE(n2 != NULL);
ENSURE(n1 != nullptr);
ENSURE(n2 != nullptr);
bool n1HasEqcValue = false;
bool n2HasEqcValue = false;
n1 = get_eqc_value(n1, n1HasEqcValue);
@ -770,7 +770,7 @@ namespace smt {
// Z3 treats (ast1) and (ast2) as two different nodes.
//-------------------------------------------------------
expr * concatAst = NULL;
expr * concatAst = nullptr;
if (!concat_astNode_map.find(n1, n2, concatAst)) {
concatAst = u.str.mk_concat(n1, n2);
@ -1424,9 +1424,9 @@ namespace smt {
void theory_str::instantiate_axiom_Substr(enode * e) {
context & ctx = get_context();
ast_manager & m = get_manager();
expr* substrBase = 0;
expr* substrPos = 0;
expr* substrLen = 0;
expr* substrBase = nullptr;
expr* substrPos = nullptr;
expr* substrLen = nullptr;
app * expr = e->get_owner();
if (axiomatized_terms.contains(expr)) {
@ -2001,7 +2001,7 @@ namespace smt {
}
}
// give up
return NULL;
return nullptr;
}
// trace code helper
@ -2091,7 +2091,7 @@ namespace smt {
// (Concat n_eqNode arg1) /\ arg1 has eq const
expr * concatResult = eval_concat(eq_str, arg1);
if (concatResult != NULL) {
if (concatResult != nullptr) {
bool arg1HasEqcValue = false;
expr * arg1Value = get_eqc_value(arg1, arg1HasEqcValue);
expr_ref implyL(m);
@ -2162,7 +2162,7 @@ namespace smt {
// (Concat arg0 n_eqNode) /\ arg0 has eq const
expr * concatResult = eval_concat(arg0, eq_str);
if (concatResult != NULL) {
if (concatResult != nullptr) {
bool arg0HasEqcValue = false;
expr * arg0Value = get_eqc_value(arg0, arg0HasEqcValue);
expr_ref implyL(m);
@ -2846,8 +2846,8 @@ namespace smt {
//*************************************************************
if (is_concat_eq_type2(new_nn1, new_nn2)) {
expr * y = NULL;
expr * m = NULL;
expr * y = nullptr;
expr * m = nullptr;
expr * v1_arg0 = to_app(new_nn1)->get_arg(0);
expr * v1_arg1 = to_app(new_nn1)->get_arg(1);
expr * v2_arg0 = to_app(new_nn2)->get_arg(0);
@ -2878,8 +2878,8 @@ namespace smt {
expr * v2_arg0 = to_app(new_nn2)->get_arg(0);
expr * v2_arg1 = to_app(new_nn2)->get_arg(1);
expr * x = NULL;
expr * n = NULL;
expr * x = nullptr;
expr * n = nullptr;
if (u.str.is_string(v1_arg0) && !u.str.is_string(v2_arg0)) {
n = v1_arg1;
@ -2920,8 +2920,8 @@ namespace smt {
expr * v2_arg0 = to_app(new_nn2)->get_arg(0);
expr * v2_arg1 = to_app(new_nn2)->get_arg(1);
expr * y = NULL;
expr * m = NULL;
expr * y = nullptr;
expr * m = nullptr;
if (u.str.is_string(v1_arg0)) {
y = v1_arg1;
@ -3020,9 +3020,9 @@ namespace smt {
<< "split type " << splitType << std::endl;
);
expr * t1 = NULL;
expr * t2 = NULL;
expr * xorFlag = NULL;
expr * t1 = nullptr;
expr * t2 = nullptr;
expr * xorFlag = nullptr;
std::pair<expr*, expr*> key1(concatAst1, concatAst2);
std::pair<expr*, expr*> key2(concatAst2, concatAst1);
@ -3390,10 +3390,10 @@ namespace smt {
return;
}
expr * x = NULL;
expr * y = NULL;
expr * strAst = NULL;
expr * m = NULL;
expr * x = nullptr;
expr * y = nullptr;
expr * strAst = nullptr;
expr * m = nullptr;
expr * v1_arg0 = to_app(concatAst1)->get_arg(0);
expr * v1_arg1 = to_app(concatAst1)->get_arg(1);
@ -3424,8 +3424,8 @@ namespace smt {
// setup
expr * xorFlag = NULL;
expr * temp1 = NULL;
expr * xorFlag = nullptr;
expr * temp1 = nullptr;
std::pair<expr*, expr*> key1(concatAst1, concatAst2);
std::pair<expr*, expr*> key2(concatAst2, concatAst1);
@ -3758,10 +3758,10 @@ namespace smt {
expr * v2_arg0 = to_app(concatAst2)->get_arg(0);
expr * v2_arg1 = to_app(concatAst2)->get_arg(1);
expr * x = NULL;
expr * y = NULL;
expr * strAst = NULL;
expr * n = NULL;
expr * x = nullptr;
expr * y = nullptr;
expr * strAst = nullptr;
expr * n = nullptr;
if (u.str.is_string(v1_arg0) && !u.str.is_string(v2_arg0)) {
strAst = v1_arg0;
@ -4318,10 +4318,10 @@ namespace smt {
expr * v2_arg1 = to_app(concatAst2)->get_arg(1);
expr * str1Ast = NULL;
expr * y = NULL;
expr * m = NULL;
expr * str2Ast = NULL;
expr * str1Ast = nullptr;
expr * y = nullptr;
expr * m = nullptr;
expr * str2Ast = nullptr;
if (u.str.is_string(v1_arg0)) {
str1Ast = v1_arg0;
@ -4362,8 +4362,8 @@ namespace smt {
}
//----------------------------------------------------------------
expr * commonVar = NULL;
expr * xorFlag = NULL;
expr * commonVar = nullptr;
expr * xorFlag = nullptr;
std::pair<expr*, expr*> key1(concatAst1, concatAst2);
std::pair<expr*, expr*> key2(concatAst2, concatAst1);
@ -4674,7 +4674,7 @@ namespace smt {
return dynamic_cast<theory_mi_arith*>(th);
}
else {
return 0;
return nullptr;
}
}
@ -4846,7 +4846,7 @@ namespace smt {
}
expr * theory_str::collect_eq_nodes(expr * n, expr_ref_vector & eqcSet) {
expr * constStrNode = NULL;
expr * constStrNode = nullptr;
expr * ex = n;
do {
@ -4891,7 +4891,7 @@ namespace smt {
expr * strAst = itor1->first;
expr * substrAst = itor1->second;
expr * boolVar = NULL;
expr * boolVar = nullptr;
if (!contain_pair_bool_map.find(strAst, substrAst, boolVar)) {
TRACE("str", tout << "warning: no entry for boolVar in contain_pair_bool_map" << std::endl;);
}
@ -5028,7 +5028,7 @@ namespace smt {
expr * strAst = itor1->first;
expr * substrAst = itor1->second;
expr * boolVar = NULL;
expr * boolVar = nullptr;
if (!contain_pair_bool_map.find(strAst, substrAst, boolVar)) {
TRACE("str", tout << "warning: no entry for boolVar in contain_pair_bool_map" << std::endl;);
}
@ -5445,7 +5445,7 @@ namespace smt {
expr_ref_vector willEqClass(m);
expr * constStrAst_1 = collect_eq_nodes(n1, willEqClass);
expr * constStrAst_2 = collect_eq_nodes(n2, willEqClass);
expr * constStrAst = (constStrAst_1 != NULL) ? constStrAst_1 : constStrAst_2;
expr * constStrAst = (constStrAst_1 != nullptr) ? constStrAst_1 : constStrAst_2;
TRACE("str", tout << "eqc of n1 is {";
for (expr_ref_vector::iterator it = willEqClass.begin(); it != willEqClass.end(); ++it) {
@ -5461,7 +5461,7 @@ namespace smt {
);
// step 1: we may have constant values for Contains checks now
if (constStrAst != NULL) {
if (constStrAst != nullptr) {
expr_ref_vector::iterator itAst = willEqClass.begin();
for (; itAst != willEqClass.end(); itAst++) {
if (*itAst == constStrAst) {
@ -6405,9 +6405,9 @@ namespace smt {
expr * constStr_1 = collect_eq_nodes(nn1, eqNodeSet);
expr * constStr_2 = collect_eq_nodes(nn2, eqNodeSet);
expr * constStr = (constStr_1 != NULL) ? constStr_1 : constStr_2;
expr * constStr = (constStr_1 != nullptr) ? constStr_1 : constStr_2;
if (constStr == NULL) {
if (constStr == nullptr) {
return;
} else {
expr_ref_vector::iterator itor = eqNodeSet.begin();
@ -6615,7 +6615,7 @@ namespace smt {
} else {
// Case 4: Concat(var, var) == const
TRACE("str", tout << "Case 4: Concat(var, var) == const" << std::endl;);
if (eval_concat(arg1, arg2) == NULL) {
if (eval_concat(arg1, arg2) == nullptr) {
rational arg1Len, arg2Len;
bool arg1Len_exists = get_len_value(arg1, arg1Len);
bool arg2Len_exists = get_len_value(arg2, arg2Len);
@ -6860,7 +6860,7 @@ namespace smt {
} else {
// start binary search as normal
expr_ref implLhs(ctx.mk_eq_atom(testvar, str), m);
expr_ref implRhs(binary_search_length_test(v, NULL, ""), m);
expr_ref implRhs(binary_search_length_test(v, nullptr, ""), m);
assert_implication(implLhs, implRhs);
}
} else {
@ -6992,14 +6992,14 @@ namespace smt {
}
expr * valueAssert = gen_free_var_options(fVar, effectiveLenInd, effectiveLenIndiStr, valTester, valTesterValue);
TRACE("str", tout << "asserting more value tests for free variable " << mk_ismt2_pp(fVar, m) << std::endl;);
if (valueAssert != NULL) {
if (valueAssert != nullptr) {
assert_axiom(valueAssert);
}
}
} else {
int lenTesterCount = fvar_lenTester_map[fVar].size();
expr * effectiveLenInd = NULL;
expr * effectiveLenInd = nullptr;
zstring effectiveLenIndiStr = "";
for (int i = 0; i < lenTesterCount; ++i) {
expr * len_indicator_pre = fvar_lenTester_map[fVar][i];
@ -7017,7 +7017,7 @@ namespace smt {
}
expr * valueAssert = gen_free_var_options(fVar, effectiveLenInd, effectiveLenIndiStr, valTester, valTesterValue);
TRACE("str", tout << "asserting more value tests for free variable " << mk_ismt2_pp(fVar, m) << std::endl;);
if (valueAssert != NULL) {
if (valueAssert != nullptr) {
assert_axiom(valueAssert);
}
}
@ -7262,20 +7262,20 @@ namespace smt {
simplify_parent(lhs, nn2_value);
}
expr * nn1EqConst = NULL;
expr * nn1EqConst = nullptr;
std::set<expr*> nn1EqUnrollFuncs;
get_eqc_allUnroll(lhs, nn1EqConst, nn1EqUnrollFuncs);
expr * nn2EqConst = NULL;
expr * nn2EqConst = nullptr;
std::set<expr*> nn2EqUnrollFuncs;
get_eqc_allUnroll(rhs, nn2EqConst, nn2EqUnrollFuncs);
if (nn2EqConst != NULL) {
if (nn2EqConst != nullptr) {
for (std::set<expr*>::iterator itor1 = nn1EqUnrollFuncs.begin(); itor1 != nn1EqUnrollFuncs.end(); itor1++) {
process_unroll_eq_const_str(*itor1, nn2EqConst);
}
}
if (nn1EqConst != NULL) {
if (nn1EqConst != nullptr) {
for (std::set<expr*>::iterator itor2 = nn2EqUnrollFuncs.begin(); itor2 != nn2EqUnrollFuncs.end(); itor2++) {
process_unroll_eq_const_str(*itor2, nn1EqConst);
}
@ -7917,13 +7917,13 @@ namespace smt {
if (aliasUnrollSet.find(unrollItor->first) != aliasUnrollSet.end()) {
continue;
}
expr * aRoot = NULL;
expr * aRoot = nullptr;
enode * e_currEqc = ctx.get_enode(unrollItor->first);
enode * e_curr = e_currEqc;
do {
app * curr = e_currEqc->get_owner();
if (u.re.is_unroll(curr)) {
if (aRoot == NULL) {
if (aRoot == nullptr) {
aRoot = curr;
}
aliasUnrollSet[curr] = aRoot;
@ -7948,11 +7948,11 @@ namespace smt {
if (aliasIndexMap.find(varItor->first) != aliasIndexMap.end()) {
continue;
}
expr * aRoot = NULL;
expr * aRoot = nullptr;
expr * curr = varItor->first;
do {
if (variable_set.find(curr) != variable_set.end()) {
if (aRoot == NULL) {
if (aRoot == nullptr) {
aRoot = curr;
} else {
aliasIndexMap[curr] = aRoot;
@ -8040,11 +8040,11 @@ namespace smt {
if (concats_eq_index_map.find(concatItor->first) != concats_eq_index_map.end()) {
continue;
}
expr * aRoot = NULL;
expr * aRoot = nullptr;
expr * curr = concatItor->first;
do {
if (u.str.is_concat(to_app(curr))) {
if (aRoot == NULL) {
if (aRoot == nullptr) {
aRoot = curr;
} else {
concats_eq_index_map[curr] = aRoot;
@ -8056,7 +8056,7 @@ namespace smt {
concatItor = concatMap.begin();
for(; concatItor != concatMap.end(); ++concatItor) {
expr * deAliasConcat = NULL;
expr * deAliasConcat = nullptr;
if (concats_eq_index_map.find(concatItor->first) != concats_eq_index_map.end()) {
deAliasConcat = concats_eq_index_map[concatItor->first];
} else {
@ -8194,15 +8194,15 @@ namespace smt {
mostLeftNodes.clear();
mostRightNodes.clear();
expr * mLConst = NULL;
expr * mRConst = NULL;
expr * mLConst = nullptr;
expr * mRConst = nullptr;
for (std::map<expr*, int>::iterator itor1 = itor->second.begin(); itor1 != itor->second.end(); itor1++) {
expr * concatNode = itor1->first;
expr * mLNode = getMostLeftNodeInConcat(concatNode);
zstring strval;
if (u.str.is_string(to_app(mLNode), strval)) {
if (mLConst == NULL && strval.empty()) {
if (mLConst == nullptr && strval.empty()) {
mLConst = mLNode;
}
} else {
@ -8211,7 +8211,7 @@ namespace smt {
expr * mRNode = getMostRightNodeInConcat(concatNode);
if (u.str.is_string(to_app(mRNode), strval)) {
if (mRConst == NULL && strval.empty()) {
if (mRConst == nullptr && strval.empty()) {
mRConst = mRNode;
}
} else {
@ -8219,7 +8219,7 @@ namespace smt {
}
}
if (mLConst != NULL) {
if (mLConst != nullptr) {
// -------------------------------------------------------------------------------------
// The left most variable in a concat is constrained by a constant string in eqc concat
// -------------------------------------------------------------------------------------
@ -8273,7 +8273,7 @@ namespace smt {
}
}
if (mRConst != NULL) {
if (mRConst != nullptr) {
for (std::map<expr*, expr*>::iterator itor1 = mostRightNodes.begin();
itor1 != mostRightNodes.end(); itor1++) {
expr * deVar = get_alias_index_ast(aliasIndexMap, itor1->first);
@ -8952,7 +8952,7 @@ namespace smt {
// -----------------------------------------------------------
std::map<expr*, std::set<expr*> > fv_unrolls_map;
std::set<expr*> tmpSet;
expr * constValue = NULL;
expr * constValue = nullptr;
for (std::map<expr*, int>::iterator fvIt2 = freeVar_map.begin(); fvIt2 != freeVar_map.end(); fvIt2++) {
expr * var = fvIt2->first;
tmpSet.clear();
@ -9036,7 +9036,7 @@ namespace smt {
// Assign free variables
std::set<expr*> fSimpUnroll;
constValue = NULL;
constValue = nullptr;
{
TRACE("str", tout << "free var map (#" << freeVar_map.size() << "):" << std::endl;
@ -9074,8 +9074,8 @@ namespace smt {
continue;
}
*/
expr * toAssert = gen_len_val_options_for_free_var(freeVar, NULL, "");
if (toAssert != NULL) {
expr * toAssert = gen_len_val_options_for_free_var(freeVar, nullptr, "");
if (toAssert != nullptr) {
assert_axiom(toAssert);
}
}
@ -9095,7 +9095,7 @@ namespace smt {
gen_assign_unroll_reg(fv_unrolls_map[var]);
} else {
expr * toAssert = gen_assign_unroll_Str2Reg(var, fSimpUnroll);
if (toAssert != NULL) {
if (toAssert != nullptr) {
assert_axiom(toAssert);
}
}
@ -9381,7 +9381,7 @@ namespace smt {
}
if (valTesterValueStr == "more") {
expr * valTester = NULL;
expr * valTester = nullptr;
if (i + 1 < testerTotal) {
valTester = fvar_valueTester_map[freeVar][len][i + 1].second;
refresh_theory_var(valTester);
@ -9394,7 +9394,7 @@ namespace smt {
return gen_val_options(freeVar, len_indicator, valTester, len_valueStr, i + 1);
}
return NULL;
return nullptr;
}
}
@ -9627,14 +9627,14 @@ namespace smt {
int lcm = 1;
int coreValueCount = 0;
expr * oneUnroll = NULL;
expr * oneUnroll = nullptr;
zstring oneCoreStr("");
for (std::set<expr*>::iterator itor = unrolls.begin(); itor != unrolls.end(); itor++) {
expr * str2RegFunc = to_app(*itor)->get_arg(0);
expr * coreVal = to_app(str2RegFunc)->get_arg(0);
zstring coreStr;
u.str.is_string(coreVal, coreStr);
if (oneUnroll == NULL) {
if (oneUnroll == nullptr) {
oneUnroll = *itor;
oneCoreStr = coreStr;
}
@ -10060,7 +10060,7 @@ namespace smt {
TRACE("str", tout << "invoked with previousLenTester info matching top of stack" << std::endl;);
} else {
TRACE("str", tout << "WARNING: unexpected reordering of length testers!" << std::endl;);
UNREACHABLE(); return NULL;
UNREACHABLE(); return nullptr;
}
} else {
u.str.is_string(lastTesterValue, lastTesterConstant);
@ -10076,7 +10076,7 @@ namespace smt {
}
TRACE("str", tout << "last bounds are [" << lastBounds.lowerBound << " | " << lastBounds.midPoint << " | " << lastBounds.upperBound << "]!" << lastBounds.windowSize << std::endl;);
binary_search_info newBounds;
expr * newTester = 0;
expr * newTester = nullptr;
if (lastTesterConstant == "more") {
// special case: if the midpoint, upper bound, and window size are all equal,
// we double the window size and adjust the bounds
@ -10144,7 +10144,7 @@ namespace smt {
return axiom;
}
// length is fixed
expr * valueAssert = gen_free_var_options(freeVar, lastTester, lastTesterConstant, NULL, zstring(""));
expr * valueAssert = gen_free_var_options(freeVar, lastTester, lastTesterConstant, nullptr, zstring(""));
return valueAssert;
}
} else {
@ -10254,7 +10254,7 @@ namespace smt {
} else {
TRACE("str", tout << "found previous in-scope length assertions" << std::endl;);
expr * effectiveLenInd = NULL;
expr * effectiveLenInd = nullptr;
zstring effectiveLenIndiStr("");
int lenTesterCount = (int) fvar_lenTester_map[freeVar].size();
@ -10355,7 +10355,7 @@ namespace smt {
} else {
TRACE("str", tout << "length is fixed; generating models for free var" << std::endl;);
// length is fixed
expr * valueAssert = gen_free_var_options(freeVar, effectiveLenInd, effectiveLenIndiStr, NULL, zstring(""));
expr * valueAssert = gen_free_var_options(freeVar, effectiveLenInd, effectiveLenIndiStr, nullptr, zstring(""));
return valueAssert;
}
} // fVarLenCountMap.find(...)
@ -10409,7 +10409,7 @@ namespace smt {
std::set<expr*> eqVarSet;
get_var_in_eqc(freeVar, eqVarSet);
bool duplicated = false;
expr * dupVar = NULL;
expr * dupVar = nullptr;
for (std::set<expr*>::iterator itorEqv = eqVarSet.begin(); itorEqv != eqVarSet.end(); itorEqv++) {
if (eqcRepSet.find(*itorEqv) != eqcRepSet.end()) {
duplicated = true;
@ -10417,7 +10417,7 @@ namespace smt {
break;
}
}
if (duplicated && dupVar != NULL) {
if (duplicated && dupVar != nullptr) {
TRACE("str", tout << "Duplicated free variable found:" << mk_pp(freeVar, get_manager())
<< " = " << mk_ismt2_pp(dupVar, get_manager()) << " (SKIP)" << std::endl;);
continue;
@ -10465,10 +10465,10 @@ namespace smt {
for(std::set<expr*>::iterator itor1 = leafVarSet.begin();
itor1 != leafVarSet.end(); ++itor1) {
expr * toAssert = gen_len_val_options_for_free_var(*itor1, NULL, "");
expr * toAssert = gen_len_val_options_for_free_var(*itor1, nullptr, "");
// gen_len_val_options_for_free_var() can legally return NULL,
// as methods that it calls may assert their own axioms instead.
if (toAssert != NULL) {
if (toAssert != nullptr) {
assert_axiom(toAssert);
}
}
@ -10477,9 +10477,9 @@ namespace smt {
mItor != aloneVars.end(); ++mItor) {
std::set<expr*>::iterator itor2 = mItor->second.begin();
for(; itor2 != mItor->second.end(); ++itor2) {
expr * toAssert = gen_len_val_options_for_free_var(*itor2, NULL, "");
expr * toAssert = gen_len_val_options_for_free_var(*itor2, nullptr, "");
// same deal with returning a NULL axiom here
if(toAssert != NULL) {
if(toAssert != nullptr) {
assert_axiom(toAssert);
}
}
@ -10491,7 +10491,7 @@ namespace smt {
* and constant string in eqc of node n
*/
void theory_str::get_eqc_allUnroll(expr * n, expr * &constStr, std::set<expr*> & unrollFuncSet) {
constStr = NULL;
constStr = nullptr;
unrollFuncSet.clear();
expr * curr = n;
@ -10509,7 +10509,7 @@ namespace smt {
// Collect simple Unroll functions (whose core is Str2Reg) and constant strings in the EQC of n.
void theory_str::get_eqc_simpleUnroll(expr * n, expr * &constStr, std::set<expr*> & unrollFuncSet) {
constStr = NULL;
constStr = nullptr;
unrollFuncSet.clear();
expr * curr = n;
@ -10556,7 +10556,7 @@ namespace smt {
app * a0_conststr = mk_value_helper(to_app(a0));
app * a1_conststr = mk_value_helper(to_app(a1));
if (a0_conststr != NULL && a1_conststr != NULL) {
if (a0_conststr != nullptr && a1_conststr != nullptr) {
zstring a0_s, a1_s;
u.str.is_string(a0_conststr, a0_s);
u.str.is_string(a1_conststr, a1_s);
@ -10571,7 +10571,7 @@ namespace smt {
if (hasEqc) {
return to_app(n_eqc);
} else {
return NULL;
return nullptr;
}
}
@ -10586,7 +10586,7 @@ namespace smt {
SASSERT(get_context().e_internalized(owner));
app * val = mk_value_helper(owner);
if (val != NULL) {
if (val != nullptr) {
return alloc(expr_wrapper_proc, val);
} else {
TRACE("str", tout << "WARNING: failed to find a concrete value, falling back" << std::endl;);

View file

@ -66,13 +66,13 @@ public:
return u.str.mk_string(sym);
}
}
sort* seq = 0;
sort* seq = nullptr;
if (u.is_re(s, seq)) {
expr* v0 = get_fresh_value(seq);
return u.re.mk_to_re(v0);
}
TRACE("t_str", tout << "unexpected sort in get_fresh_value(): " << mk_pp(s, m_manager) << std::endl;);
UNREACHABLE(); return NULL;
UNREACHABLE(); return nullptr;
}
void register_value(expr * n) override { /* Ignore */ }
};
@ -87,7 +87,7 @@ public:
return value;
} else {
TRACE("t_str", tout << "WARNING: lookup miss in contain_pair_bool_map!" << std::endl;);
return NULL;
return nullptr;
}
}

View file

@ -242,7 +242,7 @@ namespace smt {
justification * why_is_diseq(th_var v1, th_var v2) override {
UNREACHABLE();
return 0;
return nullptr;
}
void reset_eh() override;

View file

@ -70,7 +70,7 @@ namespace smt {
m_lra(false),
m_non_utvpi_exprs(false),
m_test(m),
m_factory(0) {
m_factory(nullptr) {
}
template<typename Ext>
@ -106,7 +106,7 @@ namespace smt {
template<typename Ext>
theory_var theory_utvpi<Ext>::mk_var(expr* n) {
context & ctx = get_context();
enode* e = 0;
enode* e = nullptr;
th_var v = null_theory_var;
m_lia |= a.is_int(n);
m_lra |= a.is_real(n);
@ -239,7 +239,7 @@ namespace smt {
ctx.mk_justification(
ext_theory_conflict_justification(
get_id(), ctx.get_region(),
lits.size(), lits.c_ptr(), 0, 0, params.size(), params.c_ptr())));
lits.size(), lits.c_ptr(), 0, nullptr, params.size(), params.c_ptr())));
m_nc_functor.reset();
}

View file

@ -287,7 +287,7 @@ namespace smt {
ctx.set_conflict(
ctx.mk_justification(
ext_theory_conflict_justification(get_id(), ctx.get_region(), lits.size(), lits.c_ptr(), 0, 0, 0, 0)));
ext_theory_conflict_justification(get_id(), ctx.get_region(), lits.size(), lits.c_ptr(), 0, nullptr, 0, nullptr)));
}
bool theory_wmaxsat::max_unassigned_is_blocked() {
@ -337,7 +337,7 @@ namespace smt {
region& r = ctx.get_region();
ctx.assign(lit, ctx.mk_justification(
ext_theory_propagation_justification(
get_id(), r, lits.size(), lits.c_ptr(), 0, 0, lit, 0, 0)));
get_id(), r, lits.size(), lits.c_ptr(), 0, nullptr, lit, 0, nullptr)));
}

View file

@ -96,7 +96,7 @@ namespace smt {
}
void reset_local();
void reset_eh() override;
theory * mk_fresh(context * new_ctx) override { return 0; }
theory * mk_fresh(context * new_ctx) override { return nullptr; }
bool internalize_atom(app * atom, bool gate_ctx) override { return false; }
bool internalize_term(app * term) override { return false; }
void new_eq_eh(theory_var v1, theory_var v2) override { }

View file

@ -35,7 +35,7 @@ namespace smt {
}
void watch_list::expand() {
if (m_data == 0) {
if (m_data == nullptr) {
unsigned size = DEFAULT_WATCH_LIST_SIZE + HEADER_SIZE;
unsigned * mem = reinterpret_cast<unsigned*>(alloc_svect(char, size));
#ifdef _AMD64_

View file

@ -83,10 +83,10 @@ namespace smt {
public:
watch_list():
m_data(0) {
m_data(nullptr) {
}
watch_list(watch_list && other) : m_data(0) {
watch_list(watch_list && other) : m_data(nullptr) {
std::swap(m_data, other.m_data);
}
@ -115,7 +115,7 @@ namespace smt {
void reset_and_release_memory() {
destroy();
m_data = 0;
m_data = nullptr;
}
clause_iterator begin_clause() {
@ -155,7 +155,7 @@ namespace smt {
}
void insert_clause(clause * c) {
if (m_data == 0 || end_cls_core() + sizeof(clause *) >= begin_lits_core()) {
if (m_data == nullptr || end_cls_core() + sizeof(clause *) >= begin_lits_core()) {
expand();
}
*(reinterpret_cast<clause **>(m_data + end_cls_core())) = c;
@ -163,7 +163,7 @@ namespace smt {
}
void insert_literal(literal const & l) {
if (m_data == 0 || begin_lits_core() <= end_cls_core() + sizeof(literal)) {
if (m_data == nullptr || begin_lits_core() <= end_cls_core() + sizeof(literal)) {
expand();
}
SASSERT(begin_lits_core() >= sizeof(literal));