3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-03 13:55:47 +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

@ -132,7 +132,7 @@ public:
case PARAM_INT: m_int = other.get_int(); break;
case PARAM_AST: m_ast = other.get_ast(); break;
case PARAM_SYMBOL: m_symbol = other.m_symbol; break;
case PARAM_RATIONAL: m_rational = 0; std::swap(m_rational, other.m_rational); break;
case PARAM_RATIONAL: m_rational = nullptr; std::swap(m_rational, other.m_rational); break;
case PARAM_DOUBLE: m_dval = other.m_dval; break;
case PARAM_EXTERNAL: m_ext_id = other.m_ext_id; break;
default:
@ -258,7 +258,7 @@ class decl_info {
public:
bool m_private_parameters;
decl_info(family_id family_id = null_family_id, decl_kind k = null_decl_kind,
unsigned num_parameters = 0, parameter const * parameters = 0, bool private_params = false);
unsigned num_parameters = 0, parameter const * parameters = nullptr, bool private_params = false);
decl_info(decl_info const& other);
~decl_info() {}
@ -342,17 +342,17 @@ class sort_info : public decl_info {
sort_size m_num_elements;
public:
sort_info(family_id family_id = null_family_id, decl_kind k = null_decl_kind,
unsigned num_parameters = 0, parameter const * parameters = 0, bool private_parameters = false):
unsigned num_parameters = 0, parameter const * parameters = nullptr, bool private_parameters = false):
decl_info(family_id, k, num_parameters, parameters, private_parameters) {
}
sort_info(family_id family_id, decl_kind k, uint64 num_elements,
unsigned num_parameters = 0, parameter const * parameters = 0, bool private_parameters = false):
unsigned num_parameters = 0, parameter const * parameters = nullptr, bool private_parameters = false):
decl_info(family_id, k, num_parameters, parameters, private_parameters), m_num_elements(num_elements) {
}
sort_info(family_id family_id, decl_kind k, sort_size const& num_elements,
unsigned num_parameters = 0, parameter const * parameters = 0, bool private_parameters = false):
unsigned num_parameters = 0, parameter const * parameters = nullptr, bool private_parameters = false):
decl_info(family_id, k, num_parameters, parameters, private_parameters), m_num_elements(num_elements) {
}
sort_info(sort_info const& other) : decl_info(other), m_num_elements(other.m_num_elements) {
@ -390,7 +390,7 @@ struct func_decl_info : public decl_info {
bool m_idempotent:1;
bool m_skolem:1;
func_decl_info(family_id family_id = null_family_id, decl_kind k = null_decl_kind, unsigned num_parameters = 0, parameter const * parameters = 0);
func_decl_info(family_id family_id = null_family_id, decl_kind k = null_decl_kind, unsigned num_parameters = 0, parameter const * parameters = nullptr);
~func_decl_info() {}
bool is_associative() const { return m_left_assoc && m_right_assoc; }
@ -565,12 +565,12 @@ public:
unsigned get_decl_id() const { SASSERT(get_id() >= c_first_decl_id); return get_id() - c_first_decl_id; }
symbol const & get_name() const { return m_name; }
decl_info * get_info() const { return m_info; }
family_id get_family_id() const { return m_info == 0 ? null_family_id : m_info->get_family_id(); }
decl_kind get_decl_kind() const { return m_info == 0 ? null_decl_kind : m_info->get_decl_kind(); }
unsigned get_num_parameters() const { return m_info == 0 ? 0 : m_info->get_num_parameters(); }
family_id get_family_id() const { return m_info == nullptr ? null_family_id : m_info->get_family_id(); }
decl_kind get_decl_kind() const { return m_info == nullptr ? null_decl_kind : m_info->get_decl_kind(); }
unsigned get_num_parameters() const { return m_info == nullptr ? 0 : m_info->get_num_parameters(); }
parameter const & get_parameter(unsigned idx) const { return m_info->get_parameter(idx); }
parameter const * get_parameters() const { return m_info == 0 ? 0 : m_info->get_parameters(); }
bool private_parameters() const { return m_info != 0 && m_info->private_parameters(); }
parameter const * get_parameters() const { return m_info == nullptr ? nullptr : m_info->get_parameters(); }
bool private_parameters() const { return m_info != nullptr && m_info->private_parameters(); }
};
// -----------------------------------
@ -587,8 +587,8 @@ class sort : public decl {
sort(symbol const & name, sort_info * info):decl(AST_SORT, name, info) {}
public:
sort_info * get_info() const { return static_cast<sort_info*>(m_info); }
bool is_infinite() const { return get_info() == 0 || get_info()->is_infinite(); }
bool is_very_big() const { return get_info() == 0 || get_info()->is_very_big(); }
bool is_infinite() const { return get_info() == nullptr || get_info()->is_infinite(); }
bool is_very_big() const { return get_info() == nullptr || get_info()->is_very_big(); }
bool is_sort_of(family_id fid, decl_kind k) const { return get_family_id() == fid && get_decl_kind() == k; }
sort_size const & get_num_elements() const { return get_info()->get_num_elements(); }
void set_num_elements(sort_size const& s) { get_info()->set_num_elements(s); }
@ -613,16 +613,16 @@ class func_decl : public decl {
func_decl(symbol const & name, unsigned arity, sort * const * domain, sort * range, func_decl_info * info);
public:
func_decl_info * get_info() const { return static_cast<func_decl_info*>(m_info); }
bool is_associative() const { return get_info() != 0 && get_info()->is_associative(); }
bool is_left_associative() const { return get_info() != 0 && get_info()->is_left_associative(); }
bool is_right_associative() const { return get_info() != 0 && get_info()->is_right_associative(); }
bool is_flat_associative() const { return get_info() != 0 && get_info()->is_flat_associative(); }
bool is_commutative() const { return get_info() != 0 && get_info()->is_commutative(); }
bool is_chainable() const { return get_info() != 0 && get_info()->is_chainable(); }
bool is_pairwise() const { return get_info() != 0 && get_info()->is_pairwise(); }
bool is_injective() const { return get_info() != 0 && get_info()->is_injective(); }
bool is_skolem() const { return get_info() != 0 && get_info()->is_skolem(); }
bool is_idempotent() const { return get_info() != 0 && get_info()->is_idempotent(); }
bool is_associative() const { return get_info() != nullptr && get_info()->is_associative(); }
bool is_left_associative() const { return get_info() != nullptr && get_info()->is_left_associative(); }
bool is_right_associative() const { return get_info() != nullptr && get_info()->is_right_associative(); }
bool is_flat_associative() const { return get_info() != nullptr && get_info()->is_flat_associative(); }
bool is_commutative() const { return get_info() != nullptr && get_info()->is_commutative(); }
bool is_chainable() const { return get_info() != nullptr && get_info()->is_chainable(); }
bool is_pairwise() const { return get_info() != nullptr && get_info()->is_pairwise(); }
bool is_injective() const { return get_info() != nullptr && get_info()->is_injective(); }
bool is_skolem() const { return get_info() != nullptr && get_info()->is_skolem(); }
bool is_idempotent() const { return get_info() != nullptr && get_info()->is_idempotent(); }
unsigned get_arity() const { return m_arity; }
sort * get_domain(unsigned idx) const { SASSERT(idx < get_arity()); return m_domain[idx]; }
sort * const * get_domain() const { return m_domain; }
@ -957,7 +957,7 @@ protected:
friend class ast_manager;
public:
decl_plugin():m_manager(0), m_family_id(null_family_id) {}
decl_plugin():m_manager(nullptr), m_family_id(null_family_id) {}
virtual ~decl_plugin() {}
virtual void finalize() {}
@ -1013,7 +1013,7 @@ public:
virtual void get_sort_names(svector<builtin_name> & sort_names, symbol const & logic = symbol()) {}
virtual expr * get_some_value(sort * s) { return 0; }
virtual expr * get_some_value(sort * s) { return nullptr; }
// Return true if the interpreted sort s does not depend on uninterpreted sorts.
// This may be the case, for example, for array and datatype sorts.
@ -1497,14 +1497,14 @@ protected:
public:
ast_manager(proof_gen_mode = PGM_DISABLED, char const * trace_file = 0, bool is_format_manager = false);
ast_manager(proof_gen_mode = PGM_DISABLED, char const * trace_file = nullptr, bool is_format_manager = false);
ast_manager(proof_gen_mode, std::fstream * trace_stream, bool is_format_manager = false);
ast_manager(ast_manager const & src, bool disable_proofs = false);
~ast_manager();
// propagate cancellation signal to decl_plugins
bool has_trace_stream() const { return m_trace_stream != 0; }
bool has_trace_stream() const { return m_trace_stream != nullptr; }
std::ostream & trace_stream() { SASSERT(has_trace_stream()); return *m_trace_stream; }
void enable_int_real_coercions(bool f) { m_int_real_coercions = f; }
@ -1523,7 +1523,7 @@ public:
// Equivalent to throw ast_exception(msg)
Z3_NORETURN void raise_exception(char const * msg);
bool is_format_manager() const { return m_format_manager == 0; }
bool is_format_manager() const { return m_format_manager == nullptr; }
ast_manager & get_format_manager() { return is_format_manager() ? *this : *m_format_manager; }
@ -1558,7 +1558,7 @@ public:
decl_plugin * get_plugin(family_id fid) const;
bool has_plugin(family_id fid) const { return get_plugin(fid) != 0; }
bool has_plugin(family_id fid) const { return get_plugin(fid) != nullptr; }
bool has_plugin(symbol const & s) const { return m_family_manager.has_family(s) && has_plugin(m_family_manager.get_family_id(s)); }
@ -1670,7 +1670,7 @@ private:
public:
sort * mk_uninterpreted_sort(symbol const & name, unsigned num_parameters, parameter const * parameters);
sort * mk_uninterpreted_sort(symbol const & name) { return mk_uninterpreted_sort(name, 0, 0); }
sort * mk_uninterpreted_sort(symbol const & name) { return mk_uninterpreted_sort(name, 0, nullptr); }
sort * mk_sort(symbol const & name, sort_info const & info) {
if (info.get_family_id() == null_family_id) {
@ -1681,7 +1681,7 @@ public:
}
}
sort * mk_sort(family_id fid, decl_kind k, unsigned num_parameters = 0, parameter const * parameters = 0);
sort * mk_sort(family_id fid, decl_kind k, unsigned num_parameters = 0, parameter const * parameters = nullptr);
sort * substitute(sort* s, unsigned n, sort * const * src, sort * const * dst);
@ -1700,13 +1700,13 @@ public:
bool is_fully_interp(sort * s) const;
func_decl * mk_func_decl(family_id fid, decl_kind k, unsigned num_parameters, parameter const * parameters,
unsigned arity, sort * const * domain, sort * range = 0);
unsigned arity, sort * const * domain, sort * range = nullptr);
func_decl * mk_func_decl(family_id fid, decl_kind k, unsigned num_parameters, parameter const * parameters,
unsigned num_args, expr * const * args, sort * range = 0);
unsigned num_args, expr * const * args, sort * range = nullptr);
app * mk_app(family_id fid, decl_kind k, unsigned num_parameters = 0, parameter const * parameters = 0,
unsigned num_args = 0, expr * const * args = 0, sort * range = 0);
app * mk_app(family_id fid, decl_kind k, unsigned num_parameters = 0, parameter const * parameters = nullptr,
unsigned num_args = 0, expr * const * args = nullptr, sort * range = nullptr);
app * mk_app(family_id fid, decl_kind k, unsigned num_args, expr * const * args);
@ -1716,7 +1716,7 @@ public:
app * mk_app(family_id fid, decl_kind k, expr * arg1, expr * arg2, expr * arg3);
app * mk_const(family_id fid, decl_kind k) { return mk_app(fid, k, 0, static_cast<expr * const *>(0)); }
app * mk_const(family_id fid, decl_kind k) { return mk_app(fid, k, 0, static_cast<expr * const *>(nullptr)); }
private:
func_decl * mk_func_decl(symbol const & name, unsigned arity, sort * const * domain, sort * range,
func_decl_info * info);
@ -1727,13 +1727,13 @@ private:
public:
func_decl * mk_func_decl(symbol const & name, unsigned arity, sort * const * domain, sort * range) {
return mk_func_decl(name, arity, domain, range, static_cast<func_decl_info *>(0));
return mk_func_decl(name, arity, domain, range, static_cast<func_decl_info *>(nullptr));
}
func_decl * mk_func_decl(symbol const & name, unsigned arity, sort * const * domain, sort * range,
func_decl_info const & info) {
if (info.is_null()) {
return mk_func_decl(name, arity, domain, range, static_cast<func_decl_info *>(0));
return mk_func_decl(name, arity, domain, range, static_cast<func_decl_info *>(nullptr));
}
else {
return mk_func_decl(name, arity, domain, range, & const_cast<func_decl_info&>(info));
@ -1746,11 +1746,11 @@ public:
}
func_decl * mk_const_decl(symbol const & name, sort * s) {
return mk_func_decl(name, static_cast<unsigned>(0), 0, s);
return mk_func_decl(name, static_cast<unsigned>(0), nullptr, s);
}
func_decl * mk_const_decl(symbol const & name, sort * s, func_decl_info const & info) {
return mk_func_decl(name, static_cast<unsigned>(0), 0, s, info);
return mk_func_decl(name, static_cast<unsigned>(0), nullptr, s, info);
}
func_decl * mk_func_decl(symbol const & name, sort * domain, sort * range, func_decl_info const & info) {
@ -1804,7 +1804,7 @@ public:
app * mk_const(func_decl * decl) {
SASSERT(decl->get_arity() == 0);
return mk_app(decl, static_cast<unsigned>(0), static_cast<expr**>(0));
return mk_app(decl, static_cast<unsigned>(0), static_cast<expr**>(nullptr));
}
app * mk_const(symbol const & name, sort * s) {
@ -1825,9 +1825,9 @@ public:
return mk_fresh_func_decl(symbol(prefix), symbol::null, arity, domain, range);
}
app * mk_fresh_const(char const * prefix, sort * s) { return mk_const(mk_fresh_func_decl(prefix, 0, 0, s)); }
app * mk_fresh_const(char const * prefix, sort * s) { return mk_const(mk_fresh_func_decl(prefix, 0, nullptr, s)); }
symbol mk_fresh_var_name(char const * prefix = 0);
symbol mk_fresh_var_name(char const * prefix = nullptr);
var * mk_var(unsigned idx, sort * ty);
@ -1879,21 +1879,21 @@ public:
quantifier * mk_quantifier(bool forall, unsigned num_decls, sort * const * decl_sorts, symbol const * decl_names, expr * body,
int weight = 0, symbol const & qid = symbol::null, symbol const & skid = symbol::null,
unsigned num_patterns = 0, expr * const * patterns = 0,
unsigned num_no_patterns = 0, expr * const * no_patterns = 0);
unsigned num_patterns = 0, expr * const * patterns = nullptr,
unsigned num_no_patterns = 0, expr * const * no_patterns = nullptr);
quantifier * mk_forall(unsigned num_decls, sort * const * decl_sorts, symbol const * decl_names, expr * body,
int weight = 0, symbol const & qid = symbol::null, symbol const & skid = symbol::null,
unsigned num_patterns = 0, expr * const * patterns = 0,
unsigned num_no_patterns = 0, expr * const * no_patterns = 0) {
unsigned num_patterns = 0, expr * const * patterns = nullptr,
unsigned num_no_patterns = 0, expr * const * no_patterns = nullptr) {
return mk_quantifier(true, num_decls, decl_sorts, decl_names, body, weight, qid, skid, num_patterns, patterns,
num_no_patterns, no_patterns);
}
quantifier * mk_exists(unsigned num_decls, sort * const * decl_sorts, symbol const * decl_names, expr * body,
int weight = 0, symbol const & qid = symbol::null, symbol const & skid = symbol::null,
unsigned num_patterns = 0, expr * const * patterns = 0,
unsigned num_no_patterns = 0, expr * const * no_patterns = 0) {
unsigned num_patterns = 0, expr * const * patterns = nullptr,
unsigned num_no_patterns = 0, expr * const * no_patterns = nullptr) {
return mk_quantifier(false, num_decls, decl_sorts, decl_names, body, weight, qid, skid, num_patterns, patterns,
num_no_patterns, no_patterns);
}
@ -2057,12 +2057,12 @@ public:
func_decl* mk_and_decl() {
sort* domain[2] = { m_bool_sort, m_bool_sort };
return mk_func_decl(m_basic_family_id, OP_AND, 0, 0, 2, domain);
return mk_func_decl(m_basic_family_id, OP_AND, 0, nullptr, 2, domain);
}
func_decl* mk_not_decl() { return mk_func_decl(m_basic_family_id, OP_NOT, 0, 0, 1, &m_bool_sort); }
func_decl* mk_not_decl() { return mk_func_decl(m_basic_family_id, OP_NOT, 0, nullptr, 1, &m_bool_sort); }
func_decl* mk_or_decl() {
sort* domain[2] = { m_bool_sort, m_bool_sort };
return mk_func_decl(m_basic_family_id, OP_OR, 0, 0, 2, domain);
return mk_func_decl(m_basic_family_id, OP_OR, 0, nullptr, 2, domain);
}
// -----------------------------------
@ -2210,7 +2210,7 @@ public:
proof * mk_th_lemma(family_id tid,
expr * fact, unsigned num_proofs, proof * const * proofs,
unsigned num_params = 0, parameter const* params = 0);
unsigned num_params = 0, parameter const* params = nullptr);
protected:
bool check_nnf_proof_parents(unsigned num_proofs, proof * const * proofs) const;