summaryrefslogtreecommitdiff
path: root/src/theory/bv/slicer.cpp
diff options
context:
space:
mode:
authorLiana Hadarean <lianahady@gmail.com>2013-02-05 00:49:39 -0500
committerLiana Hadarean <lianahady@gmail.com>2013-02-05 00:49:39 -0500
commit76805f8b4690093888bbb3d68e4d5c2c6ff221de (patch)
tree4c650ccb0b6c44035daaafdfbd3026e117eb9d4b /src/theory/bv/slicer.cpp
parent8aaee8d5acce9887329f3e5a6fdeb425e428ec79 (diff)
Added path compression and caching for getBaseDecomposition.
Diffstat (limited to 'src/theory/bv/slicer.cpp')
-rw-r--r--src/theory/bv/slicer.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/theory/bv/slicer.cpp b/src/theory/bv/slicer.cpp
index 87295e8f6..f41612df3 100644
--- a/src/theory/bv/slicer.cpp
+++ b/src/theory/bv/slicer.cpp
@@ -220,10 +220,13 @@ void UnionFind::merge(TermId t1, TermId t2) {
d_statistics.d_numRepresentatives += -1;
}
-TermId UnionFind::find(TermId id) const {
+TermId UnionFind::find(TermId id) {
TermId repr = getRepr(id);
- if (repr != UndefinedId)
- return find(repr);
+ if (repr != UndefinedId) {
+ TermId find_id = find(repr);
+ setRepr(id, find_id);
+ return find_id;
+ }
return id;
}
/**
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback