summaryrefslogtreecommitdiff
path: root/src/theory/bv/theory_bv.h
diff options
context:
space:
mode:
authorDejan Jovanović <dejan.jovanovic@gmail.com>2011-03-20 01:12:31 +0000
committerDejan Jovanović <dejan.jovanovic@gmail.com>2011-03-20 01:12:31 +0000
commitaf6ac1f03a841a0261190cb7caa15ff1fa1f798c (patch)
tree56351c49de0cd299548becb15bf5810d6e0dac54 /src/theory/bv/theory_bv.h
parent649c50afb9e35ef467828567d4b1d24a107d6d20 (diff)
commit for the version of bitvectors that passes all the unit tests
Diffstat (limited to 'src/theory/bv/theory_bv.h')
-rw-r--r--src/theory/bv/theory_bv.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/theory/bv/theory_bv.h b/src/theory/bv/theory_bv.h
index ede98004f..fa9762cb7 100644
--- a/src/theory/bv/theory_bv.h
+++ b/src/theory/bv/theory_bv.h
@@ -46,7 +46,34 @@ public:
}
};
- typedef EqualityEngine<TheoryBV, EqualityNotify, true, true> BvEqualityEngine;
+ struct BVEqualitySettings {
+ static inline bool descend(TNode node) {
+ return node.getKind() == kind::BITVECTOR_CONCAT || node.getKind() == kind::BITVECTOR_EXTRACT;
+ }
+
+ /** Returns true if node1 has preference to node2 as a representative, otherwise node2 is used */
+ static inline bool mergePreference(TNode node1, unsigned node1size, TNode node2, unsigned node2size) {
+ if (node1.getKind() == kind::CONST_BITVECTOR) {
+ Assert(node2.getKind() != kind::CONST_BITVECTOR);
+ return true;
+ }
+ if (node2.getKind() == kind::CONST_BITVECTOR) {
+ Assert(node1.getKind() != kind::CONST_BITVECTOR);
+ return false;
+ }
+ if (node1.getKind() == kind::BITVECTOR_CONCAT) {
+ Assert(node2.getKind() != kind::BITVECTOR_CONCAT);
+ return true;
+ }
+ if (node2.getKind() == kind::BITVECTOR_CONCAT) {
+ Assert(node1.getKind() != kind::BITVECTOR_CONCAT);
+ return false;
+ }
+ return node2size < node1size;
+ }
+ };
+
+ typedef EqualityEngine<TheoryBV, EqualityNotify, BVEqualitySettings> BvEqualityEngine;
private:
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback