mirror of
https://github.com/Z3Prover/z3
synced 2025-08-22 11:07:51 +00:00
Use nullptr.
This commit is contained in:
parent
f01328c65f
commit
76eb7b9ede
625 changed files with 4639 additions and 4639 deletions
4
src/interp/iz3base.cpp
Executable file → Normal file
4
src/interp/iz3base.cpp
Executable file → Normal file
|
@ -272,7 +272,7 @@ bool iz3base::is_sat(const std::vector<ast> &q, ast &_proof, std::vector<ast> &v
|
|||
|
||||
for(unsigned i = 0; i < q.size(); i++)
|
||||
s.assert_expr(to_expr(q[i].raw()));
|
||||
lbool res = s.check_sat(0,0);
|
||||
lbool res = s.check_sat(0,nullptr);
|
||||
if (m().canceled()) {
|
||||
throw iz3_exception(Z3_CANCELED_MSG);
|
||||
}
|
||||
|
@ -293,7 +293,7 @@ bool iz3base::is_sat(const std::vector<ast> &q, ast &_proof, std::vector<ast> &v
|
|||
vars[i] = cook(r.get());
|
||||
}
|
||||
}
|
||||
solver = 0;
|
||||
solver = nullptr;
|
||||
return res != l_false;
|
||||
}
|
||||
|
||||
|
|
4
src/interp/iz3checker.cpp
Executable file → Normal file
4
src/interp/iz3checker.cpp
Executable file → Normal file
|
@ -98,7 +98,7 @@ struct iz3checker : iz3base {
|
|||
s->assert_expr(to_expr(itp[cs[j]].raw()));
|
||||
if(i != num-1)
|
||||
s->assert_expr(to_expr(mk_not(itp[i]).raw()));
|
||||
lbool result = s->check_sat(0,0);
|
||||
lbool result = s->check_sat(0,nullptr);
|
||||
if(result != l_false){
|
||||
err << "interpolant " << i << " is incorrect";
|
||||
|
||||
|
@ -110,7 +110,7 @@ struct iz3checker : iz3base {
|
|||
s->assert_expr(to_expr(cnsts[j].raw()));
|
||||
if(i != num-1)
|
||||
s->assert_expr(to_expr(mk_not(itp[i]).raw()));
|
||||
lbool result = s->check_sat(0,0);
|
||||
lbool result = s->check_sat(0,nullptr);
|
||||
if(result != l_false)
|
||||
err << "interpolant " << i << " is not implied by its downeard closurn";
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ namespace hash_space {
|
|||
Entry* next;
|
||||
Value val;
|
||||
|
||||
Entry(const Value &_val) : val(_val) {next = 0;}
|
||||
Entry(const Value &_val) : val(_val) {next = nullptr;}
|
||||
};
|
||||
|
||||
|
||||
|
@ -242,7 +242,7 @@ namespace hash_space {
|
|||
|
||||
public:
|
||||
|
||||
hashtable(size_t init_size) : buckets(init_size,(Entry *)0) {
|
||||
hashtable(size_t init_size) : buckets(init_size,(Entry *)nullptr) {
|
||||
entries = 0;
|
||||
}
|
||||
|
||||
|
@ -281,7 +281,7 @@ namespace hash_space {
|
|||
}
|
||||
|
||||
iterator end() {
|
||||
return iterator(0, this);
|
||||
return iterator(nullptr, this);
|
||||
}
|
||||
|
||||
const_iterator begin() const {
|
||||
|
@ -292,7 +292,7 @@ namespace hash_space {
|
|||
}
|
||||
|
||||
const_iterator end() const {
|
||||
return const_iterator(0, this);
|
||||
return const_iterator(nullptr, this);
|
||||
}
|
||||
|
||||
size_t get_bucket(const Value& val, size_t n) const {
|
||||
|
@ -318,7 +318,7 @@ namespace hash_space {
|
|||
if (key_eq_fun(get_key(ent->val), get_key(val)))
|
||||
return ent;
|
||||
|
||||
if(!ins) return 0;
|
||||
if(!ins) return nullptr;
|
||||
|
||||
Entry* tmp = new Entry(val);
|
||||
tmp->next = from;
|
||||
|
@ -336,7 +336,7 @@ namespace hash_space {
|
|||
if (key_eq_fun(get_key(ent->val), key))
|
||||
return ent;
|
||||
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const_iterator find(const Key& key) const {
|
||||
|
@ -381,7 +381,7 @@ namespace hash_space {
|
|||
if (new_size <= old_n) return;
|
||||
const size_t n = next_prime(new_size);
|
||||
if (n <= old_n) return;
|
||||
Table tmp(n, (Entry*)(0));
|
||||
Table tmp(n, (Entry*)nullptr);
|
||||
for (size_t i = 0; i < old_n; ++i) {
|
||||
Entry* ent = buckets[i];
|
||||
while (ent) {
|
||||
|
@ -398,12 +398,12 @@ namespace hash_space {
|
|||
void clear()
|
||||
{
|
||||
for (size_t i = 0; i < buckets.size(); ++i) {
|
||||
for (Entry* ent = buckets[i]; ent != 0;) {
|
||||
for (Entry* ent = buckets[i]; ent != nullptr;) {
|
||||
Entry* next = ent->next;
|
||||
delete ent;
|
||||
ent = next;
|
||||
}
|
||||
buckets[i] = 0;
|
||||
buckets[i] = nullptr;
|
||||
}
|
||||
entries = 0;
|
||||
}
|
||||
|
|
12
src/interp/iz3interp.cpp
Executable file → Normal file
12
src/interp/iz3interp.cpp
Executable file → Normal file
|
@ -171,7 +171,7 @@ struct frame_reducer {
|
|||
template<class T>
|
||||
struct killme {
|
||||
T *p;
|
||||
killme(){p = 0;}
|
||||
killme(){p = nullptr;}
|
||||
void set(T *_p) {p = _p;}
|
||||
~killme(){
|
||||
if(p)
|
||||
|
@ -205,7 +205,7 @@ public:
|
|||
const std::vector<int> &parents,
|
||||
std::vector<ast> &interps,
|
||||
const std::vector<ast> &theory,
|
||||
interpolation_options_struct *options = 0
|
||||
interpolation_options_struct *options = nullptr
|
||||
){
|
||||
#if 0
|
||||
test_secondary(cnsts,parents,interps);
|
||||
|
@ -229,7 +229,7 @@ public:
|
|||
parents_vec.clear();
|
||||
|
||||
// secondary prover no longer supported
|
||||
iz3secondary *sp = NULL;
|
||||
iz3secondary *sp = nullptr;
|
||||
|
||||
#define BINARY_INTERPOLATION
|
||||
#ifndef BINARY_INTERPOLATION
|
||||
|
@ -336,7 +336,7 @@ public:
|
|||
const std::vector<int> &parents,
|
||||
std::vector<ast> &interps,
|
||||
const std::vector<ast> &theory,
|
||||
interpolation_options_struct *options = 0
|
||||
interpolation_options_struct *options = nullptr
|
||||
){
|
||||
std::vector<std::vector<ast> > cnsts_vec(cnsts.size());
|
||||
for(unsigned i = 0; i < cnsts.size(); i++)
|
||||
|
@ -350,7 +350,7 @@ public:
|
|||
const std::vector<ast> &_cnsts,
|
||||
const ast &tree,
|
||||
std::vector<ast> &interps,
|
||||
interpolation_options_struct *options = 0
|
||||
interpolation_options_struct *options = nullptr
|
||||
){
|
||||
std::vector<int> pos_map;
|
||||
|
||||
|
@ -524,7 +524,7 @@ lbool iz3interpolate(ast_manager &_m_manager,
|
|||
std::vector<iz3mgr::ast> _cnsts;
|
||||
itp.assert_conjuncts(s,_cnsts,_tree);
|
||||
profiling::timer_start("solving");
|
||||
lbool res = s.check_sat(0,0);
|
||||
lbool res = s.check_sat(0,nullptr);
|
||||
profiling::timer_stop("solving");
|
||||
if(res == l_false){
|
||||
ast *proof = s.get_proof();
|
||||
|
|
|
@ -78,7 +78,7 @@ void iz3interpolate(ast_manager &_m_manager,
|
|||
const ::vector<int> &parents,
|
||||
ptr_vector<ast> &interps,
|
||||
const ptr_vector<ast> &theory,
|
||||
interpolation_options_struct * options = 0);
|
||||
interpolation_options_struct * options = nullptr);
|
||||
|
||||
/* Same as above, but each constraint is a vector of formulas. */
|
||||
|
||||
|
@ -88,7 +88,7 @@ void iz3interpolate(ast_manager &_m_manager,
|
|||
const ::vector<int> &parents,
|
||||
ptr_vector<ast> &interps,
|
||||
const ptr_vector<ast> &theory,
|
||||
interpolation_options_struct * options = 0);
|
||||
interpolation_options_struct * options = nullptr);
|
||||
|
||||
/* Compute an interpolant from a proof. This version uses the ast
|
||||
representation, for compatibility with the new API. Here, cnsts is
|
||||
|
|
14
src/interp/iz3mgr.cpp
Executable file → Normal file
14
src/interp/iz3mgr.cpp
Executable file → Normal file
|
@ -102,7 +102,7 @@ iz3mgr::ast iz3mgr::make(opr op, int n, raw_ast **args){
|
|||
}
|
||||
|
||||
iz3mgr::ast iz3mgr::mki(family_id fid, decl_kind dk, int n, raw_ast **args){
|
||||
return cook(m().mk_app(fid, dk, 0, 0, n, (expr **)args));
|
||||
return cook(m().mk_app(fid, dk, 0, nullptr, n, (expr **)args));
|
||||
}
|
||||
|
||||
iz3mgr::ast iz3mgr::make(opr op, const std::vector<ast> &args){
|
||||
|
@ -111,11 +111,11 @@ iz3mgr::ast iz3mgr::make(opr op, const std::vector<ast> &args){
|
|||
a.resize(args.size());
|
||||
for(unsigned i = 0; i < args.size(); i++)
|
||||
a[i] = args[i].raw();
|
||||
return make(op,args.size(), args.size() ? &a[0] : 0);
|
||||
return make(op,args.size(), args.size() ? &a[0] : nullptr);
|
||||
}
|
||||
|
||||
iz3mgr::ast iz3mgr::make(opr op){
|
||||
return make(op,0,0);
|
||||
return make(op,0,nullptr);
|
||||
}
|
||||
|
||||
iz3mgr::ast iz3mgr::make(opr op, const ast &arg0){
|
||||
|
@ -148,11 +148,11 @@ iz3mgr::ast iz3mgr::make(symb sym, const std::vector<ast> &args){
|
|||
a.resize(args.size());
|
||||
for(unsigned i = 0; i < args.size(); i++)
|
||||
a[i] = args[i].raw();
|
||||
return make(sym,args.size(), args.size() ? &a[0] : 0);
|
||||
return make(sym,args.size(), args.size() ? &a[0] : nullptr);
|
||||
}
|
||||
|
||||
iz3mgr::ast iz3mgr::make(symb sym){
|
||||
return make(sym,0,0);
|
||||
return make(sym,0,nullptr);
|
||||
}
|
||||
|
||||
iz3mgr::ast iz3mgr::make(symb sym, const ast &arg0){
|
||||
|
@ -201,8 +201,8 @@ iz3mgr::ast iz3mgr::make_quant(opr op, const std::vector<ast> &bvs, ast &body){
|
|||
0,
|
||||
symbol("itp"),
|
||||
symbol(),
|
||||
0, 0,
|
||||
0, 0
|
||||
0, nullptr,
|
||||
0, nullptr
|
||||
);
|
||||
return cook(result.get());
|
||||
}
|
||||
|
|
6
src/interp/iz3mgr.h
Executable file → Normal file
6
src/interp/iz3mgr.h
Executable file → Normal file
|
@ -63,7 +63,7 @@ public:
|
|||
raw_ast * const &raw() const {return _ast;}
|
||||
ast_i(raw_ast *a){_ast = a;}
|
||||
|
||||
ast_i(){_ast = 0;}
|
||||
ast_i(){_ast = nullptr;}
|
||||
bool eq(const ast_i &other) const {
|
||||
return _ast == other._ast;
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ public:
|
|||
m->inc_ref(a);
|
||||
}
|
||||
|
||||
ast_r() {_m = 0;}
|
||||
ast_r() {_m = nullptr;}
|
||||
|
||||
ast_r(const ast_r &other) : ast_i(other) {
|
||||
_m = other._m;
|
||||
|
@ -287,7 +287,7 @@ class iz3mgr {
|
|||
|
||||
symb sym(const ast& t){
|
||||
raw_ast *_ast = t.raw();
|
||||
return is_app(_ast) ? to_app(_ast)->get_decl() : 0;
|
||||
return is_app(_ast) ? to_app(_ast)->get_decl() : nullptr;
|
||||
}
|
||||
|
||||
std::string string_of_symbol(symb s){
|
||||
|
|
2
src/interp/iz3profiling.cpp
Executable file → Normal file
2
src/interp/iz3profiling.cpp
Executable file → Normal file
|
@ -75,7 +75,7 @@ namespace profiling {
|
|||
|
||||
node::node(){
|
||||
time = 0;
|
||||
parent = 0;
|
||||
parent = nullptr;
|
||||
}
|
||||
|
||||
struct node *current;
|
||||
|
|
2
src/interp/iz3proof.h
Executable file → Normal file
2
src/interp/iz3proof.h
Executable file → Normal file
|
@ -210,7 +210,7 @@ class iz3proof {
|
|||
}
|
||||
|
||||
/** Default constructor */
|
||||
iz3proof(){pv = 0;}
|
||||
iz3proof(){pv = nullptr;}
|
||||
|
||||
|
||||
protected:
|
||||
|
|
2
src/interp/iz3translate.cpp
Executable file → Normal file
2
src/interp/iz3translate.cpp
Executable file → Normal file
|
@ -2188,7 +2188,7 @@ void iz3translation_full_conc_symbols_out_of_scope(iz3translation_full *p, int i
|
|||
|
||||
struct stdio_fixer {
|
||||
stdio_fixer(){
|
||||
std::cout.rdbuf()->pubsetbuf(0,0);
|
||||
std::cout.rdbuf()->pubsetbuf(nullptr,0);
|
||||
}
|
||||
|
||||
} my_stdio_fixer;
|
||||
|
|
12
src/interp/iz3translate_direct.cpp
Executable file → Normal file
12
src/interp/iz3translate_direct.cpp
Executable file → Normal file
|
@ -1124,7 +1124,7 @@ public:
|
|||
for(unsigned i = 0; i < la.size(); i++)
|
||||
lits.push_back(mk_not(from_ast(conc(la[i]))));
|
||||
// lits.push_back(from_ast(conc(proof)));
|
||||
Iproof::node res =fix_lemma(lits,hyps, lemma_nll ? nll : 0);
|
||||
Iproof::node res =fix_lemma(lits,hyps, lemma_nll ? nll : nullptr);
|
||||
for(unsigned i = 0; i < la.size(); i++){
|
||||
Iproof::node q = translate_main(la[i],nll,false);
|
||||
ast pnode = from_ast(conc(la[i]));
|
||||
|
@ -1200,7 +1200,7 @@ public:
|
|||
Iproof::node res = iproof->make_contra(ipf,lits);
|
||||
|
||||
for(unsigned i = 0; i < la.size(); i++){
|
||||
Iproof::node q = translate_main(la[i],0,false);
|
||||
Iproof::node q = translate_main(la[i],nullptr,false);
|
||||
ast pnode = from_ast(conc(la[i]));
|
||||
assert(is_local(pnode) || equivs.find(pnode) != equivs.end());
|
||||
Iproof::node neg = res;
|
||||
|
@ -1381,8 +1381,8 @@ public:
|
|||
|
||||
non_local_lits *find_nll(ResolventAppSet &proofs){
|
||||
if(proofs.empty())
|
||||
return (non_local_lits *)0;
|
||||
std::pair<non_local_lits,non_local_lits *> foo(non_local_lits(proofs),(non_local_lits *)0);
|
||||
return (non_local_lits *)nullptr;
|
||||
std::pair<non_local_lits,non_local_lits *> foo(non_local_lits(proofs),(non_local_lits *)nullptr);
|
||||
std::pair<hash_map<non_local_lits, non_local_lits *>::iterator,bool> bar =
|
||||
non_local_lits_unique.insert(foo);
|
||||
non_local_lits *&res = bar.first->second;
|
||||
|
@ -1392,7 +1392,7 @@ public:
|
|||
}
|
||||
|
||||
Z3_resolvent *find_resolvent(ast proof, bool unit, ast pivot){
|
||||
std::pair<Z3_resolvent,Z3_resolvent *> foo(Z3_resolvent(proof,unit,pivot),(Z3_resolvent *)0);
|
||||
std::pair<Z3_resolvent,Z3_resolvent *> foo(Z3_resolvent(proof,unit,pivot),(Z3_resolvent *)nullptr);
|
||||
std::pair<hash_map<Z3_resolvent, Z3_resolvent *>::iterator,bool> bar =
|
||||
Z3_resolvent_unique.insert(foo);
|
||||
Z3_resolvent *&res = bar.first->second;
|
||||
|
@ -1613,7 +1613,7 @@ public:
|
|||
|
||||
Iproof::node translate(ast proof, Iproof &dst) override {
|
||||
iproof = &dst;
|
||||
Iproof::node Ipf = translate_main(proof,0); // builds result in dst
|
||||
Iproof::node Ipf = translate_main(proof,nullptr); // builds result in dst
|
||||
return Ipf;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue