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

merge with master

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2018-03-25 14:57:01 -07:00
commit c513f3ca09
883 changed files with 13979 additions and 16480 deletions

View file

@ -30,13 +30,13 @@ class aig_lit {
friend class aig_ref;
aig * m_ref;
public:
aig_lit(aig * n = 0):m_ref(n) {}
aig_lit(aig * n = nullptr):m_ref(n) {}
aig_lit(aig_ref const & r):m_ref(static_cast<aig*>(r.m_ref)) {}
bool is_inverted() const { return (reinterpret_cast<size_t>(m_ref) & static_cast<size_t>(1)) == static_cast<size_t>(1); }
void invert() { m_ref = reinterpret_cast<aig*>(reinterpret_cast<size_t>(m_ref) ^ static_cast<size_t>(1)); }
aig * ptr() const { return reinterpret_cast<aig*>(reinterpret_cast<size_t>(m_ref) & ~static_cast<size_t>(1)); }
aig * ptr_non_inverted() const { SASSERT(!is_inverted()); return m_ref; }
bool is_null() const { return m_ref == 0; }
bool is_null() const { return m_ref == nullptr; }
friend bool operator==(aig_lit const & r1, aig_lit const & r2) { return r1.m_ref == r2.m_ref; }
friend bool operator!=(aig_lit const & r1, aig_lit const & r2) { return r1.m_ref != r2.m_ref; }
aig_lit & operator=(aig_lit const & r) { m_ref = r.m_ref; return *this; }
@ -151,7 +151,7 @@ struct aig_manager::imp {
m_num_aigs--;
if (is_var(n)) {
m_var_id_gen.recycle(n->m_id);
m_var2exprs.set(n->m_id, 0);
m_var2exprs.set(n->m_id, nullptr);
}
else {
m_table.erase(n);
@ -267,7 +267,7 @@ struct aig_manager::imp {
}
if (b == r) {
if (sign1) {
// subsitution
// substitution
// not (a and b) and r --> (not a) and r IF b == r
l = a;
l.invert();
@ -795,7 +795,7 @@ struct aig_manager::imp {
m_cache.resize(idx+1);
return false;
}
return m_cache.get(idx) != 0;
return m_cache.get(idx) != nullptr;
}
void cache_result(aig * n, expr * t) {
@ -958,14 +958,14 @@ struct aig_manager::imp {
}
unsigned idx = to_idx(t);
cache.reserve(idx+1);
if (cache.get(idx) != 0) {
if (cache.get(idx) != nullptr) {
todo.pop_back();
continue;
}
bool ok = true;
for (unsigned i = 0; i < 2; i++) {
aig * c = t->m_children[i].ptr();
if (!is_var(c) && cache.get(to_idx(c), 0) == 0) {
if (!is_var(c) && cache.get(to_idx(c), nullptr) == nullptr) {
todo.push_back(c);
ok = false;
}
@ -979,7 +979,7 @@ struct aig_manager::imp {
if (is_var(c))
args[i] = m.m_var2exprs.get(c->m_id);
else
args[i] = cache.get(to_idx(c), 0);
args[i] = cache.get(to_idx(c), nullptr);
if (!l.is_inverted())
args[i] = invert(args[i]);
}
@ -1007,16 +1007,16 @@ struct aig_manager::imp {
aig_lit n = roots.back();
roots.pop_back();
if (n.is_inverted()) {
g.assert_expr(invert(process_root(n.ptr())), 0, 0);
g.assert_expr(invert(process_root(n.ptr())), nullptr, nullptr);
continue;
}
aig * p = n.ptr();
if (m.is_ite(p)) {
g.assert_expr(process_root(p), 0, 0);
g.assert_expr(process_root(p), nullptr, nullptr);
continue;
}
if (is_var(p)) {
g.assert_expr(m.var2expr(p), 0, 0);
g.assert_expr(m.var2expr(p), nullptr, nullptr);
continue;
}
roots.push_back(left(p));
@ -1079,7 +1079,7 @@ struct aig_manager::imp {
bool visit(aig * p) {
if (is_var(p)) {
push_result(0);
push_result(nullptr);
return true;
}
if (is_cached(p))
@ -1652,8 +1652,8 @@ public:
aig_ref::aig_ref():
m_manager(0),
m_ref(0) {
m_manager(nullptr),
m_ref(nullptr) {
}
aig_ref::aig_ref(aig_manager & m, aig_lit const & l):
@ -1663,15 +1663,15 @@ aig_ref::aig_ref(aig_manager & m, aig_lit const & l):
}
aig_ref::~aig_ref() {
if (m_ref != 0) {
if (m_ref != nullptr) {
m_manager->m_imp->dec_ref(aig_lit(*this));
}
}
aig_ref & aig_ref::operator=(aig_ref const & r) {
if (r.m_ref != 0)
if (r.m_ref != nullptr)
r.m_manager->m_imp->inc_ref(aig_lit(r));
if (m_ref != 0)
if (m_ref != nullptr)
m_manager->m_imp->dec_ref(aig_lit(*this));
m_ref = r.m_ref;
m_manager = r.m_manager;

View file

@ -37,16 +37,16 @@ class aig_tactic : public tactic {
~mk_aig_manager() {
dealloc(m_owner.m_aig_manager);
m_owner.m_aig_manager = 0;
m_owner.m_aig_manager = nullptr;
}
};
public:
aig_tactic(params_ref const & p = params_ref()):m_aig_manager(0) {
aig_tactic(params_ref const & p = params_ref()):m_aig_manager(nullptr) {
updt_params(p);
}
virtual tactic * translate(ast_manager & m) {
tactic * translate(ast_manager & m) override {
aig_tactic * t = alloc(aig_tactic);
t->m_max_memory = m_max_memory;
t->m_aig_gate_encoding = m_aig_gate_encoding;
@ -54,13 +54,13 @@ public:
return t;
}
virtual void updt_params(params_ref const & p) {
void updt_params(params_ref const & p) override {
m_max_memory = megabytes_to_bytes(p.get_uint("max_memory", UINT_MAX));
m_aig_gate_encoding = p.get_bool("aig_default_gate_encoding", true);
m_aig_per_assertion = p.get_bool("aig_per_assertion", true);
}
virtual void collect_param_descrs(param_descrs & r) {
void collect_param_descrs(param_descrs & r) override {
insert_max_memory(r);
r.insert("aig_per_assertion", CPK_BOOL, "(default: true) process one assertion at a time.");
}
@ -77,7 +77,7 @@ public:
expr_ref new_f(g->m());
m_aig_manager->to_formula(r, new_f);
expr_dependency * ed = g->dep(i);
g->update(i, new_f, 0, ed);
g->update(i, new_f, nullptr, ed);
}
}
else {
@ -90,14 +90,14 @@ public:
SASSERT(g->is_well_sorted());
}
virtual void operator()(goal_ref const & g, goal_ref_buffer & result) {
void operator()(goal_ref const & g, goal_ref_buffer & result) override {
fail_if_proof_generation("aig", g);
operator()(g);
g->inc_depth();
result.push_back(g.get());
}
virtual void cleanup() {}
void cleanup() override {}
};