return output;
}
+Expr vc_xorExpr(VC vc, Expr left, Expr right) {
+ bmstar b = (bmstar)(((stpstar)vc)->bm);
+ nodestar l = (nodestar)left;
+ nodestar r = (nodestar)right;
+
+ node o = b->CreateNode(BEEV::XOR,*l,*r);
+ BVTypeCheck(o);
+ nodestar output = new node(o);
+ //if(cinterface_exprdelete_on) created_exprs.push_back(output);
+ return output;
+}
+
+
Expr vc_andExprN(VC vc, Expr* cc, int n) {
bmstar b = (bmstar)(((stpstar)vc)->bm);
nodestar * c = (nodestar *)cc;
Expr vc_andExpr(VC vc, Expr left, Expr right);
Expr vc_andExprN(VC vc, Expr* children, int numOfChildNodes);
Expr vc_orExpr(VC vc, Expr left, Expr right);
+ Expr vc_xorExpr(VC vc, Expr left, Expr right);
Expr vc_orExprN(VC vc, Expr* children, int numOfChildNodes);
Expr vc_impliesExpr(VC vc, Expr hyp, Expr conc);
Expr vc_iffExpr(VC vc, Expr left, Expr right);
ASTVec bit_comparisons;
bit_comparisons.push_back(this_compare_bit);
- ASTNode prev_eq_bit = _bm->CreateSimpForm(IFF, *lit, *rit);
+ ASTNode prev_eq_bit =
+ _bm->CreateSimpForm(XOR,
+ _bm->CreateSimpForm(NOT,*lit),
+ *rit);
for(lit++, rit++; lit < litend; lit++, rit++)
{
this_compare_bit =
// (neg(lit) OR rit)(lit OR neg(rit))
ASTNode this_eq_bit =
_bm->CreateSimpForm(AND,
- _bm->CreateSimpForm(IFF,*lit,*rit),
+ _bm->CreateSimpForm(XOR,
+ _bm->CreateSimpForm(NOT,*lit),
+ *rit),
prev_eq_bit);
prev_eq_bit = this_eq_bit;
}
_bm->CreateSimpForm(OR, bit_comparisons);
return output;
- // // "thisbit" represents BVLE of the suffixes of the BVs
- // // from that position . if R < L, return TRUE, else if L < R
- // // return FALSE, else return BVLE of lower-order bits. MSB is
- // // treated separately, because signed comparison is done by
- // // complementing the MSB of each BV, then doing an unsigned
- // // comparison.
- // ASTVec::const_iterator lit = left.rbegin();
- // ASTVec::const_iterator litend = left.rend();
- // ASTVec::const_iterator rit = right.rbegin();
- // ASTNode prevbit = ASTTrue;
- // for (; lit < litend - 1; lit++, rit++)
- // {
- // ASTNode neglit = _bm->CreateSimpNot(*lit);
- // ASTNode thisbit =
- // _bm->CreateSimpForm(OR,
- // _bm->CreateSimpForm(AND, neglit, *rit),
- // _bm->CreateSimpForm(AND,
- // _bm->CreateSimpForm(OR,
- // neglit,
- // *rit),
- // prevbit));
- // prevbit = thisbit;
- // }
-
- // // Handle MSB -- negate MSBs if signed comparison
- // // FIXME: make into refs after it's debugged.
- // ASTNode lmsb = *lit;
- // ASTNode rmsb = *rit;
- // if (is_signed)
- // {
- // lmsb = _bm->CreateSimpNot(*lit);
- // rmsb = _bm->CreateSimpNot(*rit);
- // }
-
- // ASTNode neglmsb = _bm->CreateSimpNot(lmsb);
- // ASTNode msb =
- // // TRUE if l < r
- // _bm->CreateSimpForm(OR, _bm->CreateSimpForm(AND, neglmsb, rmsb),
- // _bm->CreateSimpForm(AND,
- // _bm->CreateSimpForm(OR,
- // neglmsb,
- // rmsb),
- // prevbit)); // else prevbit
- // return msb;
}
// Left shift within fixed field inserting zeros at LSB.
{
for (; lit != litend; lit++, rit++)
{
- ASTNode biteq = _bm->CreateSimpForm(IFF, *lit, *rit);
+ ASTNode biteq = _bm->CreateSimpForm(XOR,
+ _bm->CreateSimpForm(NOT,*lit),
+ *rit);
// fast path exit
if (biteq == ASTFalse)
{