inline bool hasTerm(TNode t) const;
/**
- * Adds an equality t1 = t2 to the database. Returns false if any of the triggers failed.
+ * Adds an equality t1 = t2 to the database. Returns false if any of the triggers failed, or a
+ * conflict was introduced.
*/
bool addEquality(TNode t1, TNode t2, Node reason);
// If already the same, we're done
if (t1classId == t2classId) return true;
+ // Check for constants
+ if (d_nodes[t1classId].getMetaKind() == kind::metakind::CONSTANT &&
+ d_nodes[t2classId].getMetaKind() == kind::metakind::CONSTANT) {
+ d_notify.conflict(reason);
+ return false;
+ }
+
// Get the nodes of the representatives
EqualityNode& node1 = getEqualityNode(t1classId);
EqualityNode& node2 = getEqualityNode(t2classId);
bool operator () (size_t triggerId) {
return d_theoryBV.triggerEquality(triggerId);
}
+ void conflict(Node explanation) {
+ d_theoryBV.d_out->conflict(explanation);
+ }
};
struct BVEqualitySettings {
equality-00.smt \
equality-01.smt \
equality-02.smt \
+ equality-05.smt \
bv_eq_diamond10.smt \
slice-01.smt \
slice-02.smt \
--- /dev/null
+x,y:BITVECTOR(1);
+ASSERT(x = 0bin0);
+ASSERT(y = 0bin1);
+ASSERT(x = y);
+CHECKSAT;
+
--- /dev/null
+(benchmark equality
+ :status unsat
+ :logic QF_BV
+ :extrafuns ((x BitVec[1]))
+ :extrafuns ((y BitVec[1]))
+ :assumption (= x bv0[1])
+ :assumption (= y bv1[1])
+ :assumption (= x y)
+ :formula
+true
+)
--- /dev/null
+(benchmark slice
+ :status unsat
+ :logic QF_BV
+ :extrafuns ((x1 BitVec[4]))
+ :extrafuns ((y1 BitVec[4]))
+ :extrafuns ((x2 BitVec[2]))
+ :extrafuns ((y2 BitVec[2]))
+ :extrafuns ((x3 BitVec[1]))
+ :extrafuns ((y3 BitVec[1]))
+ :assumption (= x1 y1)
+ :assumption (= x1 (concat x2 x2))
+ :assumption (= x2 (concat x3 x3))
+ :assumption (= y1 (concat y2 y2))
+ :assumption (= y2 (concat y3 y3))
+ :formula (not (= x3 y3))
+)