3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-29 17:38:45 +00:00

use ref-vector for shared occurrences to avoid hash-table overhead

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2019-01-11 13:43:39 -08:00
parent f8f3549c1c
commit 9bd4050e0c
3 changed files with 17 additions and 34 deletions

View file

@ -53,7 +53,7 @@ class shared_occs {
bool m_track_atomic;
bool m_visit_quantifiers;
bool m_visit_patterns;
obj_hashtable<expr> m_shared;
expr_ref_vector m_shared;
typedef std::pair<expr*, unsigned> frame;
svector<frame> m_stack;
bool process(expr * t, shared_occs_mark & visited);
@ -64,15 +64,14 @@ public:
m(_m),
m_track_atomic(track_atomic),
m_visit_quantifiers(visit_quantifiers),
m_visit_patterns(visit_patterns) {
m_visit_patterns(visit_patterns),
m_shared(m) {
}
~shared_occs();
void operator()(expr * t);
void operator()(expr * t, shared_occs_mark & visited);
bool is_shared(expr * t) const { return m_shared.contains(t); }
unsigned num_shared() const { return m_shared.size(); }
iterator begin_shared() const { return m_shared.begin(); }
iterator end_shared() const { return m_shared.end(); }
bool is_shared(expr * t) const { return m_shared.get(t->get_id(), nullptr) != nullptr; }
unsigned num_shared() const;
void reset();
void cleanup();
void display(std::ostream & out, ast_manager & mgr) const;