mirror of
https://github.com/Z3Prover/z3
synced 2025-05-03 22:05:45 +00:00
parent
8590876d18
commit
0c1408b30e
5 changed files with 88 additions and 43 deletions
|
@ -962,7 +962,8 @@ class ast_translation;
|
|||
|
||||
class ast_table : public chashtable<ast*, obj_ptr_hash<ast>, ast_eq_proc> {
|
||||
public:
|
||||
void erase(ast * n);
|
||||
void push_erase(ast * n);
|
||||
ast* pop_erase();
|
||||
};
|
||||
|
||||
// -----------------------------------
|
||||
|
@ -2297,17 +2298,17 @@ protected:
|
|||
bool check_nnf_proof_parents(unsigned num_proofs, proof * const * proofs) const;
|
||||
|
||||
private:
|
||||
void dec_ref(ptr_buffer<ast> & worklist, ast * n) {
|
||||
void push_dec_ref(ast * n) {
|
||||
n->dec_ref();
|
||||
if (n->get_ref_count() == 0) {
|
||||
worklist.push_back(n);
|
||||
m_ast_table.push_erase(n);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void dec_array_ref(ptr_buffer<ast> & worklist, unsigned sz, T * const * a) {
|
||||
void push_dec_array_ref(unsigned sz, T * const * a) {
|
||||
for(unsigned i = 0; i < sz; i++) {
|
||||
dec_ref(worklist, a[i]);
|
||||
push_dec_ref(a[i]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue