3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-03 22:05:45 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2018-11-21 13:48:48 -08:00
parent 8590876d18
commit 0c1408b30e
5 changed files with 88 additions and 43 deletions

View file

@ -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]);
}
}
};