case BVAND:
case BVOR:
{
+ // turn BVAND(CONCAT CONCAT) into concat(BVAND() BVAND()). i.e. push ops through concat.
+ if (inputterm.Degree() ==2 && inputterm[0].GetKind() == BVCONCAT && inputterm[1].GetKind() == BVCONCAT && inputterm[0][0].GetValueWidth() ==inputterm[1][0].GetValueWidth() )
+ {
+ output = nf->CreateTerm(BVCONCAT, inputterm.GetValueWidth(),
+ nf->CreateTerm(k,inputterm[0][0].GetValueWidth(), inputterm[0][0],inputterm[1][0]),
+ nf->CreateTerm(k,inputterm[0][1].GetValueWidth(),inputterm[0][1],inputterm[1][1]));
+ break;
+ }
+
ASTNode max = _bm->CreateMaxConst(inputValueWidth);
ASTNode zero = _bm->CreateZeroConst(inputValueWidth);
output = _bm->CreateZeroConst(inputterm.GetValueWidth());
break;
}
+ if (inputterm.Degree() ==2 && inputterm[0].GetKind() == BVCONCAT && inputterm[1].GetKind() == BVCONCAT && inputterm[0][0].GetValueWidth() ==inputterm[1][0].GetValueWidth() )
+ {
+ output = nf->CreateTerm(BVCONCAT, inputterm.GetValueWidth(),
+ nf->CreateTerm(k,inputterm[0][0].GetValueWidth(), inputterm[0][0],inputterm[1][0]),
+ nf->CreateTerm(k,inputterm[0][1].GetValueWidth(),inputterm[0][1],inputterm[1][1]));
+ break;
+ }
+ if (inputterm.Degree() ==2 && inputterm[0] == _bm->CreateZeroConst(inputterm.GetValueWidth()))
+ {
+ output = inputterm[1];
+ break;
+ }
}
//run on.
case BVXNOR:
--- /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))
+
+
+(assert
+ (=
+ (bvor (concat v0 (_ bv0 2)) (concat (_ bv0 2) v1) )
+ (bvxor (concat v2 (_ bv0 2)) (concat (_ bv0 2) v3) )
+ )
+)
+
+
+
+(check-sat)
+(exit)
+