return ASTFalse;
}
+ // If both the children are concats split them apart.
+ // nb. This doesn't cover the case when the children are organised differently:
+ // (concat (concat A B) C) == (concat A (concat B C))
+ if (k1 == BVCONCAT && k2 == BVCONCAT && in1[0].GetValueWidth() == in2[0].GetValueWidth())
+ {
+ return nf->CreateNode(AND, nf->CreateNode(EQ, in1[0], in2[0]), nf->CreateNode(EQ, in1[1], in2[1]));
+ }
+
//last resort is to CreateNode
return nf->CreateNode(EQ, in1, in2);
output = nf->CreateTerm(BVCONCAT, inputValueWidth, t, u);
}
}
+ else if (t.GetKind() == BVCONCAT && t[0].GetKind() != BVCONCAT && false)
+ {
+
+ /// This makes the left hand child of every concat not a concat.
+ ASTNode left= t[0];
+ ASTNode bottom = nf->CreateTerm(BVCONCAT, t[1].GetValueWidth() + u.GetValueWidth(), t[1], u);
+ output = nf->CreateTerm(BVCONCAT, inputValueWidth, left, bottom);
+ assert(BVTypeCheck(output));
+ }
else
{
output = nf->CreateTerm(BVCONCAT, inputValueWidth, t, u);
--- /dev/null
+(set-logic QF_BV)
+(set-info :smt-lib-version 2.0)
+(set-info :category "check")
+(set-info :status sat)
+(declare-fun v0 () (_ BitVec 2))
+(declare-fun v1 () (_ BitVec 2))
+(declare-fun v2 () (_ BitVec 2))
+(declare-fun v3 () (_ BitVec 2))
+(declare-fun v4 () (_ BitVec 2))
+(declare-fun v5 () (_ BitVec 2))
+(declare-fun v6 () (_ BitVec 2))
+(declare-fun v7 () (_ BitVec 2))
+
+(assert (= (concat (concat v4 v5) v1) (concat (concat v6 v7) v2 ) ))
+(check-sat)
+(exit)
--- /dev/null
+(set-logic QF_BV)
+(set-info :smt-lib-version 2.0)
+(set-info :category "check")
+(set-info :status sat)
+(declare-fun v0 () (_ BitVec 2))
+(declare-fun v1 () (_ BitVec 2))
+(declare-fun v2 () (_ BitVec 2))
+(declare-fun v3 () (_ BitVec 2))
+(declare-fun v4 () (_ BitVec 2))
+(declare-fun v5 () (_ BitVec 2))
+(declare-fun v6 () (_ BitVec 2))
+(declare-fun v7 () (_ BitVec 2))
+
+(assert (= (concat v1 (concat v4 v5)) (concat (concat v6 v7) v2 ) ))
+(check-sat)
+(exit)
--- /dev/null
+(set-logic QF_BV)
+(set-info :smt-lib-version 2.0)
+(set-info :category "check")
+(set-info :status sat)
+(declare-fun v0 () (_ BitVec 2))
+(declare-fun v1 () (_ BitVec 2))
+(declare-fun v2 () (_ BitVec 2))
+(declare-fun v3 () (_ BitVec 2))
+(declare-fun v4 () (_ BitVec 2))
+(declare-fun v5 () (_ BitVec 2))
+(declare-fun v6 () (_ BitVec 2))
+(declare-fun v7 () (_ BitVec 2))
+
+(assert (= (concat v1 (concat v2 v3)) (concat (concat v1 v2) v3 ) ))
+(check-sat)
+(exit)