// Encoding code (2)
// new_x_ = a + b - x
- Term a_plus_b = slv.mkTerm(BITVECTOR_PLUS, a, b);
+ Term a_plus_b = slv.mkTerm(BITVECTOR_ADD, a, b);
Term a_plus_b_minus_x = slv.mkTerm(BITVECTOR_SUB, a_plus_b, x);
Term assignment2 = slv.mkTerm(EQUAL, new_x_, a_plus_b_minus_x);
// Encoding code (2)
// new_x_ = a + b - x
- Expr a_plus_b = em.mkExpr(Kind.BITVECTOR_PLUS, a, b);
+ Expr a_plus_b = em.mkExpr(Kind.BITVECTOR_ADD, a, b);
Expr a_plus_b_minus_x = em.mkExpr(Kind.BITVECTOR_SUB, a_plus_b, x);
Expr assignment2 = em.mkExpr(Kind.EQUAL, new_x_, a_plus_b_minus_x);
# Encoding code (2)
# new_x_ = a + b - x
- a_plus_b = slv.mkTerm(kinds.BVPlus, a, b)
+ a_plus_b = slv.mkTerm(kinds.BVAdd, a, b)
a_plus_b_minus_x = slv.mkTerm(kinds.BVSub, a_plus_b, x)
assignment2 = slv.mkTerm(kinds.Equal, new_x_, a_plus_b_minus_x)
{BITVECTOR_XNOR, cvc5::Kind::BITVECTOR_XNOR},
{BITVECTOR_COMP, cvc5::Kind::BITVECTOR_COMP},
{BITVECTOR_MULT, cvc5::Kind::BITVECTOR_MULT},
- {BITVECTOR_PLUS, cvc5::Kind::BITVECTOR_PLUS},
+ {BITVECTOR_ADD, cvc5::Kind::BITVECTOR_ADD},
{BITVECTOR_SUB, cvc5::Kind::BITVECTOR_SUB},
{BITVECTOR_NEG, cvc5::Kind::BITVECTOR_NEG},
{BITVECTOR_UDIV, cvc5::Kind::BITVECTOR_UDIV},
{cvc5::Kind::BITVECTOR_XNOR, BITVECTOR_XNOR},
{cvc5::Kind::BITVECTOR_COMP, BITVECTOR_COMP},
{cvc5::Kind::BITVECTOR_MULT, BITVECTOR_MULT},
- {cvc5::Kind::BITVECTOR_PLUS, BITVECTOR_PLUS},
+ {cvc5::Kind::BITVECTOR_ADD, BITVECTOR_ADD},
{cvc5::Kind::BITVECTOR_SUB, BITVECTOR_SUB},
{cvc5::Kind::BITVECTOR_NEG, BITVECTOR_NEG},
{cvc5::Kind::BITVECTOR_UDIV, BITVECTOR_UDIV},
/* Kind */
/* -------------------------------------------------------------------------- */
-// TODO(Gereon): Fix links that involve std::vector. See https://github.com/doxygen/doxygen/issues/8503
+// TODO(Gereon): Fix links that involve std::vector. See
+// https://github.com/doxygen/doxygen/issues/8503
+// clang-format off
/**
* The kind of a cvc5 term.
*
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
*/
- BITVECTOR_PLUS,
+ BITVECTOR_ADD,
/**
* Subtraction of two bit-vectors.
*
/** Marks the upper-bound of this enumeration. */
LAST_KIND
};
+// clang-format on
/**
* Get the string representation of a given kind.
so that the word after "Is" is capitalized
Examples:
- BITVECTOR_PLUS --> BVPlus
+ BITVECTOR_ADD --> BVAdd
APPLY_SELECTOR --> ApplySelector
FLOATINGPOINT_ISNAN --> FPIsNan
SETMINUS --> Setminus
case PfRule::BV_BITBLAST_NOR: return "BV_BITBLAST_NOR";
case PfRule::BV_BITBLAST_COMP: return "BV_BITBLAST_COMP";
case PfRule::BV_BITBLAST_MULT: return "BV_BITBLAST_MULT";
- case PfRule::BV_BITBLAST_PLUS: return "BV_BITBLAST_PLUS";
+ case PfRule::BV_BITBLAST_ADD: return "BV_BITBLAST_ADD";
case PfRule::BV_BITBLAST_SUB: return "BV_BITBLAST_SUB";
case PfRule::BV_BITBLAST_NEG: return "BV_BITBLAST_NEG";
case PfRule::BV_BITBLAST_UDIV: return "BV_BITBLAST_UDIV";
BV_BITBLAST_NOR,
BV_BITBLAST_COMP,
BV_BITBLAST_MULT,
- BV_BITBLAST_PLUS,
+ BV_BITBLAST_ADD,
BV_BITBLAST_SUB,
BV_BITBLAST_NEG,
BV_BITBLAST_UDIV,
for (unsigned i = 0; i < args.size(); ++ i) {
ENSURE_BV_SIZE(k, args[i]);
}
- f = MK_TERM(cvc5::api::BITVECTOR_PLUS, args);
+ f = MK_TERM(cvc5::api::BITVECTOR_ADD, args);
}
/* BV subtraction */
| BVSUB_TOK LPAREN k=numeral COMMA formula[f] COMMA formula[f2] RPAREN
addOperator(api::BITVECTOR_AND, "bvand");
addOperator(api::BITVECTOR_OR, "bvor");
addOperator(api::BITVECTOR_NEG, "bvneg");
- addOperator(api::BITVECTOR_PLUS, "bvadd");
+ addOperator(api::BITVECTOR_ADD, "bvadd");
addOperator(api::BITVECTOR_MULT, "bvmul");
addOperator(api::BITVECTOR_UDIV, "bvudiv");
addOperator(api::BITVECTOR_UREM, "bvurem");
break;
}
- case kind::BITVECTOR_PLUS:
+ case kind::BITVECTOR_ADD:
{
Integer maxval = Integer(0);
for (const Node& nn : n)
/* Split into matrix columns */
Kind k = n.getKind();
- if (k == kind::BITVECTOR_PLUS)
+ if (k == kind::BITVECTOR_ADD)
{
for (const Node& nn : n) { stack.push_back(nn); }
}
}
else
{
- Node tmp = stack.size() == 1
- ? stack[0]
- : nm->mkNode(kind::BITVECTOR_PLUS, stack);
+ Node tmp = stack.size() == 1 ? stack[0]
+ : nm->mkNode(kind::BITVECTOR_ADD, stack);
if (rhs[prow] != 0)
{
- tmp = nm->mkNode(kind::BITVECTOR_PLUS,
- bv::utils::mkConst(
- bv::utils::getSize(vvars[pcol]), rhs[prow]),
- tmp);
+ tmp = nm->mkNode(
+ kind::BITVECTOR_ADD,
+ bv::utils::mkConst(bv::utils::getSize(vvars[pcol]), rhs[prow]),
+ tmp);
}
Assert(!is_bv_const(tmp));
res[vvars[pcol]] = nm->mkNode(kind::BITVECTOR_UREM, tmp, prime);
continue;
}
- if (urem[0].getKind() == kind::BITVECTOR_PLUS && is_bv_const(urem[1]))
+ if (urem[0].getKind() == kind::BITVECTOR_ADD && is_bv_const(urem[1]))
{
equations[urem[1]].push_back(a);
}
*/
kind::Kind_t k = current.getKind();
if ((numChildren > 2)
- && (k == kind::BITVECTOR_PLUS || k == kind::BITVECTOR_MULT
+ && (k == kind::BITVECTOR_ADD || k == kind::BITVECTOR_MULT
|| k == kind::BITVECTOR_AND || k == kind::BITVECTOR_OR
|| k == kind::BITVECTOR_XOR || k == kind::BITVECTOR_CONCAT))
{
CVC5_UNUSED kind::Kind_t k = current.getKind();
uint64_t numChildren = current.getNumChildren();
Assert((numChildren == 2)
- || !(k == kind::BITVECTOR_PLUS || k == kind::BITVECTOR_MULT
+ || !(k == kind::BITVECTOR_ADD || k == kind::BITVECTOR_MULT
|| k == kind::BITVECTOR_AND || k == kind::BITVECTOR_OR
|| k == kind::BITVECTOR_XOR || k == kind::BITVECTOR_CONCAT));
toVisit.pop_back();
Node returnNode;
switch (oldKind)
{
- case kind::BITVECTOR_PLUS:
+ case kind::BITVECTOR_ADD:
{
Assert(originalNumChildren == 2);
uint64_t bvsize = original[0].getType().getBitVectorSize();
{
case kind::PLUS:
Assert(children.size() == 2);
- newKind = kind::BITVECTOR_PLUS;
+ newKind = kind::BITVECTOR_ADD;
max = max + 1;
break;
case kind::MULT:
case kind::XOR:
case kind::BITVECTOR_XOR:
case kind::BITVECTOR_XNOR:
- case kind::BITVECTOR_PLUS:
+ case kind::BITVECTOR_ADD:
case kind::BITVECTOR_SUB: checkParent = true; break;
// Multiplication/division: must be non-integer and other operand must
op << "@";
opType = INFIX;
break;
- case kind::BITVECTOR_PLUS: {
- // This interprets a BITVECTOR_PLUS as a bvadd in SMT-LIB
+ case kind::BITVECTOR_ADD:
+ {
+ // This interprets a BITVECTOR_ADD as a bvadd in SMT-LIB
Assert(n.getType().isBitVector());
unsigned numc = n.getNumChildren()-2;
unsigned child = 0;
case kind::BITVECTOR_XNOR: out << "bvxnor "; break;
case kind::BITVECTOR_COMP: out << "bvcomp "; break;
case kind::BITVECTOR_MULT: out << "bvmul "; forceBinary = true; break;
- case kind::BITVECTOR_PLUS: out << "bvadd "; forceBinary = true; break;
+ case kind::BITVECTOR_ADD:
+ out << "bvadd ";
+ forceBinary = true;
+ break;
case kind::BITVECTOR_SUB: out << "bvsub "; break;
case kind::BITVECTOR_NEG: out << "bvneg "; break;
case kind::BITVECTOR_UDIV: out << "bvudiv "; break;
case kind::BITVECTOR_XNOR: return "bvxnor";
case kind::BITVECTOR_COMP: return "bvcomp";
case kind::BITVECTOR_MULT: return "bvmul";
- case kind::BITVECTOR_PLUS: return "bvadd";
+ case kind::BITVECTOR_ADD: return "bvadd";
case kind::BITVECTOR_SUB: return "bvsub";
case kind::BITVECTOR_NEG: return "bvneg";
case kind::BITVECTOR_UDIV: return "bvudiv";
case BITVECTOR_OR:
case BITVECTOR_XOR:
case BITVECTOR_MULT:
- case BITVECTOR_PLUS:
+ case BITVECTOR_ADD:
case DISTINCT:
case PLUS:
case MULT:
}
template <class T>
-void DefaultPlusBB (TNode node, std::vector<T>& res, TBitblaster<T>* bb) {
- Debug("bitvector-bb") << "theory::bv::DefaultPlusBB bitblasting " << node << "\n";
- Assert(node.getKind() == kind::BITVECTOR_PLUS && res.size() == 0);
+void DefaultAddBB(TNode node, std::vector<T>& res, TBitblaster<T>* bb)
+{
+ Debug("bitvector-bb") << "theory::bv::DefaultAddBB bitblasting " << node
+ << "\n";
+ Assert(node.getKind() == kind::BITVECTOR_ADD && res.size() == 0);
bb->bbTerm(node[0], res);
Assert(res.size() == utils::getSize(node));
}
-
template <class T>
void DefaultSubBB (TNode node, std::vector<T>& bits, TBitblaster<T>* bb) {
Debug("bitvector-bb") << "theory::bv::DefaultSubBB bitblasting " << node << "\n";
d_termBBStrategies[kind::BITVECTOR_NOR] = DefaultNorBB<T>;
d_termBBStrategies[kind::BITVECTOR_COMP] = DefaultCompBB<T>;
d_termBBStrategies[kind::BITVECTOR_MULT] = DefaultMultBB<T>;
- d_termBBStrategies[kind::BITVECTOR_PLUS] = DefaultPlusBB<T>;
+ d_termBBStrategies[kind::BITVECTOR_ADD] = DefaultAddBB<T>;
d_termBBStrategies[kind::BITVECTOR_SUB] = DefaultSubBB<T>;
d_termBBStrategies[kind::BITVECTOR_NEG] = DefaultNegBB<T>;
d_termBBStrategies[kind::BITVECTOR_UDIV] = DefaultUdivBB<T>;
{kind::BITVECTOR_NOR, PfRule::BV_BITBLAST_NOR},
{kind::BITVECTOR_COMP, PfRule::BV_BITBLAST_COMP},
{kind::BITVECTOR_MULT, PfRule::BV_BITBLAST_MULT},
- {kind::BITVECTOR_PLUS, PfRule::BV_BITBLAST_PLUS},
+ {kind::BITVECTOR_ADD, PfRule::BV_BITBLAST_ADD},
{kind::BITVECTOR_SUB, PfRule::BV_BITBLAST_SUB},
{kind::BITVECTOR_NEG, PfRule::BV_BITBLAST_NEG},
{kind::BITVECTOR_UDIV, PfRule::BV_BITBLAST_UDIV},
Node result = RewriteRule<BitwiseEq>::run<false>(t);
res = Rewriter::rewrite(result);
}
- else if (RewriteRule<UltPlusOne>::applies(t))
+ else if (RewriteRule<UltAddOne>::applies(t))
{
- Node result = RewriteRule<UltPlusOne>::run<false>(t);
+ Node result = RewriteRule<UltAddOne>::run<false>(t);
res = Rewriter::rewrite(result);
}
else if (res.getKind() == kind::EQUAL
- && ((res[0].getKind() == kind::BITVECTOR_PLUS
+ && ((res[0].getKind() == kind::BITVECTOR_ADD
&& RewriteRule<ConcatToMult>::applies(res[1]))
- || (res[1].getKind() == kind::BITVECTOR_PLUS
+ || (res[1].getKind() == kind::BITVECTOR_ADD
&& RewriteRule<ConcatToMult>::applies(res[0]))))
{
Node mult = RewriteRule<ConcatToMult>::applies(res[0])
{
res = RewriteRule<ZeroExtendEqConst>::run<false>(t);
}
- else if (RewriteRule<NormalizeEqPlusNeg>::applies(t))
+ else if (RewriteRule<NormalizeEqAddNeg>::applies(t))
{
- res = RewriteRule<NormalizeEqPlusNeg>::run<false>(t);
+ res = RewriteRule<NormalizeEqAddNeg>::run<false>(t);
}
// if(t.getKind() == kind::EQUAL &&
// ((t[0].getKind() == kind::BITVECTOR_MULT && t[1].getKind() ==
- // kind::BITVECTOR_PLUS) ||
+ // kind::BITVECTOR_ADD) ||
// (t[1].getKind() == kind::BITVECTOR_MULT && t[0].getKind() ==
- // kind::BITVECTOR_PLUS))) {
+ // kind::BITVECTOR_ADD))) {
// // if we have an equality between a multiplication and addition
// // try to express multiplication in terms of addition
// Node mult = t[0].getKind() == kind::BITVECTOR_MULT? t[0] : t[1];
- // Node add = t[0].getKind() == kind::BITVECTOR_PLUS? t[0] : t[1];
+ // Node add = t[0].getKind() == kind::BITVECTOR_ADD? t[0] : t[1];
// if (RewriteRule<MultSlice>::applies(mult)) {
// Node new_mult = RewriteRule<MultSlice>::run<false>(mult);
// Node new_eq =
if (in.getKind() == kind::EQUAL)
{
- if ((in[0].getKind() == kind::BITVECTOR_PLUS
+ if ((in[0].getKind() == kind::BITVECTOR_ADD
&& in[1].getKind() == kind::BITVECTOR_SHL)
- || (in[1].getKind() == kind::BITVECTOR_PLUS
+ || (in[1].getKind() == kind::BITVECTOR_ADD
&& in[0].getKind() == kind::BITVECTOR_SHL))
{
- TNode p = in[0].getKind() == kind::BITVECTOR_PLUS ? in[0] : in[1];
- TNode s = in[0].getKind() == kind::BITVECTOR_PLUS ? in[1] : in[0];
+ TNode p = in[0].getKind() == kind::BITVECTOR_ADD ? in[0] : in[1];
+ TNode s = in[0].getKind() == kind::BITVECTOR_ADD ? in[1] : in[0];
if (p.getNumChildren() == 2 && p[0].getKind() == kind::BITVECTOR_SHL
&& p[1].getKind() == kind::BITVECTOR_SHL)
// d_equalityEngine->addFunctionKind(kind::BITVECTOR_XNOR);
// d_equalityEngine->addFunctionKind(kind::BITVECTOR_COMP);
d_equalityEngine->addFunctionKind(kind::BITVECTOR_MULT, true);
- d_equalityEngine->addFunctionKind(kind::BITVECTOR_PLUS, true);
+ d_equalityEngine->addFunctionKind(kind::BITVECTOR_ADD, true);
d_equalityEngine->addFunctionKind(kind::BITVECTOR_EXTRACT, true);
// d_equalityEngine->addFunctionKind(kind::BITVECTOR_SUB);
// d_equalityEngine->addFunctionKind(kind::BITVECTOR_NEG);
Node one = utils::mkConst(utils::getSize(a), 1);
Node a_plus_one = Rewriter::rewrite(
- NodeManager::currentNM()->mkNode(kind::BITVECTOR_PLUS, a, one));
+ NodeManager::currentNM()->mkNode(kind::BITVECTOR_ADD, a, one));
if (d_ineqTerms.find(a_plus_one) != d_ineqTerms.end())
{
ok = d_inequalityGraph.addInequality(a_plus_one, b, false, fact);
## arithmetic kinds
operator BITVECTOR_MULT 2: "multiplication of two or more bit-vectors"
operator BITVECTOR_NEG 1 "unary negation of a bit-vector"
-operator BITVECTOR_PLUS 2: "addition of two or more bit-vectors"
+operator BITVECTOR_ADD 2: "addition of two or more bit-vectors"
operator BITVECTOR_SUB 2 "subtraction of two bit-vectors"
operator BITVECTOR_UDIV 2 "unsigned division of two bit-vectors, truncating towards 0 (defined to be the all-ones bit pattern, if divisor is 0)"
operator BITVECTOR_UREM 2 "unsigned remainder from truncating division of two bit-vectors (defined to be equal to the dividend, if divisor is 0)"
## arithmetic kinds
typerule BITVECTOR_MULT ::cvc5::theory::bv::BitVectorFixedWidthTypeRule
typerule BITVECTOR_NEG ::cvc5::theory::bv::BitVectorFixedWidthTypeRule
-typerule BITVECTOR_PLUS ::cvc5::theory::bv::BitVectorFixedWidthTypeRule
+typerule BITVECTOR_ADD ::cvc5::theory::bv::BitVectorFixedWidthTypeRule
typerule BITVECTOR_SUB ::cvc5::theory::bv::BitVectorFixedWidthTypeRule
typerule BITVECTOR_UDIV ::cvc5::theory::bv::BitVectorFixedWidthTypeRule
typerule BITVECTOR_UREM ::cvc5::theory::bv::BitVectorFixedWidthTypeRule
pc->registerChecker(PfRule::BV_BITBLAST_NOR, this);
pc->registerChecker(PfRule::BV_BITBLAST_COMP, this);
pc->registerChecker(PfRule::BV_BITBLAST_MULT, this);
- pc->registerChecker(PfRule::BV_BITBLAST_PLUS, this);
+ pc->registerChecker(PfRule::BV_BITBLAST_ADD, this);
pc->registerChecker(PfRule::BV_BITBLAST_SUB, this);
pc->registerChecker(PfRule::BV_BITBLAST_NEG, this);
pc->registerChecker(PfRule::BV_BITBLAST_UDIV, this);
|| id == PfRule::BV_BITBLAST_OR || id == PfRule::BV_BITBLAST_XOR
|| id == PfRule::BV_BITBLAST_XNOR || id == PfRule::BV_BITBLAST_NAND
|| id == PfRule::BV_BITBLAST_NOR || id == PfRule::BV_BITBLAST_COMP
- || id == PfRule::BV_BITBLAST_MULT || id == PfRule::BV_BITBLAST_PLUS
+ || id == PfRule::BV_BITBLAST_MULT || id == PfRule::BV_BITBLAST_ADD
|| id == PfRule::BV_BITBLAST_SUB || id == PfRule::BV_BITBLAST_NEG
|| id == PfRule::BV_BITBLAST_UDIV || id == PfRule::BV_BITBLAST_UREM
|| id == PfRule::BV_BITBLAST_SDIV || id == PfRule::BV_BITBLAST_SREM
// ee->addFunctionKind(kind::BITVECTOR_XNOR);
// ee->addFunctionKind(kind::BITVECTOR_COMP);
ee->addFunctionKind(kind::BITVECTOR_MULT, true);
- ee->addFunctionKind(kind::BITVECTOR_PLUS, true);
+ ee->addFunctionKind(kind::BITVECTOR_ADD, true);
ee->addFunctionKind(kind::BITVECTOR_EXTRACT, true);
// ee->addFunctionKind(kind::BITVECTOR_SUB);
// ee->addFunctionKind(kind::BITVECTOR_NEG);
EvalXor,
EvalNot,
EvalMult,
- EvalPlus,
+ EvalAdd,
EvalUdiv,
EvalUrem,
EvalShl,
DoubleNeg,
NegMult,
NegSub,
- NegPlus,
+ NegAdd,
NotConcat,
NotAnd, // not sure why this would help (not done)
NotOr, // not sure why this would help (not done)
NotXor, // not sure why this would help (not done)
FlattenAssocCommut,
FlattenAssocCommutNoDuplicates,
- PlusCombineLikeTerms,
+ AddCombineLikeTerms,
MultSimplify,
MultDistribConst,
MultDistrib,
OrSimplify,
XorSimplify,
BitwiseSlicing,
- NormalizeEqPlusNeg,
+ NormalizeEqAddNeg,
// rules to simplify bitblasting
- BBPlusNeg,
- UltPlusOne,
+ BBAddNeg,
+ UltAddOne,
ConcatToMult,
IsPowerOfTwo,
MultSltMult,
case EvalXor : out << "EvalXor"; return out;
case EvalNot : out << "EvalNot"; return out;
case EvalMult : out << "EvalMult"; return out;
- case EvalPlus : out << "EvalPlus"; return out;
+ case EvalAdd: out << "EvalAdd"; return out;
case EvalUdiv : out << "EvalUdiv"; return out;
case EvalUrem : out << "EvalUrem"; return out;
case EvalShl : out << "EvalShl"; return out;
case NotIdemp : out << "NotIdemp"; return out;
case UleSelf: out << "UleSelf"; return out;
case FlattenAssocCommut: out << "FlattenAssocCommut"; return out;
- case FlattenAssocCommutNoDuplicates: out << "FlattenAssocCommutNoDuplicates"; return out;
- case PlusCombineLikeTerms: out << "PlusCombineLikeTerms"; return out;
+ case FlattenAssocCommutNoDuplicates:
+ out << "FlattenAssocCommutNoDuplicates";
+ return out;
+ case AddCombineLikeTerms: out << "AddCombineLikeTerms"; return out;
case MultSimplify: out << "MultSimplify"; return out;
case MultDistribConst: out << "MultDistribConst"; return out;
case SolveEq : out << "SolveEq"; return out;
case AndSimplify : out << "AndSimplify"; return out;
case OrSimplify : out << "OrSimplify"; return out;
case XorSimplify : out << "XorSimplify"; return out;
- case NegPlus : out << "NegPlus"; return out;
- case BBPlusNeg : out << "BBPlusNeg"; return out;
+ case NegAdd: out << "NegAdd"; return out;
+ case BBAddNeg: out << "BBAddNeg"; return out;
case UltOne : out << "UltOne"; return out;
case SltZero : out << "SltZero"; return out;
case ZeroUlt : out << "ZeroUlt"; return out;
case BitwiseSlicing : out << "BitwiseSlicing"; return out;
case ExtractSignExtend : out << "ExtractSignExtend"; return out;
case MultDistrib: out << "MultDistrib"; return out;
- case UltPlusOne: out << "UltPlusOne"; return out;
+ case UltAddOne: out << "UltAddOne"; return out;
case ConcatToMult: out << "ConcatToMult"; return out;
case IsPowerOfTwo: out << "IsPowerOfTwo"; return out;
case MultSltMult: out << "MultSltMult"; return out;
- case NormalizeEqPlusNeg: out << "NormalizeEqPlusNeg"; return out;
+ case NormalizeEqAddNeg: out << "NormalizeEqAddNeg"; return out;
case BitOfConst: out << "BitOfConst"; return out;
default:
Unreachable();
RewriteRule<EvalNot> rule29;
RewriteRule<EvalSlt> rule30;
RewriteRule<EvalMult> rule31;
- RewriteRule<EvalPlus> rule32;
+ RewriteRule<EvalAdd> rule32;
RewriteRule<XorSimplify> rule33;
RewriteRule<EvalUdiv> rule34;
RewriteRule<EvalUrem> rule35;
RewriteRule<NotIdemp> rule102;
RewriteRule<UleSelf> rule103;
RewriteRule<FlattenAssocCommut> rule104;
- RewriteRule<PlusCombineLikeTerms> rule105;
+ RewriteRule<AddCombineLikeTerms> rule105;
RewriteRule<MultSimplify> rule106;
RewriteRule<MultDistribConst> rule107;
RewriteRule<AndSimplify> rule108;
RewriteRule<OrSimplify> rule109;
- RewriteRule<NegPlus> rule110;
- RewriteRule<BBPlusNeg> rule111;
+ RewriteRule<NegAdd> rule110;
+ RewriteRule<BBAddNeg> rule111;
RewriteRule<SolveEq> rule112;
RewriteRule<BitwiseEq> rule113;
RewriteRule<UltOne> rule114;
RewriteRule<BVToNatEliminate> rule116;
RewriteRule<IntToBVEliminate> rule117;
RewriteRule<MultDistrib> rule118;
- RewriteRule<UltPlusOne> rule119;
+ RewriteRule<UltAddOne> rule119;
RewriteRule<ConcatToMult> rule120;
RewriteRule<IsPowerOfTwo> rule121;
RewriteRule<RedorEliminate> rule122;
RewriteRule<SignExtendUltConst> rule126;
RewriteRule<ZeroExtendUltConst> rule127;
RewriteRule<MultSltMult> rule128;
- RewriteRule<NormalizeEqPlusNeg> rule129;
+ RewriteRule<NormalizeEqAddNeg> rule129;
RewriteRule<BvComp> rule130;
RewriteRule<BvIteConstCond> rule131;
RewriteRule<BvIteEqualChildren> rule132;
return utils::mkConst(res);
}
-template<> inline
-bool RewriteRule<EvalPlus>::applies(TNode node) {
- return (node.getKind() == kind::BITVECTOR_PLUS &&
- utils::isBvConstTerm(node));
+template <>
+inline bool RewriteRule<EvalAdd>::applies(TNode node)
+{
+ return (node.getKind() == kind::BITVECTOR_ADD && utils::isBvConstTerm(node));
}
-template<> inline
-Node RewriteRule<EvalPlus>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<EvalPlus>(" << node << ")" << std::endl;
+template <>
+inline Node RewriteRule<EvalAdd>::apply(TNode node)
+{
+ Debug("bv-rewrite") << "RewriteRule<EvalAdd>(" << node << ")" << std::endl;
TNode::iterator child_it = node.begin();
BitVector res = (*child_it).getConst<BitVector>();
for(++child_it; child_it != node.end(); ++child_it) {
template<> inline
bool RewriteRule<ExtractArith>::applies(TNode node) {
- return (node.getKind() == kind::BITVECTOR_EXTRACT &&
- utils::getExtractLow(node) == 0 &&
- (node[0].getKind() == kind::BITVECTOR_PLUS ||
- node[0].getKind() == kind::BITVECTOR_MULT));
+ return (node.getKind() == kind::BITVECTOR_EXTRACT
+ && utils::getExtractLow(node) == 0
+ && (node[0].getKind() == kind::BITVECTOR_ADD
+ || node[0].getKind() == kind::BITVECTOR_MULT));
}
template <>
// careful not to apply in a loop
template<> inline
bool RewriteRule<ExtractArith2>::applies(TNode node) {
- return (node.getKind() == kind::BITVECTOR_EXTRACT &&
- (node[0].getKind() == kind::BITVECTOR_PLUS ||
- node[0].getKind() == kind::BITVECTOR_MULT));
+ return (node.getKind() == kind::BITVECTOR_EXTRACT
+ && (node[0].getKind() == kind::BITVECTOR_ADD
+ || node[0].getKind() == kind::BITVECTOR_MULT));
}
template <>
template<> inline
bool RewriteRule<FlattenAssocCommut>::applies(TNode node) {
Kind kind = node.getKind();
- if (kind != kind::BITVECTOR_PLUS &&
- kind != kind::BITVECTOR_MULT &&
- kind != kind::BITVECTOR_OR &&
- kind != kind::BITVECTOR_XOR &&
- kind != kind::BITVECTOR_AND)
+ if (kind != kind::BITVECTOR_ADD && kind != kind::BITVECTOR_MULT
+ && kind != kind::BITVECTOR_OR && kind != kind::BITVECTOR_XOR
+ && kind != kind::BITVECTOR_AND)
return false;
TNode::iterator child_it = node.begin();
for(; child_it != node.end(); ++child_it) {
children.push_back(current);
}
}
- if (node.getKind() == kind::BITVECTOR_PLUS
+ if (node.getKind() == kind::BITVECTOR_ADD
|| node.getKind() == kind::BITVECTOR_MULT)
{
return utils::mkNaryNode(kind, children);
}
}
-template<> inline
-bool RewriteRule<PlusCombineLikeTerms>::applies(TNode node) {
- return (node.getKind() == kind::BITVECTOR_PLUS);
+template <>
+inline bool RewriteRule<AddCombineLikeTerms>::applies(TNode node)
+{
+ return (node.getKind() == kind::BITVECTOR_ADD);
}
template <>
-inline Node RewriteRule<PlusCombineLikeTerms>::apply(TNode node)
+inline Node RewriteRule<AddCombineLikeTerms>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<PlusCombineLikeTerms>(" << node << ")"
+ Debug("bv-rewrite") << "RewriteRule<AddCombineLikeTerms>(" << node << ")"
<< std::endl;
unsigned size = utils::getSize(node);
BitVector constSum(size, (unsigned)0);
return node;
}
- return csize == 0
- ? utils::mkZero(size)
- : utils::mkNaryNode(kind::BITVECTOR_PLUS, children);
+ return csize == 0 ? utils::mkZero(size)
+ : utils::mkNaryNode(kind::BITVECTOR_ADD, children);
}
template<> inline
return false;
}
TNode factor = node[0];
- return (factor.getKind() == kind::BITVECTOR_PLUS ||
- factor.getKind() == kind::BITVECTOR_SUB ||
- factor.getKind() == kind::BITVECTOR_NEG);
+ return (factor.getKind() == kind::BITVECTOR_ADD
+ || factor.getKind() == kind::BITVECTOR_SUB
+ || factor.getKind() == kind::BITVECTOR_NEG);
}
template <>
node.getNumChildren() != 2) {
return false;
}
- if (node[0].getKind() == kind::BITVECTOR_PLUS ||
- node[0].getKind() == kind::BITVECTOR_SUB) {
- return node[1].getKind() != kind::BITVECTOR_PLUS &&
- node[1].getKind() != kind::BITVECTOR_SUB;
+ if (node[0].getKind() == kind::BITVECTOR_ADD
+ || node[0].getKind() == kind::BITVECTOR_SUB)
+ {
+ return node[1].getKind() != kind::BITVECTOR_ADD
+ && node[1].getKind() != kind::BITVECTOR_SUB;
}
- return node[1].getKind() == kind::BITVECTOR_PLUS ||
- node[1].getKind() == kind::BITVECTOR_SUB;
+ return node[1].getKind() == kind::BITVECTOR_ADD
+ || node[1].getKind() == kind::BITVECTOR_SUB;
}
template <>
<< std::endl;
NodeManager *nm = NodeManager::currentNM();
- bool is_rhs_factor = node[0].getKind() == kind::BITVECTOR_PLUS
+ bool is_rhs_factor = node[0].getKind() == kind::BITVECTOR_ADD
|| node[0].getKind() == kind::BITVECTOR_SUB;
TNode factor = !is_rhs_factor ? node[0] : node[1];
TNode sum = is_rhs_factor ? node[0] : node[1];
- Assert(factor.getKind() != kind::BITVECTOR_PLUS
+ Assert(factor.getKind() != kind::BITVECTOR_ADD
&& factor.getKind() != kind::BITVECTOR_SUB
- && (sum.getKind() == kind::BITVECTOR_PLUS
+ && (sum.getKind() == kind::BITVECTOR_ADD
|| sum.getKind() == kind::BITVECTOR_SUB));
std::vector<Node> children;
std::map<Node, BitVector> leftMap, rightMap;
// Collect terms and coefficients plus constant for left
- if (left.getKind() == kind::BITVECTOR_PLUS)
+ if (left.getKind() == kind::BITVECTOR_ADD)
{
for (unsigned i = 0; i < left.getNumChildren(); ++i)
{
}
// Collect terms and coefficients plus constant for right
- if (right.getKind() == kind::BITVECTOR_PLUS)
+ if (right.getKind() == kind::BITVECTOR_ADD)
{
for (unsigned i = 0; i < right.getNumChildren(); ++i)
{
}
else
{
- newLeft = utils::mkNaryNode(kind::BITVECTOR_PLUS, childrenLeft);
+ newLeft = utils::mkNaryNode(kind::BITVECTOR_ADD, childrenLeft);
}
if (childrenRight.size() == 0)
}
else
{
- newRight = utils::mkNaryNode(kind::BITVECTOR_PLUS, childrenRight);
+ newRight = utils::mkNaryNode(kind::BITVECTOR_ADD, childrenRight);
}
if (!changed)
kind::BITVECTOR_SUB, node[0][1], node[0][0]);
}
-template<> inline
-bool RewriteRule<NegPlus>::applies(TNode node) {
- return (node.getKind() == kind::BITVECTOR_NEG &&
- node[0].getKind() == kind::BITVECTOR_PLUS);
+template <>
+inline bool RewriteRule<NegAdd>::applies(TNode node)
+{
+ return (node.getKind() == kind::BITVECTOR_NEG
+ && node[0].getKind() == kind::BITVECTOR_ADD);
}
template <>
-inline Node RewriteRule<NegPlus>::apply(TNode node)
+inline Node RewriteRule<NegAdd>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<NegPlus>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<NegAdd>(" << node << ")" << std::endl;
NodeManager *nm = NodeManager::currentNM();
std::vector<Node> children;
for (unsigned i = 0; i < node[0].getNumChildren(); ++i)
{
children.push_back(nm->mkNode(kind::BITVECTOR_NEG, node[0][i]));
}
- return utils::mkNaryNode(kind::BITVECTOR_PLUS, children);
+ return utils::mkNaryNode(kind::BITVECTOR_ADD, children);
}
struct Count {
}
template <>
-inline bool RewriteRule<NormalizeEqPlusNeg>::applies(TNode node)
+inline bool RewriteRule<NormalizeEqAddNeg>::applies(TNode node)
{
return node.getKind() == kind::EQUAL
- && (node[0].getKind() == kind::BITVECTOR_PLUS
- || node[1].getKind() == kind::BITVECTOR_PLUS);
+ && (node[0].getKind() == kind::BITVECTOR_ADD
+ || node[1].getKind() == kind::BITVECTOR_ADD);
}
template <>
-inline Node RewriteRule<NormalizeEqPlusNeg>::apply(TNode node)
+inline Node RewriteRule<NormalizeEqAddNeg>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<NormalizeEqPlusNeg>(" << node << ")"
+ Debug("bv-rewrite") << "RewriteRule<NormalizeEqAddNeg>(" << node << ")"
<< std::endl;
- NodeBuilder nb_lhs(kind::BITVECTOR_PLUS);
- NodeBuilder nb_rhs(kind::BITVECTOR_PLUS);
+ NodeBuilder nb_lhs(kind::BITVECTOR_ADD);
+ NodeBuilder nb_rhs(kind::BITVECTOR_ADD);
NodeManager *nm = NodeManager::currentNM();
- if (node[0].getKind() == kind::BITVECTOR_PLUS)
+ if (node[0].getKind() == kind::BITVECTOR_ADD)
{
for (const TNode &n : node[0])
{
nb_lhs << node[0];
}
- if (node[1].getKind() == kind::BITVECTOR_PLUS)
+ if (node[1].getKind() == kind::BITVECTOR_ADD)
{
for (const TNode &n : node[1])
{
unsigned size = utils::getSize(a);
Node one = utils::mkOne(size);
Node nota = nm->mkNode(kind::BITVECTOR_NOT, a);
- Node bvadd =
- nm->mkNode(kind::BITVECTOR_PLUS, nota, one);
+ Node bvadd = nm->mkNode(kind::BITVECTOR_ADD, nota, one);
return bvadd;
}
NodeManager* nm = NodeManager::currentNM();
TNode a = node[0];
TNode b = node[1];
- Node bvadd = nm->mkNode(kind::BITVECTOR_PLUS, a, b);
+ Node bvadd = nm->mkNode(kind::BITVECTOR_ADD, a, b);
Node bvand = nm->mkNode(kind::BITVECTOR_AND, a, b);
Node result =
nm->mkNode(kind::BITVECTOR_SUB, bvadd, bvand);
unsigned size = utils::getSize(node[0]);
Integer val = Integer(1).multiplyByPow2(size - 1);
Node pow_two = utils::mkConst(size, val);
- Node a = nm->mkNode(kind::BITVECTOR_PLUS, node[0], pow_two);
- Node b = nm->mkNode(kind::BITVECTOR_PLUS, node[1], pow_two);
+ Node a = nm->mkNode(kind::BITVECTOR_ADD, node[0], pow_two);
+ Node b = nm->mkNode(kind::BITVECTOR_ADD, node[1], pow_two);
return nm->mkNode(kind::BITVECTOR_ULT, a, b);
}
Node negb = nm->mkNode(kind::BITVECTOR_NEG, node[1]);
Node a = node[0];
- return nm->mkNode(kind::BITVECTOR_PLUS, a, negb);
+ return nm->mkNode(kind::BITVECTOR_ADD, a, negb);
}
template <>
cond1.iteNode(
u,
cond2.iteNode(
- nm->mkNode(kind::BITVECTOR_PLUS, neg_u, t),
- cond3.iteNode(nm->mkNode(kind::BITVECTOR_PLUS, u, t), neg_u))));
+ nm->mkNode(kind::BITVECTOR_ADD, neg_u, t),
+ cond3.iteNode(nm->mkNode(kind::BITVECTOR_ADD, u, t), neg_u))));
return result;
}
cond1.iteNode(
u,
cond2.iteNode(
- nm->mkNode(kind::BITVECTOR_PLUS, neg_u, t),
- cond3.iteNode(nm->mkNode(kind::BITVECTOR_PLUS, u, t), neg_u))));
+ nm->mkNode(kind::BITVECTOR_ADD, neg_u, t),
+ cond3.iteNode(nm->mkNode(kind::BITVECTOR_ADD, u, t), neg_u))));
return result;
}
/* -------------------------------------------------------------------------- */
/**
- * BBPlusNeg
- *
+ * BBAddNeg
+ *
* -a1 - a2 - ... - an + ak + .. ==> - (a1 + a2 + ... + an) + ak
*
*/
-template<> inline
-bool RewriteRule<BBPlusNeg>::applies(TNode node) {
- if (node.getKind() != kind::BITVECTOR_PLUS) {
- return false;
+template <>
+inline bool RewriteRule<BBAddNeg>::applies(TNode node)
+{
+ if (node.getKind() != kind::BITVECTOR_ADD)
+ {
+ return false;
}
unsigned neg_count = 0;
}
template <>
-inline Node RewriteRule<BBPlusNeg>::apply(TNode node)
+inline Node RewriteRule<BBAddNeg>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<BBPlusNeg>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<BBAddNeg>(" << node << ")" << std::endl;
NodeManager *nm = NodeManager::currentNM();
std::vector<Node> children;
unsigned neg_count = 0;
Assert(neg_count != 0);
children.push_back(utils::mkConst(utils::getSize(node), neg_count));
- return utils::mkNaryNode(kind::BITVECTOR_PLUS, children);
+ return utils::mkNaryNode(kind::BITVECTOR_ADD, children);
}
/* -------------------------------------------------------------------------- */
Node term3 = nm->mkNode(kind::BITVECTOR_CONCAT,
nm->mkNode(kind::BITVECTOR_MULT, top_a, bottom_b),
zeros);
- return nm->mkNode(kind::BITVECTOR_PLUS, term1, term2, term3);
+ return nm->mkNode(kind::BITVECTOR_ADD, term1, term2, term3);
}
/* -------------------------------------------------------------------------- */
*
* @return
*/
-template<> inline
-bool RewriteRule<UltPlusOne>::applies(TNode node) {
+template <>
+inline bool RewriteRule<UltAddOne>::applies(TNode node)
+{
if (node.getKind() != kind::BITVECTOR_ULT) return false;
TNode x = node[0];
TNode y1 = node[1];
- if (y1.getKind() != kind::BITVECTOR_PLUS) return false;
+ if (y1.getKind() != kind::BITVECTOR_ADD) return false;
if (y1[0].getKind() != kind::CONST_BITVECTOR &&
y1[1].getKind() != kind::CONST_BITVECTOR)
return false;
TNode one = y1[0].getKind() == kind::CONST_BITVECTOR ? y1[0] : y1[1];
if (one != utils::mkConst(utils::getSize(one), 1)) return false;
- return true;
+ return true;
}
template <>
-inline Node RewriteRule<UltPlusOne>::apply(TNode node)
+inline Node RewriteRule<UltAddOne>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<UltPlusOne>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<UltAddOne>(" << node << ")" << std::endl;
NodeManager *nm = NodeManager::currentNM();
TNode x = node[0];
TNode y1 = node[1];
return false;
TNode addxt, x, a;
- if (ml[0].getKind() == kind::BITVECTOR_PLUS)
+ if (ml[0].getKind() == kind::BITVECTOR_ADD)
{
addxt = ml[0];
a = ml[1];
}
- else if (ml[1].getKind() == kind::BITVECTOR_PLUS)
+ else if (ml[1].getKind() == kind::BITVECTOR_ADD)
{
addxt = ml[1];
a = ml[0];
std::tie(mr[0], mr[1], std::ignore) = extract_ext_tuple(node[1]);
TNode addxt, x, t, a;
- if (ml[0].getKind() == kind::BITVECTOR_PLUS)
+ if (ml[0].getKind() == kind::BITVECTOR_ADD)
{
addxt = ml[0];
a = ml[1];
}
else
{
- Assert(ml[1].getKind() == kind::BITVECTOR_PLUS);
+ Assert(ml[1].getKind() == kind::BITVECTOR_ADD);
addxt = ml[1];
a = ml[0];
}
return RewriteResponse(REWRITE_AGAIN_FULL, resultNode);
}
-RewriteResponse TheoryBVRewriter::RewritePlus(TNode node, bool prerewrite) {
+RewriteResponse TheoryBVRewriter::RewriteAdd(TNode node, bool prerewrite)
+{
Node resultNode = node;
if (prerewrite) {
resultNode = LinearRewriteStrategy
>::apply(node);
return RewriteResponse(REWRITE_DONE, resultNode);
}
-
- resultNode = LinearRewriteStrategy
- < RewriteRule<FlattenAssocCommut>,
- RewriteRule<PlusCombineLikeTerms>
- >::apply(node);
+
+ resultNode =
+ LinearRewriteStrategy<RewriteRule<FlattenAssocCommut>,
+ RewriteRule<AddCombineLikeTerms>>::apply(node);
if (node != resultNode) {
return RewriteResponse(REWRITE_AGAIN_FULL, resultNode);
}
-
- return RewriteResponse(REWRITE_DONE, resultNode);
+
+ return RewriteResponse(REWRITE_DONE, resultNode);
}
RewriteResponse TheoryBVRewriter::RewriteSub(TNode node, bool prerewrite){
RewriteRule<NegIdemp>,
RewriteRule<NegSub>
>::apply(node);
-
- if (RewriteRule<NegPlus>::applies(node)) {
- resultNode = RewriteRule<NegPlus>::run<false>(node);
- return RewriteResponse(REWRITE_AGAIN_FULL, resultNode);
+
+ if (RewriteRule<NegAdd>::applies(node))
+ {
+ resultNode = RewriteRule<NegAdd>::run<false>(node);
+ return RewriteResponse(REWRITE_AGAIN_FULL, resultNode);
}
-
+
if(!prerewrite) {
if (RewriteRule<NegMult>::applies(node)) {
resultNode = RewriteRule<NegMult>::run<false>(node);
d_rewriteTable [ kind::BITVECTOR_NOR ] = RewriteNor;
d_rewriteTable [ kind::BITVECTOR_COMP ] = RewriteComp;
d_rewriteTable [ kind::BITVECTOR_MULT ] = RewriteMult;
- d_rewriteTable [ kind::BITVECTOR_PLUS ] = RewritePlus;
+ d_rewriteTable[kind::BITVECTOR_ADD] = RewriteAdd;
d_rewriteTable [ kind::BITVECTOR_SUB ] = RewriteSub;
d_rewriteTable [ kind::BITVECTOR_NEG ] = RewriteNeg;
d_rewriteTable [ kind::BITVECTOR_UDIV ] = RewriteUdiv;
static RewriteResponse RewriteNor(TNode node, bool prerewrite = false);
static RewriteResponse RewriteComp(TNode node, bool prerewrite = false);
static RewriteResponse RewriteMult(TNode node, bool prerewrite = false);
- static RewriteResponse RewritePlus(TNode node, bool prerewrite = false);
+ static RewriteResponse RewriteAdd(TNode node, bool prerewrite = false);
static RewriteResponse RewriteSub(TNode node, bool prerewrite = false);
static RewriteResponse RewriteNeg(TNode node, bool prerewrite = false);
static RewriteResponse RewriteUdiv(TNode node, bool prerewrite = false);
Node mkInc(TNode t)
{
return NodeManager::currentNM()->mkNode(
- kind::BITVECTOR_PLUS, t, mkOne(getSize(t)));
+ kind::BITVECTOR_ADD, t, mkOne(getSize(t)));
}
Node mkDec(TNode t)
{
Assert(k == kind::AND || k == kind::OR || k == kind::XOR
|| k == kind::BITVECTOR_AND || k == kind::BITVECTOR_OR
- || k == kind::BITVECTOR_XOR || k == kind::BITVECTOR_PLUS
+ || k == kind::BITVECTOR_XOR || k == kind::BITVECTOR_ADD
|| k == kind::BITVECTOR_SUB || k == kind::BITVECTOR_MULT);
if (nodes.size() == 1) { return nodes[0]; }
// (~ (- y z) x) ----> (~ y (+ x z))
rt.d_req_kind = pk;
rt.d_children[arg].d_req_type = dt[c].getArgType(0);
- rt.d_children[oarg].d_req_kind = k == MINUS ? PLUS : BITVECTOR_PLUS;
+ rt.d_children[oarg].d_req_kind = k == MINUS ? PLUS : BITVECTOR_ADD;
rt.d_children[oarg].d_children[0].d_req_type = pdt[pc].getArgType(oarg);
rt.d_children[oarg].d_children[1].d_req_type = dt[c].getArgType(1);
}
- else if (pk == PLUS || pk == BITVECTOR_PLUS)
+ else if (pk == PLUS || pk == BITVECTOR_ADD)
{
// (+ x (- y z)) -----> (- (+ x y) z)
// (+ (- y z) x) -----> (- (+ x y) z)
break;
}
- case kind::BITVECTOR_PLUS:
+ case kind::BITVECTOR_ADD:
{
BitVector res = results[currNode[0]].d_bv;
for (size_t i = 1, end = currNode.getNumChildren(); i < end; i++)
const symbolicBitVector<isSigned> &op) const
{
return symbolicBitVector<isSigned>(
- NodeManager::currentNM()->mkNode(kind::BITVECTOR_PLUS, *this, op));
+ NodeManager::currentNM()->mkNode(kind::BITVECTOR_ADD, *this, op));
}
template <bool isSigned>
symbolicBitVector<isSigned> symbolicBitVector<isSigned>::increment() const
{
return symbolicBitVector<isSigned>(NodeManager::currentNM()->mkNode(
- kind::BITVECTOR_PLUS, *this, one(this->getWidth())));
+ kind::BITVECTOR_ADD, *this, one(this->getWidth())));
}
template <bool isSigned>
return k == NOT || k == EQUAL || k == BITVECTOR_ULT || k == BITVECTOR_SLT
|| k == BITVECTOR_COMP || k == BITVECTOR_NOT || k == BITVECTOR_NEG
|| k == BITVECTOR_CONCAT || k == BITVECTOR_SIGN_EXTEND
- || k == BITVECTOR_PLUS || k == BITVECTOR_MULT || k == BITVECTOR_UREM
+ || k == BITVECTOR_ADD || k == BITVECTOR_MULT || k == BITVECTOR_UREM
|| k == BITVECTOR_UDIV || k == BITVECTOR_AND || k == BITVECTOR_OR
|| k == BITVECTOR_XOR || k == BITVECTOR_LSHR || k == BITVECTOR_ASHR
|| k == BITVECTOR_SHL;
{
t = nm->mkNode(k, t);
}
- else if (litk == EQUAL && k == BITVECTOR_PLUS)
+ else if (litk == EQUAL && k == BITVECTOR_ADD)
{
t = nm->mkNode(BITVECTOR_SUB, t, s);
}
* (or (= t z) (distinct (bvsub s (_ bv1 w)) t))))
* where
* z = 0 with getSize(z) = w */
- Node add = nm->mkNode(BITVECTOR_PLUS, t, t);
+ Node add = nm->mkNode(BITVECTOR_ADD, t, t);
Node sub = nm->mkNode(BITVECTOR_SUB, add, s);
Node a = nm->mkNode(BITVECTOR_AND, sub, s);
scl = nm->mkNode(BITVECTOR_UGE, a, t);
* (or
* (bvuge (bvand (bvsub (bvadd t t) s) s) t) ; eq, synthesized
* (bvult t s)) ; ugt, synthesized */
- Node add = nm->mkNode(BITVECTOR_PLUS, t, t);
+ Node add = nm->mkNode(BITVECTOR_ADD, t, t);
Node sub = nm->mkNode(BITVECTOR_SUB, add, s);
Node a = nm->mkNode(BITVECTOR_AND, sub, s);
Node sceq = nm->mkNode(BITVECTOR_UGE, a, t);
* min is the signed minimum value with getSize(min) = w */
Node min = bv::utils::mkMinSigned(w);
Node shl = nm->mkNode(BITVECTOR_SHL, min, s);
- Node add = nm->mkNode(BITVECTOR_PLUS, t, min);
+ Node add = nm->mkNode(BITVECTOR_ADD, t, min);
scl = nm->mkNode(BITVECTOR_ULT, shl, add);
}
else
Assert(slack.isConst());
// remember the slack value for the asserted literal
d_alit_to_model_slack[lit] = slack;
- ret = nm->mkNode(EQUAL, s, nm->mkNode(BITVECTOR_PLUS, t, slack));
+ ret = nm->mkNode(EQUAL, s, nm->mkNode(BITVECTOR_ADD, t, slack));
Trace("cegqi-bv") << "Slack is " << slack << std::endl;
}
else
else
{
Node bv_one = bv::utils::mkOne(bv::utils::getSize(s));
- ret = nm->mkNode(BITVECTOR_PLUS, s, bv_one).eqNode(t);
+ ret = nm->mkNode(BITVECTOR_ADD, s, bv_one).eqNode(t);
}
}
Trace("cegqi-bv") << "Process " << lit << " as " << ret << std::endl;
return result;
}
}
- else if (n.getKind() == BITVECTOR_MULT || n.getKind() == BITVECTOR_PLUS)
+ else if (n.getKind() == BITVECTOR_MULT || n.getKind() == BITVECTOR_ADD)
{
if (options::cegqiBvLinearize() && contains_pv[n])
{
std::unordered_map<Node, bool>& contains_pv)
{
NodeManager* nm;
- NodeBuilder nb_c(BITVECTOR_PLUS);
- NodeBuilder nb_l(BITVECTOR_PLUS);
+ NodeBuilder nb_c(BITVECTOR_ADD);
+ NodeBuilder nb_l(BITVECTOR_ADD);
BvLinearAttribute is_linear;
bool neg;
nb_c << coeff;
continue;
}
- else if (nc.getKind() == BITVECTOR_PLUS && nc.getAttribute(is_linear))
+ else if (nc.getKind() == BITVECTOR_ADD && nc.getAttribute(is_linear))
{
Assert(isLinearPlus(nc, pv, contains_pv));
Node coeff = utils::getPvCoeff(pv, nc[0]);
}
else
{
- result = nm->mkNode(BITVECTOR_PLUS, pv_mult_coeffs, leafs);
+ result = nm->mkNode(BITVECTOR_ADD, pv_mult_coeffs, leafs);
contains_pv[result] = true;
result.setAttribute(is_linear, true);
}
}
if (child.getAttribute(is_linear) || child == pv)
{
- if (child.getKind() == BITVECTOR_PLUS)
+ if (child.getKind() == BITVECTOR_ADD)
{
Assert(isLinearPlus(child, pv, contains_pv));
coeffs[i] = utils::getPvCoeff(pv, child[0]);
std::unordered_map<Node, bool>& contains_pv);
/**
- * Normalizes the children of a BITVECTOR_PLUS w.r.t. pv. contains_pv marks
+ * Normalizes the children of a BITVECTOR_ADD w.r.t. pv. contains_pv marks
* terms in which pv occurs.
* For example,
*
* be treated as immutable. This is for instance to prevent propagation
* beneath illegal terms. As an example:
* (bvand A (bvor A B)) is equivalent to (bvand A (bvor 1...1 B)), but
- * (bvand A (bvplus A B)) is not equivalent to (bvand A (bvplus 1..1 B)),
+ * (bvand A (bvadd A B)) is not equivalent to (bvand A (bvadd 1..1 B)),
* hence, when using this function to do BCP for bit-vectors, we have that
- * BITVECTOR_AND is a bcp_kind, but BITVECTOR_PLUS is not.
+ * BITVECTOR_AND is a bcp_kind, but BITVECTOR_ADD is not.
*
* If this function returns a non-null node ret, then n ---> ret.
*/
std::vector<Kind> bin_kinds = {BITVECTOR_AND,
BITVECTOR_OR,
BITVECTOR_XOR,
- BITVECTOR_PLUS,
+ BITVECTOR_ADD,
BITVECTOR_SUB,
BITVECTOR_MULT,
BITVECTOR_UDIV,
}
}
return k == PLUS || k == MULT || k == NONLINEAR_MULT || k == AND || k == OR
- || k == XOR || k == BITVECTOR_PLUS || k == BITVECTOR_MULT
+ || k == XOR || k == BITVECTOR_ADD || k == BITVECTOR_MULT
|| k == BITVECTOR_AND || k == BITVECTOR_OR || k == BITVECTOR_XOR
|| k == BITVECTOR_XNOR || k == BITVECTOR_CONCAT || k == STRING_CONCAT
|| k == UNION || k == INTERSECTION || k == JOIN || k == PRODUCT
}
}
return k == EQUAL || k == PLUS || k == MULT || k == NONLINEAR_MULT || k == AND
- || k == OR || k == XOR || k == BITVECTOR_PLUS || k == BITVECTOR_MULT
+ || k == OR || k == XOR || k == BITVECTOR_ADD || k == BITVECTOR_MULT
|| k == BITVECTOR_AND || k == BITVECTOR_OR || k == BITVECTOR_XOR
|| k == BITVECTOR_XNOR || k == UNION || k == INTERSECTION
|| k == SEP_STAR;
else if (tn.isBitVector())
{
val_o = Rewriter::rewrite(
- NodeManager::currentNM()->mkNode(BITVECTOR_PLUS, val, offset_val));
+ NodeManager::currentNM()->mkNode(BITVECTOR_ADD, val, offset_val));
}
}
return val_o;
TypeNode tn = n.getType();
if (n == mkTypeValue(tn, 0))
{
- if (ik == PLUS || ik == OR || ik == XOR || ik == BITVECTOR_PLUS
- || ik == BITVECTOR_OR
- || ik == BITVECTOR_XOR
- || ik == STRING_CONCAT)
+ if (ik == PLUS || ik == OR || ik == XOR || ik == BITVECTOR_ADD
+ || ik == BITVECTOR_OR || ik == BITVECTOR_XOR || ik == STRING_CONCAT)
{
return true;
}
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS, d_x_mul_one, d_y_mul_one),
+ kind::BITVECTOR_ADD, d_x_mul_one, d_y_mul_one),
d_z_mul_one),
d_p),
d_five);
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS, d_x_mul_two, d_y_mul_three),
+ kind::BITVECTOR_ADD, d_x_mul_two, d_y_mul_three),
d_z_mul_five),
d_p),
d_eight);
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS, d_x_mul_four, d_z_mul_five),
+ kind::BITVECTOR_ADD, d_x_mul_four, d_z_mul_five),
d_p),
d_two);
Node p = d_nodeManager->mkNode(
zextop6,
bv::utils::mkConcat(bv::utils::mkZero(6),
- d_nodeManager->mkNode(kind::BITVECTOR_PLUS,
+ d_nodeManager->mkNode(kind::BITVECTOR_ADD,
bv::utils::mkConst(20, 7),
bv::utils::mkConst(20, 4))));
bv::utils::mkExtract(
d_nodeManager->mkNode(
zextop6,
- d_nodeManager->mkNode(kind::BITVECTOR_PLUS, d_three, d_two)),
+ d_nodeManager->mkNode(kind::BITVECTOR_ADD, d_three, d_two)),
31,
0),
d_z);
d_nodeManager->mkNode(
kind::BITVECTOR_UDIV,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_nodeManager->mkNode(kind::BITVECTOR_MULT,
bv::utils::mkConst(32, 4),
bv::utils::mkConst(32, 5)),
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
- d_nodeManager->mkNode(kind::BITVECTOR_PLUS, x_mul_one, y_mul_one),
+ kind::BITVECTOR_ADD,
+ d_nodeManager->mkNode(kind::BITVECTOR_ADD, x_mul_one, y_mul_one),
z_mul_one),
p),
d_five);
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS, x_mul_two, y_mul_three),
+ kind::BITVECTOR_ADD, x_mul_two, y_mul_three),
z_mul_five),
p),
d_eight);
kind::EQUAL,
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
- d_nodeManager->mkNode(kind::BITVECTOR_PLUS, x_mul_four, z_mul_five),
+ d_nodeManager->mkNode(kind::BITVECTOR_ADD, x_mul_four, z_mul_five),
d_p),
d_two);
kind::EQUAL,
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
- d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS, d_x_mul_one, d_z_mul_nine),
+ d_nodeManager->mkNode(kind::BITVECTOR_ADD, d_x_mul_one, d_z_mul_nine),
d_p),
d_seven);
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS, d_y_mul_one, d_z_mul_three),
+ kind::BITVECTOR_ADD, d_y_mul_one, d_z_mul_three),
d_p),
d_nine);
Node x1 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_seven32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_z, d_two32)),
d_p);
Node y1 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_nine32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_z, d_eight32)),
d_p);
Node x2 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_two32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_y, d_three32)),
d_p);
Node z2 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_three32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_y, d_seven32)),
d_p);
Node y3 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_three32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_x, d_four32)),
d_p);
Node z3 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_two32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_x, d_six32)),
d_p);
kind::EQUAL,
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
- d_nodeManager->mkNode(kind::BITVECTOR_PLUS, d_x, d_z_mul_nine),
+ d_nodeManager->mkNode(kind::BITVECTOR_ADD, d_x, d_z_mul_nine),
d_p),
d_seven);
kind::EQUAL,
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
- d_nodeManager->mkNode(kind::BITVECTOR_PLUS, d_y, d_z_mul_three),
+ d_nodeManager->mkNode(kind::BITVECTOR_ADD, d_y, d_z_mul_three),
d_p),
d_nine);
Node x1 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_seven32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_z, d_two32)),
d_p);
Node y1 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_nine32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_z, d_eight32)),
d_p);
Node x2 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_two32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_y, d_three32)),
d_p);
Node z2 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_three32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_y, d_seven32)),
d_p);
Node y3 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_three32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_x, d_four32)),
d_p);
Node z3 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_two32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_x, d_six32)),
d_p);
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS, d_x_mul_one, d_y_mul_three),
+ kind::BITVECTOR_ADD, d_x_mul_one, d_y_mul_three),
d_p),
d_seven);
Node x1 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_seven32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_y, d_eight32)),
d_p);
Node y2 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_six32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_x, d_seven32)),
d_p);
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
- d_nodeManager->mkNode(kind::BITVECTOR_PLUS, d_x_mul_one, d_y),
+ kind::BITVECTOR_ADD,
+ d_nodeManager->mkNode(kind::BITVECTOR_ADD, d_x_mul_one, d_y),
d_z_mul_one),
d_p),
d_five);
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS, d_x_mul_two, d_y_mul_three),
+ kind::BITVECTOR_ADD, d_x_mul_two, d_y_mul_three),
d_z_mul_five),
d_p),
d_eight);
Node x1 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_seven32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_z, d_two32)),
d_p);
Node y1 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_nine32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_z, d_eight32)),
d_p);
Node x2 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_two32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_y, d_three32)),
d_p);
Node z2 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_three32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_y, d_seven32)),
d_p);
Node y3 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_three32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_x, d_four32)),
d_p);
Node z3 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_two32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_x, d_six32)),
d_p);
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS, d_x_mul_two, d_y_mul_four),
+ kind::BITVECTOR_ADD, d_x_mul_two, d_y_mul_four),
d_z_mul_six),
d_p),
d_eighteen);
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS, d_x_mul_four, d_y_mul_five),
+ kind::BITVECTOR_ADD, d_x_mul_four, d_y_mul_five),
d_z_mul_six),
d_p),
d_twentyfour);
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS, d_x_mul_two, d_y_mul_seven),
+ kind::BITVECTOR_ADD, d_x_mul_two, d_y_mul_seven),
d_z_mul_twelve),
d_p),
d_thirty);
Node x1 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_one32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_z, d_one32)),
d_p);
Node y1 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_four32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_z, d_nine32)),
d_p);
Node x2 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_three32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_y, d_five32)),
d_p);
Node z2 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_two32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_y, d_five32)),
d_p);
Node y3 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_six32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_x, d_nine32)),
d_p);
Node z3 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_ten32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_x, d_one32)),
d_p);
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS, d_x_mul_two, d_y_mul_four),
+ kind::BITVECTOR_ADD, d_x_mul_two, d_y_mul_four),
d_z_mul_six),
d_three),
d_eighteen);
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS, d_x_mul_four, d_y_mul_five),
+ kind::BITVECTOR_ADD, d_x_mul_four, d_y_mul_five),
d_z_mul_six),
d_three),
d_twentyfour);
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS, d_x_mul_two, d_y_mul_seven),
+ kind::BITVECTOR_ADD, d_x_mul_two, d_y_mul_seven),
d_z_mul_twelve),
d_three),
d_thirty);
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS, d_x_mul_one, y_mul_two),
+ kind::BITVECTOR_ADD, d_x_mul_one, y_mul_two),
w_mul_six),
d_p),
d_two);
kind::EQUAL,
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
- d_nodeManager->mkNode(kind::BITVECTOR_PLUS, z_mul_two, w_mul_two),
+ d_nodeManager->mkNode(kind::BITVECTOR_ADD, z_mul_two, w_mul_two),
d_p),
d_two);
Node x1 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_one32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_y, d_nine32)),
d_p);
Node y2 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_six32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_x, d_five32)),
d_p);
kind::EQUAL,
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
- d_nodeManager->mkNode(kind::BITVECTOR_PLUS, x_mul_one, nine_mul_z),
+ d_nodeManager->mkNode(kind::BITVECTOR_ADD, x_mul_one, nine_mul_z),
d_p),
d_seven);
kind::EQUAL,
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
- d_nodeManager->mkNode(kind::BITVECTOR_PLUS, one_mul_y, z_mul_three),
+ d_nodeManager->mkNode(kind::BITVECTOR_ADD, one_mul_y, z_mul_three),
d_p),
d_nine);
Node x1 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_seven32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, z, d_two32)),
d_p);
Node y1 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_nine32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, z, d_eight32)),
d_p);
Node x2 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_two32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, y, d_three32)),
d_p);
Node z2 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_three32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, y, d_seven32)),
d_p);
Node y3 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_three32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, x, d_four32)),
d_p);
Node z3 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_two32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, x, d_six32)),
d_p);
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS, x_mul_one_mul_xx, z_mul_nine_mul_zz),
+ kind::BITVECTOR_ADD, x_mul_one_mul_xx, z_mul_nine_mul_zz),
d_p),
d_seven);
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS, y_mul_yy_mul_one, three_mul_z_mul_zz),
+ kind::BITVECTOR_ADD, y_mul_yy_mul_one, three_mul_z_mul_zz),
d_p),
d_nine);
Node x1 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_seven32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, z_mul_zz, d_two32)),
d_p);
Node y1 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_nine32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, z_mul_zz, d_eight32)),
d_p);
Node x2 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_two32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, y_mul_yy, d_three32)),
d_p);
Node z2 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_three32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, y_mul_yy, d_seven32)),
d_p);
Node y3 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_three32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, x_mul_xx, d_four32)),
d_p);
Node z3 = d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_two32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, x_mul_xx, d_six32)),
d_p);
d_nodeManager->mkNode(kind::BITVECTOR_MULT, x, y),
z);
Node n3 = d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_nodeManager->mkNode(kind::BITVECTOR_MULT,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, x, y),
bv::utils::mkConcat(d_zero, d_two)),
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS, d_x_mul_one, d_y_mul_one),
+ kind::BITVECTOR_ADD, d_x_mul_one, d_y_mul_one),
d_z_mul_one),
d_p),
d_five);
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS, d_x_mul_two, d_y_mul_three),
+ kind::BITVECTOR_ADD, d_x_mul_two, d_y_mul_three),
d_z_mul_five),
d_p),
d_eight);
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS, d_x_mul_four, d_z_mul_five),
+ kind::BITVECTOR_ADD, d_x_mul_four, d_z_mul_five),
d_p),
d_two);
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS, d_x_mul_one, d_y_mul_one),
+ kind::BITVECTOR_ADD, d_x_mul_one, d_y_mul_one),
d_z_mul_one),
d_p),
d_five);
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS, d_x_mul_two, d_y_mul_three),
+ kind::BITVECTOR_ADD, d_x_mul_two, d_y_mul_three),
d_z_mul_five),
d_p),
d_eight);
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS, d_x_mul_four, d_z_mul_five),
+ kind::BITVECTOR_ADD, d_x_mul_four, d_z_mul_five),
d_p),
d_two);
kind::EQUAL,
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
- d_nodeManager->mkNode(kind::BITVECTOR_PLUS, d_x_mul_two, y_mul_six),
+ d_nodeManager->mkNode(kind::BITVECTOR_ADD, d_x_mul_two, y_mul_six),
d_seven),
d_four);
kind::EQUAL,
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
- d_nodeManager->mkNode(kind::BITVECTOR_PLUS, d_x_mul_four, y_mul_six),
+ d_nodeManager->mkNode(kind::BITVECTOR_ADD, d_x_mul_four, y_mul_six),
d_seven),
d_three);
kind::EQUAL,
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
- d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS, d_x_mul_one, d_z_mul_nine),
+ d_nodeManager->mkNode(kind::BITVECTOR_ADD, d_x_mul_one, d_z_mul_nine),
d_p),
d_seven);
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS, d_y_mul_one, d_z_mul_three),
+ kind::BITVECTOR_ADD, d_y_mul_one, d_z_mul_three),
d_p),
d_nine);
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_seven32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_z, d_two32)),
d_p));
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_nine32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_z, d_eight32)),
d_p));
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_two32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_y, d_three32)),
d_p));
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_three32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_y, d_seven32)),
d_p));
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_three32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_x, d_four32)),
d_p));
d_nodeManager->mkNode(
kind::BITVECTOR_UREM,
d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_two32,
d_nodeManager->mkNode(kind::BITVECTOR_MULT, d_x, d_six32)),
d_p));
Node urem3x = d_nodeManager->mkNode(kind::BITVECTOR_UREM, zext48x8, zext48x);
ASSERT_EQ(BVGauss::getMinBwExpr(urem3x), 8);
- Node add1p = d_nodeManager->mkNode(kind::BITVECTOR_PLUS, extp, extp);
+ Node add1p = d_nodeManager->mkNode(kind::BITVECTOR_ADD, extp, extp);
ASSERT_EQ(BVGauss::getMinBwExpr(add1p), 5);
- Node add1x = d_nodeManager->mkNode(kind::BITVECTOR_PLUS, extx, extx);
+ Node add1x = d_nodeManager->mkNode(kind::BITVECTOR_ADD, extx, extx);
ASSERT_EQ(BVGauss::getMinBwExpr(add1x), 0);
- Node add2p = d_nodeManager->mkNode(kind::BITVECTOR_PLUS, zext40p, zext40p);
+ Node add2p = d_nodeManager->mkNode(kind::BITVECTOR_ADD, zext40p, zext40p);
ASSERT_EQ(BVGauss::getMinBwExpr(add2p), 5);
- Node add2x = d_nodeManager->mkNode(kind::BITVECTOR_PLUS, zext40x, zext40x);
+ Node add2x = d_nodeManager->mkNode(kind::BITVECTOR_ADD, zext40x, zext40x);
ASSERT_EQ(BVGauss::getMinBwExpr(add2x), 17);
- Node add3p = d_nodeManager->mkNode(kind::BITVECTOR_PLUS, zext48p8, zext48p);
+ Node add3p = d_nodeManager->mkNode(kind::BITVECTOR_ADD, zext48p8, zext48p);
ASSERT_EQ(BVGauss::getMinBwExpr(add3p), 5);
- Node add3x = d_nodeManager->mkNode(kind::BITVECTOR_PLUS, zext48x8, zext48x);
+ Node add3x = d_nodeManager->mkNode(kind::BITVECTOR_ADD, zext48x8, zext48x);
ASSERT_EQ(BVGauss::getMinBwExpr(add3x), 17);
- NodeBuilder nbadd4p(kind::BITVECTOR_PLUS);
+ NodeBuilder nbadd4p(kind::BITVECTOR_ADD);
nbadd4p << zext48p << zext48p << zext48p;
Node add4p = nbadd4p;
ASSERT_EQ(BVGauss::getMinBwExpr(add4p), 6);
- NodeBuilder nbadd4x(kind::BITVECTOR_PLUS);
+ NodeBuilder nbadd4x(kind::BITVECTOR_ADD);
nbadd4x << zext48x << zext48x << zext48x;
Node add4x = nbadd4x;
ASSERT_EQ(BVGauss::getMinBwExpr(add4x), 18);
- NodeBuilder nbadd5p(kind::BITVECTOR_PLUS);
+ NodeBuilder nbadd5p(kind::BITVECTOR_ADD);
nbadd5p << zext48p << zext48p8 << zext48p;
Node add5p = nbadd5p;
ASSERT_EQ(BVGauss::getMinBwExpr(add5p), 6);
- NodeBuilder nbadd5x(kind::BITVECTOR_PLUS);
+ NodeBuilder nbadd5x(kind::BITVECTOR_ADD);
nbadd5x << zext48x << zext48x8 << zext48x;
Node add5x = nbadd5x;
ASSERT_EQ(BVGauss::getMinBwExpr(add5x), 18);
- NodeBuilder nbadd6p(kind::BITVECTOR_PLUS);
+ NodeBuilder nbadd6p(kind::BITVECTOR_ADD);
nbadd6p << zext48p << zext48p << zext48p << zext48p;
Node add6p = nbadd6p;
ASSERT_EQ(BVGauss::getMinBwExpr(add6p), 6);
- NodeBuilder nbadd6x(kind::BITVECTOR_PLUS);
+ NodeBuilder nbadd6x(kind::BITVECTOR_ADD);
nbadd6x << zext48x << zext48x << zext48x << zext48x;
Node add6x = nbadd6x;
ASSERT_EQ(BVGauss::getMinBwExpr(add6x), 18);
Node udiv2_2 = d_nodeManager->mkNode(kind::BITVECTOR_UDIV, ext1_2, ext2_2);
Node zext2_2 = d_nodeManager->mkNode(zextop7, udiv2_2);
- Node plus = d_nodeManager->mkNode(kind::BITVECTOR_PLUS, zext2_1, zext2_2);
+ Node plus = d_nodeManager->mkNode(kind::BITVECTOR_ADD, zext2_1, zext2_2);
ASSERT_EQ(BVGauss::getMinBwExpr(plus), 6);
}
Node udiv2_2 = d_nodeManager->mkNode(kind::BITVECTOR_UDIV, ext1_2, ext2_2);
Node zext2_2 = d_nodeManager->mkNode(zextop7, udiv2_2);
- Node plus = d_nodeManager->mkNode(kind::BITVECTOR_PLUS, zext2_1, zext2_2);
+ Node plus = d_nodeManager->mkNode(kind::BITVECTOR_ADD, zext2_1, zext2_2);
ASSERT_EQ(BVGauss::getMinBwExpr(plus), 6);
}
Node s15 = bv::utils::mkConcat(bv::utils::mkZero(5), ext15s);
Node plus1 = d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_nodeManager->mkNode(
kind::BITVECTOR_MULT, bv::utils::mkConst(13, 86), xx),
d_nodeManager->mkNode(
kind::BITVECTOR_MULT, bv::utils::mkConst(13, 41), yy));
Node plus2 = d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
plus1,
d_nodeManager->mkNode(
kind::BITVECTOR_MULT, bv::utils::mkConst(13, 37), zz));
Node plus3 = d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
plus2,
d_nodeManager->mkNode(
kind::BITVECTOR_MULT, bv::utils::mkConst(13, 170), uu));
Node plus4 = d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
plus3,
d_nodeManager->mkNode(
kind::BITVECTOR_MULT, bv::utils::mkConst(13, 112), uu));
Node plus5 = d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
plus4,
d_nodeManager->mkNode(
kind::BITVECTOR_MULT, bv::utils::mkConst(13, 195), s15));
Node plus6 = d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
plus5,
d_nodeManager->mkNode(
kind::BITVECTOR_MULT, bv::utils::mkConst(13, 124), s7));
Node plus7 = d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
plus6,
d_nodeManager->mkNode(
kind::BITVECTOR_MULT, bv::utils::mkConst(13, 83), ww));
Node s15 = bv::utils::mkConcat(bv::utils::mkZero(12), ext15s);
Node plus1 = d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
d_nodeManager->mkNode(
kind::BITVECTOR_MULT, bv::utils::mkConst(20, 86), xx),
d_nodeManager->mkNode(
kind::BITVECTOR_MULT, bv::utils::mkConst(20, 41), yy));
Node plus2 = d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
plus1,
d_nodeManager->mkNode(
kind::BITVECTOR_MULT, bv::utils::mkConst(20, 37), zz));
Node plus3 = d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
plus2,
d_nodeManager->mkNode(
kind::BITVECTOR_MULT, bv::utils::mkConst(20, 170), uu));
Node plus4 = d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
plus3,
d_nodeManager->mkNode(
kind::BITVECTOR_MULT, bv::utils::mkConst(20, 112), uu));
Node plus5 = d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
plus4,
d_nodeManager->mkNode(
kind::BITVECTOR_MULT, bv::utils::mkConst(20, 195), s15));
Node plus6 = d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
plus5,
d_nodeManager->mkNode(
kind::BITVECTOR_MULT, bv::utils::mkConst(20, 124), s7));
Node plus7 = d_nodeManager->mkNode(
- kind::BITVECTOR_PLUS,
+ kind::BITVECTOR_ADD,
plus6,
d_nodeManager->mkNode(
kind::BITVECTOR_MULT, bv::utils::mkConst(20, 83), ww));
Node x = d_nodeManager->mkVar("x", d_nodeManager->mkBitVectorType(16));
Node y = d_nodeManager->mkVar("y", d_nodeManager->mkBitVectorType(16));
- Node x_plus_y = d_nodeManager->mkNode(kind::BITVECTOR_PLUS, x, y);
+ Node x_plus_y = d_nodeManager->mkNode(kind::BITVECTOR_ADD, x, y);
Node one = d_nodeManager->mkConst<BitVector>(BitVector(16, 1u));
Node x_shl_one = d_nodeManager->mkNode(kind::BITVECTOR_SHL, x, one);
Node eq = d_nodeManager->mkNode(kind::EQUAL, x_plus_y, x_shl_one);
Node mkPlus(TNode a, TNode b)
{
- return d_nodeManager->mkNode(kind::BITVECTOR_PLUS, a, b);
+ return d_nodeManager->mkNode(kind::BITVECTOR_ADD, a, b);
}
Node mkPlus(const std::vector<Node>& children)
{
- return d_nodeManager->mkNode(kind::BITVECTOR_PLUS, children);
+ return d_nodeManager->mkNode(kind::BITVECTOR_ADD, children);
}
};
Node norm_xa = normalizePvPlus(x, {x, a}, contains_x);
ASSERT_TRUE(contains_x[norm_xa]);
ASSERT_TRUE(norm_xa.getAttribute(is_linear));
- ASSERT_EQ(norm_xa.getKind(), kind::BITVECTOR_PLUS);
+ ASSERT_EQ(norm_xa.getKind(), kind::BITVECTOR_ADD);
ASSERT_EQ(norm_xa.getNumChildren(), 2);
ASSERT_EQ(norm_xa[0], x);
ASSERT_EQ(norm_xa[1], a);
Node norm_ax = normalizePvPlus(x, {a, x}, contains_x);
ASSERT_TRUE(contains_x[norm_ax]);
ASSERT_TRUE(norm_ax.getAttribute(is_linear));
- ASSERT_EQ(norm_ax.getKind(), kind::BITVECTOR_PLUS);
+ ASSERT_EQ(norm_ax.getKind(), kind::BITVECTOR_ADD);
ASSERT_EQ(norm_ax.getNumChildren(), 2);
ASSERT_EQ(norm_ax[0], x);
ASSERT_EQ(norm_ax[1], a);
Node norm_neg_ax = normalizePvPlus(x, {a, neg_x}, contains_x);
ASSERT_TRUE(contains_x[norm_neg_ax]);
ASSERT_TRUE(norm_neg_ax.getAttribute(is_linear));
- ASSERT_EQ(norm_neg_ax.getKind(), kind::BITVECTOR_PLUS);
+ ASSERT_EQ(norm_neg_ax.getKind(), kind::BITVECTOR_ADD);
ASSERT_EQ(norm_neg_ax.getNumChildren(), 2);
ASSERT_EQ(norm_neg_ax[0].getKind(), kind::BITVECTOR_MULT);
ASSERT_EQ(norm_neg_ax[0].getNumChildren(), 2);
Node norm_abcxd = normalizePvPlus(x, {a, b, c, x, d}, contains_x);
ASSERT_TRUE(contains_x[norm_abcxd]);
ASSERT_TRUE(norm_abcxd.getAttribute(is_linear));
- ASSERT_EQ(norm_abcxd.getKind(), kind::BITVECTOR_PLUS);
+ ASSERT_EQ(norm_abcxd.getKind(), kind::BITVECTOR_ADD);
ASSERT_EQ(norm_abcxd.getNumChildren(), 2);
ASSERT_EQ(norm_abcxd[0], x);
ASSERT_EQ(norm_abcxd[1], Rewriter::rewrite(mkPlus({a, b, c, d})));
Node norm_neg_abcxd = normalizePvPlus(x, {a, b, c, neg_x, d}, contains_x);
ASSERT_TRUE(contains_x[norm_neg_abcxd]);
ASSERT_TRUE(norm_neg_abcxd.getAttribute(is_linear));
- ASSERT_EQ(norm_neg_abcxd.getKind(), kind::BITVECTOR_PLUS);
+ ASSERT_EQ(norm_neg_abcxd.getKind(), kind::BITVECTOR_ADD);
ASSERT_EQ(norm_neg_abcxd.getNumChildren(), 2);
ASSERT_EQ(norm_neg_abcxd[0].getKind(), kind::BITVECTOR_MULT);
ASSERT_EQ(norm_neg_abcxd[0].getNumChildren(), 2);
Node norm_bxa = normalizePvPlus(x, {b, norm_ax}, contains_x);
ASSERT_TRUE(contains_x[norm_bxa]);
ASSERT_TRUE(norm_bxa.getAttribute(is_linear));
- ASSERT_EQ(norm_bxa.getKind(), kind::BITVECTOR_PLUS);
+ ASSERT_EQ(norm_bxa.getKind(), kind::BITVECTOR_ADD);
ASSERT_EQ(norm_bxa.getNumChildren(), 2);
ASSERT_EQ(norm_bxa[0], x);
ASSERT_EQ(norm_bxa[1], Rewriter::rewrite(mkPlus(b, a)));
Node norm_neg_bxa = normalizePvPlus(x, {b, neg_norm_ax}, contains_x);
ASSERT_TRUE(contains_x[norm_neg_bxa]);
ASSERT_TRUE(norm_neg_bxa.getAttribute(is_linear));
- ASSERT_EQ(norm_neg_bxa.getKind(), kind::BITVECTOR_PLUS);
+ ASSERT_EQ(norm_neg_bxa.getKind(), kind::BITVECTOR_ADD);
ASSERT_EQ(norm_neg_bxa.getNumChildren(), 2);
ASSERT_EQ(norm_neg_abcxd[0].getKind(), kind::BITVECTOR_MULT);
ASSERT_EQ(norm_neg_abcxd[0].getNumChildren(), 2);
TEST_F(TestTheoryWhiteQuantifiersBvInverter, getIC_bv_plus_ult_true0)
{
- Node x = d_nodeManager->mkNode(BITVECTOR_PLUS, d_x, d_s);
+ Node x = d_nodeManager->mkNode(BITVECTOR_ADD, d_x, d_s);
runTestPred(true, BITVECTOR_ULT, x, getICBvUltUgt);
}
TEST_F(TestTheoryWhiteQuantifiersBvInverter, getIC_bv_plus_ult_true1)
{
- Node x = d_nodeManager->mkNode(BITVECTOR_PLUS, d_s, d_x);
+ Node x = d_nodeManager->mkNode(BITVECTOR_ADD, d_s, d_x);
runTestPred(true, BITVECTOR_ULT, x, getICBvUltUgt);
}
TEST_F(TestTheoryWhiteQuantifiersBvInverter, getIC_bv_plus_ult_false0)
{
- Node x = d_nodeManager->mkNode(BITVECTOR_PLUS, d_x, d_s);
+ Node x = d_nodeManager->mkNode(BITVECTOR_ADD, d_x, d_s);
runTestPred(false, BITVECTOR_ULT, x, getICBvUltUgt);
}
TEST_F(TestTheoryWhiteQuantifiersBvInverter, getIC_bv_plus_ult_false1)
{
- Node x = d_nodeManager->mkNode(BITVECTOR_PLUS, d_s, d_x);
+ Node x = d_nodeManager->mkNode(BITVECTOR_ADD, d_s, d_x);
runTestPred(false, BITVECTOR_ULT, x, getICBvUltUgt);
}
TEST_F(TestTheoryWhiteQuantifiersBvInverter, getIC_bv_plus_ugt_true0)
{
- Node x = d_nodeManager->mkNode(BITVECTOR_PLUS, d_x, d_s);
+ Node x = d_nodeManager->mkNode(BITVECTOR_ADD, d_x, d_s);
runTestPred(true, BITVECTOR_UGT, x, getICBvUltUgt);
}
TEST_F(TestTheoryWhiteQuantifiersBvInverter, getIC_bv_plus_ugt_true1)
{
- Node x = d_nodeManager->mkNode(BITVECTOR_PLUS, d_s, d_x);
+ Node x = d_nodeManager->mkNode(BITVECTOR_ADD, d_s, d_x);
runTestPred(true, BITVECTOR_UGT, x, getICBvUltUgt);
}
TEST_F(TestTheoryWhiteQuantifiersBvInverter, getIC_bv_plus_ugt_false0)
{
- Node x = d_nodeManager->mkNode(BITVECTOR_PLUS, d_x, d_s);
+ Node x = d_nodeManager->mkNode(BITVECTOR_ADD, d_x, d_s);
runTestPred(false, BITVECTOR_UGT, x, getICBvUltUgt);
}
TEST_F(TestTheoryWhiteQuantifiersBvInverter, getIC_bv_plus_ugt_false1)
{
- Node x = d_nodeManager->mkNode(BITVECTOR_PLUS, d_s, d_x);
+ Node x = d_nodeManager->mkNode(BITVECTOR_ADD, d_s, d_x);
runTestPred(false, BITVECTOR_UGT, x, getICBvUltUgt);
}
TEST_F(TestTheoryWhiteQuantifiersBvInverter, getIC_bv_plus_slt_true0)
{
- Node x = d_nodeManager->mkNode(BITVECTOR_PLUS, d_x, d_s);
+ Node x = d_nodeManager->mkNode(BITVECTOR_ADD, d_x, d_s);
runTestPred(true, BITVECTOR_SLT, x, getICBvSltSgt);
}
TEST_F(TestTheoryWhiteQuantifiersBvInverter, getIC_bv_plus_slt_true1)
{
- Node x = d_nodeManager->mkNode(BITVECTOR_PLUS, d_s, d_x);
+ Node x = d_nodeManager->mkNode(BITVECTOR_ADD, d_s, d_x);
runTestPred(true, BITVECTOR_SLT, x, getICBvSltSgt);
}
TEST_F(TestTheoryWhiteQuantifiersBvInverter, getIC_bv_plus_slt_false0)
{
- Node x = d_nodeManager->mkNode(BITVECTOR_PLUS, d_x, d_s);
+ Node x = d_nodeManager->mkNode(BITVECTOR_ADD, d_x, d_s);
runTestPred(false, BITVECTOR_SLT, x, getICBvSltSgt);
}
TEST_F(TestTheoryWhiteQuantifiersBvInverter, getIC_bv_plus_slt_false1)
{
- Node x = d_nodeManager->mkNode(BITVECTOR_PLUS, d_s, d_x);
+ Node x = d_nodeManager->mkNode(BITVECTOR_ADD, d_s, d_x);
runTestPred(false, BITVECTOR_SLT, x, getICBvSltSgt);
}
TEST_F(TestTheoryWhiteQuantifiersBvInverter, getIC_bv_plus_sgt_true0)
{
- Node x = d_nodeManager->mkNode(BITVECTOR_PLUS, d_x, d_s);
+ Node x = d_nodeManager->mkNode(BITVECTOR_ADD, d_x, d_s);
runTestPred(true, BITVECTOR_SGT, x, getICBvSltSgt);
}
TEST_F(TestTheoryWhiteQuantifiersBvInverter, getIC_bv_plus_sgt_true1)
{
- Node x = d_nodeManager->mkNode(BITVECTOR_PLUS, d_s, d_x);
+ Node x = d_nodeManager->mkNode(BITVECTOR_ADD, d_s, d_x);
runTestPred(true, BITVECTOR_SGT, x, getICBvSltSgt);
}
TEST_F(TestTheoryWhiteQuantifiersBvInverter, getIC_bv_plus_sgt_false0)
{
- Node x = d_nodeManager->mkNode(BITVECTOR_PLUS, d_x, d_s);
+ Node x = d_nodeManager->mkNode(BITVECTOR_ADD, d_x, d_s);
runTestPred(false, BITVECTOR_SGT, x, getICBvSltSgt);
}
TEST_F(TestTheoryWhiteQuantifiersBvInverter, getIC_bv_plus_sgt_false1)
{
- Node x = d_nodeManager->mkNode(BITVECTOR_PLUS, d_s, d_x);
+ Node x = d_nodeManager->mkNode(BITVECTOR_ADD, d_s, d_x);
runTestPred(false, BITVECTOR_SGT, x, getICBvSltSgt);
}