With this PR, CI passes when using CONST_INTEGER instead of (all) integral CONST_RATIONAL.
This does not make this change yet, so CONST_RATIONAL is still used throughout.
{
case internal::Kind::CAST_TO_REAL:
return node[0].getConst<internal::Rational>();
+ case internal::Kind::CONST_INTEGER:
case internal::Kind::CONST_RATIONAL:
return node.getConst<internal::Rational>();
default:
bool isReal(const internal::Node& node)
{
return node.getKind() == internal::Kind::CONST_RATIONAL
+ || node.getKind() == internal::Kind::CONST_INTEGER
|| node.getKind() == internal::Kind::CAST_TO_REAL;
}
bool isReal32(const internal::Node& node)
bool isInteger(const internal::Node& node)
{
- return node.getKind() == internal::Kind::CONST_RATIONAL
+ return (node.getKind() == internal::Kind::CONST_RATIONAL
+ || node.getKind() == internal::Kind::CONST_INTEGER)
&& node.getConst<internal::Rational>().isIntegral();
}
bool isInt32(const internal::Node& node)
// constructors. We do this cast using division with 1. This has the
// advantage wrt using TO_REAL since (constant) division is always included
// in the theory.
- res = Term(
- this,
- d_nodeMgr->mkNode(extToIntKind(DIVISION),
- *res.d_node,
- d_nodeMgr->mkConst(internal::kind::CONST_RATIONAL,
- internal::Rational(1))));
+ res = Term(this,
+ d_nodeMgr->mkNode(extToIntKind(DIVISION),
+ *res.d_node,
+ d_nodeMgr->mkConstInt(internal::Rational(1))));
}
Assert(res.getSort() == sort);
return res;
Node NodeManager::mkConstReal(const Rational& r)
{
+ // works with (r.isIntegral() ? kind::CONST_INTEGER : kind::CONST_RATIONAL)
return mkConst(kind::CONST_RATIONAL, r);
}
if (!m.isNull())
{
Kind k = m.getKind();
- Assert(k != CONST_RATIONAL);
+ Assert(k != CONST_RATIONAL && k != CONST_INTEGER);
if (k == MULT || k == NONLINEAR_MULT)
{
vars.insert(vars.end(), m.begin(), m.end());
Kind k = cur.getKind();
if (it == visited.end())
{
- if (k == CONST_RATIONAL)
+ if (k == CONST_RATIONAL || k == CONST_INTEGER)
{
Rational r = cur.getConst<Rational>();
if (r.sgn() == 0)
}
}
break;
- case CONST_RATIONAL: break;
+ case CONST_RATIONAL:
+ case CONST_INTEGER: break;
default: Unhandled() << "Unhandled polynomial operation " << cur; break;
}
}
}
// left |><| right
Kind kind = atom.getKind();
- Node left = removeToReal(atom[0]);
- Node right = removeToReal(atom[1]);
+ Node left = rewriter::removeToReal(atom[0]);
+ Node right = rewriter::removeToReal(atom[1]);
if (auto response = rewriter::tryEvaluateRelationReflexive(kind, left, right);
response)
rewriter::addToSum(sum, child);
}
Node retSum = rewriter::collectSum(sum);
- retSum = maybeEnsureReal(t.getType(), retSum);
+ retSum = rewriter::maybeEnsureReal(t.getType(), retSum);
return RewriteResponse(REWRITE_DONE, retSum);
}
if (auto res = rewriter::getZeroChild(node); res)
{
- return RewriteResponse(REWRITE_DONE, maybeEnsureReal(node.getType(), *res));
+ return RewriteResponse(REWRITE_DONE,
+ rewriter::maybeEnsureReal(node.getType(), *res));
}
return RewriteResponse(REWRITE_DONE, node);
}
if (auto res = rewriter::getZeroChild(children); res)
{
- return RewriteResponse(REWRITE_DONE, maybeEnsureReal(t.getType(), *res));
+ return RewriteResponse(REWRITE_DONE,
+ rewriter::maybeEnsureReal(t.getType(), *res));
}
Node ret;
if (child.getConst<Rational>().isZero())
{
return RewriteResponse(REWRITE_DONE,
- maybeEnsureReal(t.getType(), child));
+ rewriter::maybeEnsureReal(t.getType(), child));
}
ran *= child.getConst<Rational>();
}
}
ret = rewriter::mkMultTerm(ran, std::move(leafs));
}
- ret = maybeEnsureReal(t.getType(), ret);
+ ret = rewriter::maybeEnsureReal(t.getType(), ret);
return RewriteResponse(REWRITE_DONE, ret);
}
Assert(t.getKind() == kind::DIVISION_TOTAL || t.getKind() == kind::DIVISION);
Assert(t.getNumChildren() == 2);
- Node left = removeToReal(t[0]);
- Node right = removeToReal(t[1]);
+ Node left = rewriter::removeToReal(t[0]);
+ Node right = rewriter::removeToReal(t[1]);
NodeManager* nm = NodeManager::currentNM();
if (right.isConst())
{
}
Node result = nm->mkConstReal(den.inverse());
- Node mult =
- ensureReal(NodeManager::currentNM()->mkNode(kind::MULT, left, result));
+ Node mult = rewriter::ensureReal(
+ NodeManager::currentNM()->mkNode(kind::MULT, left, result));
if (pre)
{
return RewriteResponse(REWRITE_DONE, mult);
// mkConst is applied to RAN in this block, which are always Real
if (left.isConst())
{
- return RewriteResponse(
- REWRITE_DONE,
- ensureReal(rewriter::mkConst(left.getConst<Rational>() / den)));
+ return RewriteResponse(REWRITE_DONE,
+ rewriter::ensureReal(rewriter::mkConst(
+ left.getConst<Rational>() / den)));
}
if (rewriter::isRAN(left))
{
- return RewriteResponse(
- REWRITE_DONE,
- ensureReal(rewriter::mkConst(rewriter::getRAN(left) / den)));
+ return RewriteResponse(REWRITE_DONE,
+ rewriter::ensureReal(rewriter::mkConst(
+ rewriter::getRAN(left) / den)));
}
Node result = rewriter::mkConst(inverse(den));
- Node mult =
- ensureReal(NodeManager::currentNM()->mkNode(kind::MULT, left, result));
+ Node mult = rewriter::ensureReal(
+ NodeManager::currentNM()->mkNode(kind::MULT, left, result));
if (pre)
{
return RewriteResponse(REWRITE_DONE, mult);
return ret;
}
-TNode ArithRewriter::removeToReal(TNode t)
-{
- return t.getKind() == kind::TO_REAL ? t[0] : t;
-}
-
-Node ArithRewriter::maybeEnsureReal(TypeNode tn, TNode t)
-{
- // if we require being a real
- if (!tn.isInteger())
- {
- // ensure that t has type real
- Assert(tn.isReal());
- return ensureReal(t);
- }
- return t;
-}
-
-Node ArithRewriter::ensureReal(TNode t)
-{
- if (t.getType().isInteger())
- {
- if (t.isConst())
- {
- // short-circuit
- Node ret = NodeManager::currentNM()->mkConstReal(t.getConst<Rational>());
- Assert(ret.getType().isReal());
- return ret;
- }
- Trace("arith-rewriter-debug") << "maybeEnsureReal: " << t << std::endl;
- return NodeManager::currentNM()->mkNode(kind::TO_REAL, t);
- }
- return t;
-}
-
RewriteResponse ArithRewriter::returnRewrite(TNode t, Node ret, Rewrite r)
{
Trace("arith-rewriter") << "ArithRewriter : " << t << " == " << ret << " by "
/** return rewrite */
static RewriteResponse returnRewrite(TNode t, Node ret, Rewrite r);
- /**
- * Remove TO_REAL from t, returns t[0] if t has kind TO_REAL.
- */
- static TNode removeToReal(TNode t);
- /**
- * Ensure that t has real type if tn is the real type. Do so by applying
- * TO_REAL to t.
- */
- static Node maybeEnsureReal(TypeNode tn, TNode t);
- /** Same as above, without a check for the type of tn. */
- static Node ensureReal(TNode t);
/** The operator elimination utility */
OperatorElim& d_opElim;
}; /* class ArithRewriter */
typedef std::unordered_set<TNode> TNodeSet;
typedef context::CDHashSet<Node> CDNodeSet;
-inline Node mkRationalNode(const Rational& q){
- return NodeManager::currentNM()->mkConst(kind::CONST_RATIONAL, q);
-}
-
inline Node mkBoolNode(bool b){
return NodeManager::currentNM()->mkConst<bool>(b);
}
namespace theory {
namespace arith::linear {
-Constant Constant::mkConstant(const Rational& rat) {
- return Constant(mkRationalNode(rat));
+Constant Constant::mkConstant(const Rational& rat)
+{
+ NodeManager* nm = NodeManager::currentNM();
+ return Constant(nm->mkConstReal(rat));
}
size_t Variable::getComplexity() const{
if(!vars.hasNode(x)){ return Node::null(); }
Node xNode = vars.asNode(x);
const Rational& q = sum[x];
- Node mult = nm->mkNode(kind::MULT, mkRationalNode(q), xNode);
+ Node mult = nm->mkNode(kind::MULT, nm->mkConstReal(q), xNode);
Trace("arith::toSumNode") << "toSumNode() " << x << " " << mult << endl;
children.push_back(mult);
}
Polynomial poly = Polynomial::parsePolynomial(t);
if(poly.isConstant()){
c = poly.getHead().getConstant().getValue();
- p = mkRationalNode(Rational(0));
+ p = NodeManager::currentNM()->mkConstReal(Rational(0));
m = Rational(1);
return true;
}else if(poly.containsConstant()){
}
}
-// std::pair<bool, Node> TheoryArithPrivate::entailmentUpperCheck(const Rational& lm, Node lp, const Rational& rm, Node rp, const DeltaRational& sep, const ArithEntailmentCheckParameters& params, ArithEntailmentCheckSideEffects& out){
-
-// Rational negRM = -rm;
-// Node diff = NodeManager::currentNM()->mkNode(MULT, mkRationalConstan(lm), lp) + (negRM * rp);
-
-// Rational diffm;
-// Node diffp;
-// decompose(diff, diffm, diffNode);
-
-
-// std::pair<Node, DeltaRational> bestUbLeft, bestLbRight, bestUbDiff, tmp;
-// bestUbLeft = bestLbRight = bestUbDiff = make_pair(Node::Null(), DeltaRational());
-
-// return make_pair(false, Node::null());
-// }
-
/**
* Decomposes a literal into the form:
* dir*[lm*( lp )] k dir*[ [rm*( rp )] + sep ]
return NodeManager::currentNM()->mkNode(Kind::NONLINEAR_MULT, monomial);
}
+TNode removeToReal(TNode t) { return t.getKind() == kind::TO_REAL ? t[0] : t; }
+
+Node maybeEnsureReal(TypeNode tn, TNode t)
+{
+ // if we require being a real
+ if (!tn.isInteger())
+ {
+ // ensure that t has type real
+ Assert(tn.isReal());
+ return ensureReal(t);
+ }
+ return t;
+}
+
+Node ensureReal(TNode t)
+{
+ if (t.getType().isInteger())
+ {
+ if (t.isConst())
+ {
+ // short-circuit
+ Node ret = NodeManager::currentNM()->mkConstReal(t.getConst<Rational>());
+ Assert(ret.getType().isReal());
+ return ret;
+ }
+ Trace("arith-rewriter-debug") << "maybeEnsureReal: " << t << std::endl;
+ return NodeManager::currentNM()->mkNode(kind::TO_REAL, t);
+ }
+ return t;
+}
+
} // namespace rewriter
} // namespace arith
} // namespace theory
Node mkMultTerm(const RealAlgebraicNumber& multiplicity,
std::vector<Node>&& monomial);
+/**
+ * Remove TO_REAL from t, returns t[0] if t has kind TO_REAL.
+ */
+TNode removeToReal(TNode t);
+/**
+ * Ensure that t has real type if tn is the real type. Do so by applying
+ * TO_REAL to t.
+ */
+Node maybeEnsureReal(TypeNode tn, TNode t);
+/** Same as above, without a check for the type of tn. */
+Node ensureReal(TNode t);
+
} // namespace rewriter
} // namespace arith
} // namespace theory
{
TypeNode integer = d_nodeManager->integerType();
- Node one = d_nodeManager->mkConst(CONST_RATIONAL, Rational(1));
- Node two = d_nodeManager->mkConst(CONST_RATIONAL, Rational(2));
+ Node one = d_nodeManager->mkConstInt(Rational(1));
+ Node two = d_nodeManager->mkConstInt(Rational(2));
Node x = d_nodeManager->mkBoundVar(integer);
Node a = d_skolemManager->mkDummySkolem("a", integer);
Node cons_1_nil =
d_nodeManager->mkNode(APPLY_CONSTRUCTOR,
cons,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(1)),
+ d_nodeManager->mkConstInt(Rational(1)),
d_nodeManager->mkNode(APPLY_CONSTRUCTOR, nil));
Node cons_1_cons_2_nil = d_nodeManager->mkNode(
APPLY_CONSTRUCTOR,
cons,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(1)),
+ d_nodeManager->mkConstInt(Rational(1)),
d_nodeManager->mkNode(APPLY_CONSTRUCTOR,
cons,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(2)),
+ d_nodeManager->mkConstInt(Rational(2)),
d_nodeManager->mkNode(APPLY_CONSTRUCTOR, nil)));
ASSERT_TRUE(d_nodeManager->mkNode(APPLY_CONSTRUCTOR, nil).isConst());
ASSERT_FALSE(cons_x_nil.isConst());
TypeNode arrType = d_nodeManager->mkArrayType(d_nodeManager->integerType(),
d_nodeManager->integerType());
- Node zero = d_nodeManager->mkConst(CONST_RATIONAL, Rational(0));
- Node one = d_nodeManager->mkConst(CONST_RATIONAL, Rational(1));
+ Node zero = d_nodeManager->mkConstInt(Rational(0));
+ Node one = d_nodeManager->mkConstInt(Rational(1));
Node storeAll = d_nodeManager->mkConst(ArrayStoreAll(arrType, zero));
ASSERT_TRUE(storeAll.isConst());
TEST_F(TestNodeBlackNodeManager, mkConst_rational)
{
Rational r("3/2");
- Node n = d_nodeManager->mkConst(CONST_RATIONAL, r);
+ Node n = d_nodeManager->mkConstReal(r);
ASSERT_EQ(n.getConst<Rational>(), r);
}
TEST_F(TestNodeWhiteNodeManager, mkConst_rational)
{
Rational i("3");
- Node n = d_nodeManager->mkConst(CONST_RATIONAL, i);
- Node m = d_nodeManager->mkConst(CONST_RATIONAL, i);
+ Node n = d_nodeManager->mkConstInt(i);
+ Node m = d_nodeManager->mkConstInt(i);
ASSERT_EQ(n.getId(), m.getId());
}
Node x = d_nodeManager->mkVar("x", d_nodeManager->integerType());
Node y = d_nodeManager->mkVar("y", d_nodeManager->integerType());
Node x_plus_y = d_nodeManager->mkNode(ADD, x, y);
- Node two = d_nodeManager->mkConst(CONST_RATIONAL, Rational(2));
+ Node two = d_nodeManager->mkConstInt(Rational(2));
Node x_times_2 = d_nodeManager->mkNode(MULT, x, two);
Node n = d_nodeManager->mkNode(ADD, x_times_2, x_plus_y, y);
TypeNode bvType = d_nodeManager->mkBitVectorType(32);
Node x = d_nodeManager->mkBoundVar("x", realType);
- Node xPos = d_nodeManager->mkNode(
- GT, x, d_nodeManager->mkConst(CONST_RATIONAL, Rational(0)));
+ Node xPos =
+ d_nodeManager->mkNode(GT, x, d_nodeManager->mkConstInt(Rational(0)));
TypeNode funtype = d_nodeManager->mkFunctionType(integerType, booleanType);
Node lambda = d_nodeManager->mkVar("lambda", funtype);
std::vector<Node> formals;
std::cout << "len(x) >= 0 is simplified to true" << std::endl;
Node x = d_nodeManager->mkVar("x", d_nodeManager->stringType());
Node len_x = d_nodeManager->mkNode(kind::STRING_LENGTH, x);
- Node zero = d_nodeManager->mkConst<Rational>(CONST_RATIONAL, 0);
+ Node zero = d_nodeManager->mkConstInt(0);
Node geq1 = d_nodeManager->mkNode(kind::GEQ, len_x, zero);
Node tt = d_nodeManager->mkConst<bool>(true);
Node simplified1 = ftr.foreignRewrite(geq1);
TEST_F(TestTheoryWhiteArithPolyNorm, check_poly_norm_int)
{
TypeNode intType = d_nodeManager->integerType();
- Node zero = d_nodeManager->mkConst(CONST_RATIONAL, Rational(0));
- Node one = d_nodeManager->mkConst(CONST_RATIONAL, Rational(1));
- Node two = d_nodeManager->mkConst(CONST_RATIONAL, Rational(2));
+ Node zero = d_nodeManager->mkConstReal(Rational(0));
+ Node one = d_nodeManager->mkConstReal(Rational(1));
+ Node two = d_nodeManager->mkConstReal(Rational(2));
Node x = d_nodeManager->mkVar("x", intType);
Node y = d_nodeManager->mkVar("y", intType);
Node z = d_nodeManager->mkVar("z", intType);
TEST_F(TestTheoryWhiteArithPolyNorm, check_poly_norm_real)
{
TypeNode realType = d_nodeManager->realType();
- Node zero = d_nodeManager->mkConst(CONST_RATIONAL, Rational(0));
- Node one = d_nodeManager->mkConst(CONST_RATIONAL, Rational(1));
- Node half = d_nodeManager->mkConst(CONST_RATIONAL, Rational(1) / Rational(2));
- Node two = d_nodeManager->mkConst(CONST_RATIONAL, Rational(2));
+ Node zero = d_nodeManager->mkConstReal(Rational(0));
+ Node one = d_nodeManager->mkConstReal(Rational(1));
+ Node half = d_nodeManager->mkConstReal(Rational(1) / Rational(2));
+ Node two = d_nodeManager->mkConstReal(Rational(2));
Node x = d_nodeManager->mkVar("x", realType);
Node y = d_nodeManager->mkVar("y", realType);
{
Node a = d_nodeManager->mkConst(String("A"));
Node empty = d_nodeManager->mkConst(String(""));
- Node one = d_nodeManager->mkConst(CONST_RATIONAL, Rational(1));
- Node two = d_nodeManager->mkConst(CONST_RATIONAL, Rational(2));
+ Node one = d_nodeManager->mkConstInt(Rational(1));
+ Node two = d_nodeManager->mkConstInt(Rational(2));
std::vector<Node> args;
std::vector<Node> vals;
{
Node n = d_nodeManager->mkNode(kind::STRING_TO_CODE, a);
Node r = eval.eval(n, args, vals);
- ASSERT_EQ(r, d_nodeManager->mkConst(CONST_RATIONAL, Rational(65)));
+ ASSERT_EQ(r, d_nodeManager->mkConstInt(Rational(65)));
}
// (str.code "") ---> -1
{
Node n = d_nodeManager->mkNode(kind::STRING_TO_CODE, empty);
Node r = eval.eval(n, args, vals);
- ASSERT_EQ(r, d_nodeManager->mkConst(CONST_RATIONAL, Rational(-1)));
+ ASSERT_EQ(r, d_nodeManager->mkConstInt(Rational(-1)));
}
}
} // namespace test
Node b = d_nodeManager->mkConst(String("B"));
Node x = d_nodeManager->mkVar("x", strType);
Node y = d_nodeManager->mkVar("y", strType);
- Node negOne = d_nodeManager->mkConst(CONST_RATIONAL, Rational(-1));
- Node zero = d_nodeManager->mkConst(CONST_RATIONAL, Rational(0));
- Node one = d_nodeManager->mkConst(CONST_RATIONAL, Rational(1));
- Node two = d_nodeManager->mkConst(CONST_RATIONAL, Rational(2));
- Node three = d_nodeManager->mkConst(CONST_RATIONAL, Rational(3));
+ Node negOne = d_nodeManager->mkConstInt(Rational(-1));
+ Node zero = d_nodeManager->mkConstInt(Rational(0));
+ Node one = d_nodeManager->mkConstInt(Rational(1));
+ Node two = d_nodeManager->mkConstInt(Rational(2));
+ Node three = d_nodeManager->mkConstInt(Rational(3));
Node i = d_nodeManager->mkVar("i", intType);
ASSERT_TRUE(se.checkLengthOne(a));
Node z = d_nodeManager->mkVar("z", strType);
Node n = d_nodeManager->mkVar("n", intType);
- Node one = d_nodeManager->mkConst(CONST_RATIONAL, Rational(1));
+ Node one = d_nodeManager->mkConstInt(Rational(1));
// 1 >= (str.len (str.substr z n 1)) ---> true
Node substr_z = d_nodeManager->mkNode(
Node y = d_nodeManager->mkVar("y", strType);
Node z = d_nodeManager->mkVar("z", intType);
- Node zero = d_nodeManager->mkConst(CONST_RATIONAL, Rational(0));
- Node one = d_nodeManager->mkConst(CONST_RATIONAL, Rational(1));
+ Node zero = d_nodeManager->mkConstInt(Rational(0));
+ Node one = d_nodeManager->mkConstInt(Rational(1));
Node empty = d_nodeManager->mkConst(String(""));
Node a = d_nodeManager->mkConst(String("A"));
ASSERT_TRUE(ae.checkWithAssumption(
x_plus_slen_y_plus_slen_y_eq_zero, zero, x, false));
- Node five = d_nodeManager->mkConst(CONST_RATIONAL, Rational(5));
- Node six = d_nodeManager->mkConst(CONST_RATIONAL, Rational(6));
+ Node five = d_nodeManager->mkConstInt(Rational(5));
+ Node six = d_nodeManager->mkConstInt(Rational(6));
Node x_plus_five = d_nodeManager->mkNode(kind::ADD, x, five);
Node x_plus_five_lt_six =
d_rewriter->rewrite(d_nodeManager->mkNode(kind::LT, x_plus_five, six));
Node a = d_nodeManager->mkConst(String("A"));
Node b = d_nodeManager->mkConst(String("B"));
Node abcd = d_nodeManager->mkConst(String("ABCD"));
- Node negone = d_nodeManager->mkConst(CONST_RATIONAL, Rational(-1));
- Node zero = d_nodeManager->mkConst(CONST_RATIONAL, Rational(0));
- Node one = d_nodeManager->mkConst(CONST_RATIONAL, Rational(1));
- Node two = d_nodeManager->mkConst(CONST_RATIONAL, Rational(2));
- Node three = d_nodeManager->mkConst(CONST_RATIONAL, Rational(3));
+ Node negone = d_nodeManager->mkConstInt(Rational(-1));
+ Node zero = d_nodeManager->mkConstInt(Rational(0));
+ Node one = d_nodeManager->mkConstInt(Rational(1));
+ Node two = d_nodeManager->mkConstInt(Rational(2));
+ Node three = d_nodeManager->mkConstInt(Rational(3));
Node s = d_nodeManager->mkVar("s", strType);
Node s2 = d_nodeManager->mkVar("s2", strType);
kind::STRING_SUBSTR,
a,
d_nodeManager->mkNode(
- kind::ADD, x, d_nodeManager->mkConst(CONST_RATIONAL, Rational(1))),
+ kind::ADD, x, d_nodeManager->mkConstInt(Rational(1))),
x);
sameNormalForm(n, empty);
Node empty = d_nodeManager->mkConst(String(""));
Node a = d_nodeManager->mkConst(String("A"));
- Node zero = d_nodeManager->mkConst(CONST_RATIONAL, Rational(0));
- Node three = d_nodeManager->mkConst(CONST_RATIONAL, Rational(3));
+ Node zero = d_nodeManager->mkConstInt(Rational(0));
+ Node three = d_nodeManager->mkConstInt(Rational(3));
Node i = d_nodeManager->mkVar("i", intType);
Node s = d_nodeManager->mkVar("s", strType);
Node ccc = d_nodeManager->mkConst(String("CCC"));
Node x = d_nodeManager->mkVar("x", strType);
Node y = d_nodeManager->mkVar("y", strType);
- Node negOne = d_nodeManager->mkConst(CONST_RATIONAL, Rational(-1));
- Node zero = d_nodeManager->mkConst(CONST_RATIONAL, Rational(0));
- Node one = d_nodeManager->mkConst(CONST_RATIONAL, Rational(1));
- Node two = d_nodeManager->mkConst(CONST_RATIONAL, Rational(2));
- Node three = d_nodeManager->mkConst(CONST_RATIONAL, Rational(3));
+ Node negOne = d_nodeManager->mkConstInt(Rational(-1));
+ Node zero = d_nodeManager->mkConstInt(Rational(0));
+ Node one = d_nodeManager->mkConstInt(Rational(1));
+ Node two = d_nodeManager->mkConstInt(Rational(2));
+ Node three = d_nodeManager->mkConstInt(Rational(3));
Node i = d_nodeManager->mkVar("i", intType);
Node j = d_nodeManager->mkVar("j", intType);
Node x = d_nodeManager->mkVar("x", strType);
Node y = d_nodeManager->mkVar("y", strType);
Node z = d_nodeManager->mkVar("z", strType);
- Node zero = d_nodeManager->mkConst(CONST_RATIONAL, Rational(0));
- Node one = d_nodeManager->mkConst(CONST_RATIONAL, Rational(1));
+ Node zero = d_nodeManager->mkConstInt(Rational(0));
+ Node one = d_nodeManager->mkConstInt(Rational(1));
Node n = d_nodeManager->mkVar("n", intType);
// (str.replace (str.replace x "B" x) x "A") -->
Node z = d_nodeManager->mkVar("z", strType);
Node n = d_nodeManager->mkVar("n", intType);
Node m = d_nodeManager->mkVar("m", intType);
- Node one = d_nodeManager->mkConst(CONST_RATIONAL, Rational(1));
- Node two = d_nodeManager->mkConst(CONST_RATIONAL, Rational(2));
- Node three = d_nodeManager->mkConst(CONST_RATIONAL, Rational(3));
- Node four = d_nodeManager->mkConst(CONST_RATIONAL, Rational(4));
+ Node one = d_nodeManager->mkConstInt(Rational(1));
+ Node two = d_nodeManager->mkConstInt(Rational(2));
+ Node three = d_nodeManager->mkConstInt(Rational(3));
+ Node four = d_nodeManager->mkConstInt(Rational(4));
Node t = d_nodeManager->mkConst(true);
Node f = d_nodeManager->mkConst(false);
Node xxa = d_nodeManager->mkNode(kind::STRING_CONCAT, x, x, a);
Node f = d_nodeManager->mkConst(false);
Node n = d_nodeManager->mkVar("n", intType);
- Node zero = d_nodeManager->mkConst(CONST_RATIONAL, Rational(0));
- Node one = d_nodeManager->mkConst(CONST_RATIONAL, Rational(1));
- Node three = d_nodeManager->mkConst(CONST_RATIONAL, Rational(3));
+ Node zero = d_nodeManager->mkConstInt(Rational(0));
+ Node one = d_nodeManager->mkConstInt(Rational(1));
+ Node three = d_nodeManager->mkConstInt(Rational(3));
// Same normal form for:
//
Node a = d_nodeManager->mkVar(*d_realType);
Node c = d_nodeManager->mkVar(*d_realType);
Node orig = d_nodeManager->mkAnd(std::vector<Node>{
- d_nodeManager->mkNode(
- Kind::EQUAL, a, d_nodeManager->mkConst(CONST_RATIONAL, d_zero)),
+ d_nodeManager->mkNode(Kind::EQUAL, a, d_nodeManager->mkConstReal(d_zero)),
d_nodeManager->mkNode(
Kind::EQUAL,
d_nodeManager->mkNode(
Kind::ADD,
d_nodeManager->mkNode(Kind::NONLINEAR_MULT, a, c),
- d_nodeManager->mkConst(CONST_RATIONAL, d_one)),
- d_nodeManager->mkConst(CONST_RATIONAL, d_zero))});
+ d_nodeManager->mkConstReal(d_one)),
+ d_nodeManager->mkConstReal(d_zero))});
{
Node rewritten = rewriter->rewrite(orig);
TEST_F(TestTheoryWhiteArithCoverings, test_delta_one)
{
std::vector<Node> a;
- Node zero = d_nodeManager->mkConst(CONST_RATIONAL, Rational(0));
- Node one = d_nodeManager->mkConst(CONST_RATIONAL, Rational(1));
- Node mone = d_nodeManager->mkConst(CONST_RATIONAL, Rational(-1));
- Node fifth = d_nodeManager->mkConst(CONST_RATIONAL, Rational(1, 2));
+ Node zero = d_nodeManager->mkConstReal(Rational(0));
+ Node one = d_nodeManager->mkConstReal(Rational(1));
+ Node mone = d_nodeManager->mkConstReal(Rational(-1));
+ Node fifth = d_nodeManager->mkConstReal(Rational(1, 2));
Node g = make_real_variable("g");
Node l = make_real_variable("l");
Node q = make_real_variable("q");
TEST_F(TestTheoryWhiteArithCoverings, test_delta_two)
{
std::vector<Node> a;
- Node zero = d_nodeManager->mkConst(CONST_RATIONAL, Rational(0));
- Node one = d_nodeManager->mkConst(CONST_RATIONAL, Rational(1));
- Node mone = d_nodeManager->mkConst(CONST_RATIONAL, Rational(-1));
- Node fifth = d_nodeManager->mkConst(CONST_RATIONAL, Rational(1, 2));
+ Node zero = d_nodeManager->mkConstReal(Rational(0));
+ Node one = d_nodeManager->mkConstReal(Rational(1));
+ Node mone = d_nodeManager->mkConstReal(Rational(-1));
+ Node fifth = d_nodeManager->mkConstReal(Rational(1, 2));
Node g = make_real_variable("g");
Node l = make_real_variable("l");
Node q = make_real_variable("q");
TestSmtNoFinishInit::SetUp();
d_slvEngine->setOption("produce-models", "true");
d_slvEngine->finishInit();
- d_true = d_nodeManager->mkConst<bool>(true);
- d_one = d_nodeManager->mkConst<Rational>(CONST_RATIONAL, Rational(1));
}
- Node d_true;
- Node d_one;
};
} // namespace test
} // namespace cvc5::internal
{
RealAlgebraicNumber two({-8, 0, 0, 1}, 1, 3);
Node n = d_nodeManager->mkRealAlgebraicNumber(two);
- EXPECT_EQ(n.getKind(), Kind::CONST_RATIONAL);
+ EXPECT_EQ(n.isConst(), true);
EXPECT_EQ(n.getConst<Rational>(), Rational(2));
}
{
Node n = d_nodeManager->mkRealAlgebraicNumber(sqrt2);
n = d_nodeManager->mkNode(Kind::MULT, n, n);
n = d_slvEngine->getRewriter()->rewrite(n);
- EXPECT_EQ(n.getKind(), Kind::CONST_RATIONAL);
+ EXPECT_EQ(n.isConst(), true);
EXPECT_EQ(n.getConst<Rational>(), Rational(2));
}
{
Node n = d_nodeManager->mkRealAlgebraicNumber(sqrt2);
n = d_nodeManager->mkNode(Kind::SUB, n, n);
n = d_slvEngine->getRewriter()->rewrite(n);
- EXPECT_EQ(n.getKind(), Kind::CONST_RATIONAL);
+ EXPECT_EQ(n.isConst(), true);
EXPECT_EQ(n.getConst<Rational>(), Rational(0));
}
{
TEST_F(TestTheoryWhiteArith, assert)
{
Node x = d_nodeManager->mkVar(*d_realType);
- Node c = d_nodeManager->mkConst<Rational>(CONST_RATIONAL, d_zero);
+ Node c = d_nodeManager->mkConstReal(d_zero);
Node gt = d_nodeManager->mkNode(GT, x, c);
Node leq = Rewriter::rewrite(gt.notNode());
{
Node x = d_nodeManager->mkVar(*d_intType);
Node xr = d_nodeManager->mkVar(*d_realType);
- Node c0 = d_nodeManager->mkConst<Rational>(CONST_RATIONAL, d_zero);
- Node c1 = d_nodeManager->mkConst<Rational>(CONST_RATIONAL, d_one);
- Node c2 = d_nodeManager->mkConst<Rational>(CONST_RATIONAL, Rational(2));
+ Node c0 = d_nodeManager->mkConstReal(d_zero);
+ Node c1 = d_nodeManager->mkConstReal(d_one);
+ Node c2 = d_nodeManager->mkConstReal(Rational(2));
Node geq0 = d_nodeManager->mkNode(GEQ, x, c0);
Node geq1 = d_nodeManager->mkNode(GEQ, x, c1);
TEST_F(TestTheoryWhiteBagsNormalForm, mkBag_constant_element)
{
std::vector<Node> elements = getNStrings(1);
- Node negative = d_nodeManager->mkBag(
- d_nodeManager->stringType(),
- elements[0],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(-1)));
- Node zero =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- elements[0],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(0)));
- Node positive =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- elements[0],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(1)));
+ Node negative = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[0],
+ d_nodeManager->mkConstInt(Rational(-1)));
+ Node zero = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[0],
+ d_nodeManager->mkConstInt(Rational(0)));
+ Node positive = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[0],
+ d_nodeManager->mkConstInt(Rational(1)));
Node emptybag = d_nodeManager->mkConst(
EmptyBag(d_nodeManager->mkBagType(d_nodeManager->stringType())));
// (bag.count "x" (bag.union_disjoint (bag "x" 4) (bag "y" 5)) = 4
// (bag.count "x" (bag.union_disjoint (bag "y" 5) (bag "z" 5)) = 0
- Node zero = d_nodeManager->mkConst(CONST_RATIONAL, Rational(0));
- Node four = d_nodeManager->mkConst(CONST_RATIONAL, Rational(4));
+ Node zero = d_nodeManager->mkConstInt(Rational(0));
+ Node four = d_nodeManager->mkConstInt(Rational(4));
Node empty = d_nodeManager->mkConst(
EmptyBag(d_nodeManager->mkBagType(d_nodeManager->stringType())));
Node x = d_nodeManager->mkConst(String("x"));
Node y = d_nodeManager->mkConst(String("y"));
Node z = d_nodeManager->mkConst(String("z"));
- Node x_4 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(4)));
- Node y_5 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- y,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(5)));
- Node z_5 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- z,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(5)));
+ Node x_4 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(4)));
+ Node y_5 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), y, d_nodeManager->mkConstInt(Rational(5)));
+ Node z_5 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), z, d_nodeManager->mkConstInt(Rational(5)));
Node input1 = d_nodeManager->mkNode(BAG_COUNT, x, empty);
Node output1 = zero;
Node x = d_nodeManager->mkConst(String("x"));
Node y = d_nodeManager->mkConst(String("y"));
- Node x_1 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(1)));
- Node y_1 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- y,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(1)));
-
- Node x_4 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(4)));
- Node y_5 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- y,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(5)));
+ Node x_1 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(1)));
+ Node y_1 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), y, d_nodeManager->mkConstInt(Rational(1)));
+
+ Node x_4 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(4)));
+ Node y_5 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), y, d_nodeManager->mkConstInt(Rational(5)));
Node input2 = d_nodeManager->mkNode(BAG_DUPLICATE_REMOVAL, x_4);
Node output2 = x_1;
Node x = d_nodeManager->mkConst(String("x"));
Node y = d_nodeManager->mkConst(String("y"));
Node z = d_nodeManager->mkConst(String("z"));
- Node x_4 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(4)));
- Node x_3 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(3)));
- Node x_7 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(7)));
- Node z_2 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- z,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(2)));
- Node y_1 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- y,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(1)));
+ Node x_4 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(4)));
+ Node x_3 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(3)));
+ Node x_7 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(7)));
+ Node z_2 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), z, d_nodeManager->mkConstInt(Rational(2)));
+ Node y_1 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), y, d_nodeManager->mkConstInt(Rational(1)));
Node A = d_nodeManager->mkNode(BAG_UNION_DISJOINT, x_4, z_2);
Node B = d_nodeManager->mkNode(BAG_UNION_DISJOINT, x_3, y_1);
std::vector<Node> elements = getNStrings(3);
Node emptybag = d_nodeManager->mkConst(
EmptyBag(d_nodeManager->mkBagType(d_nodeManager->stringType())));
- Node A =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- elements[0],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(2)));
- Node B =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- elements[1],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(3)));
- Node C =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- elements[2],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(4)));
+ Node A = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[0],
+ d_nodeManager->mkConstInt(Rational(2)));
+ Node B = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[1],
+ d_nodeManager->mkConstInt(Rational(3)));
+ Node C = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[2],
+ d_nodeManager->mkConstInt(Rational(4)));
Node unionDisjointAB = d_nodeManager->mkNode(BAG_UNION_DISJOINT, A, B);
// unionDisjointAB is already in a normal form
ASSERT_EQ(unionDisjointA_BC, BagsUtils::evaluate(unionDisjointAB_C));
Node unionDisjointAA = d_nodeManager->mkNode(BAG_UNION_DISJOINT, A, A);
- Node AA =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- elements[0],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(4)));
+ Node AA = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[0],
+ d_nodeManager->mkConstInt(Rational(4)));
ASSERT_FALSE(unionDisjointAA.isConst());
ASSERT_TRUE(AA.isConst());
ASSERT_EQ(AA, BagsUtils::evaluate(unionDisjointAA));
Node x = d_nodeManager->mkConst(String("x"));
Node y = d_nodeManager->mkConst(String("y"));
Node z = d_nodeManager->mkConst(String("z"));
- Node x_4 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(4)));
- Node x_3 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(3)));
- Node x_7 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(7)));
- Node z_2 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- z,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(2)));
- Node y_1 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- y,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(1)));
+ Node x_4 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(4)));
+ Node x_3 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(3)));
+ Node x_7 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(7)));
+ Node z_2 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), z, d_nodeManager->mkConstInt(Rational(2)));
+ Node y_1 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), y, d_nodeManager->mkConstInt(Rational(1)));
Node A = d_nodeManager->mkNode(BAG_UNION_DISJOINT, x_4, z_2);
Node B = d_nodeManager->mkNode(BAG_UNION_DISJOINT, x_3, y_1);
Node x = d_nodeManager->mkConst(String("x"));
Node y = d_nodeManager->mkConst(String("y"));
Node z = d_nodeManager->mkConst(String("z"));
- Node x_4 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(4)));
- Node x_3 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(3)));
- Node x_7 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(7)));
- Node z_2 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- z,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(2)));
- Node y_1 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- y,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(1)));
+ Node x_4 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(4)));
+ Node x_3 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(3)));
+ Node x_7 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(7)));
+ Node z_2 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), z, d_nodeManager->mkConstInt(Rational(2)));
+ Node y_1 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), y, d_nodeManager->mkConstInt(Rational(1)));
Node A = d_nodeManager->mkNode(BAG_UNION_DISJOINT, x_4, z_2);
Node B = d_nodeManager->mkNode(BAG_UNION_DISJOINT, x_3, y_1);
Node x = d_nodeManager->mkConst(String("x"));
Node y = d_nodeManager->mkConst(String("y"));
Node z = d_nodeManager->mkConst(String("z"));
- Node x_1 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(1)));
- Node x_4 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(4)));
- Node x_3 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(3)));
- Node x_7 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(7)));
- Node z_2 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- z,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(2)));
- Node y_1 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- y,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(1)));
+ Node x_1 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(1)));
+ Node x_4 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(4)));
+ Node x_3 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(3)));
+ Node x_7 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(7)));
+ Node z_2 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), z, d_nodeManager->mkConstInt(Rational(2)));
+ Node y_1 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), y, d_nodeManager->mkConstInt(Rational(1)));
Node A = d_nodeManager->mkNode(BAG_UNION_DISJOINT, x_4, z_2);
Node B = d_nodeManager->mkNode(BAG_UNION_DISJOINT, x_3, y_1);
Node x = d_nodeManager->mkConst(String("x"));
Node y = d_nodeManager->mkConst(String("y"));
Node z = d_nodeManager->mkConst(String("z"));
- Node x_1 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(1)));
- Node x_4 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(4)));
- Node x_3 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(3)));
- Node x_7 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(7)));
- Node z_2 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- z,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(2)));
- Node y_1 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- y,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(1)));
+ Node x_1 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(1)));
+ Node x_4 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(4)));
+ Node x_3 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(3)));
+ Node x_7 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(7)));
+ Node z_2 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), z, d_nodeManager->mkConstInt(Rational(2)));
+ Node y_1 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), y, d_nodeManager->mkConstInt(Rational(1)));
Node A = d_nodeManager->mkNode(BAG_UNION_DISJOINT, x_4, z_2);
Node B = d_nodeManager->mkNode(BAG_UNION_DISJOINT, x_3, y_1);
Node x = d_nodeManager->mkConst(String("x"));
Node y = d_nodeManager->mkConst(String("y"));
Node z = d_nodeManager->mkConst(String("z"));
- Node x_4 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(4)));
- Node y_1 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- y,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(1)));
+ Node x_4 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(4)));
+ Node y_1 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), y, d_nodeManager->mkConstInt(Rational(1)));
Node input1 = d_nodeManager->mkNode(BAG_CARD, empty);
- Node output1 = d_nodeManager->mkConst(CONST_RATIONAL, Rational(0));
+ Node output1 = d_nodeManager->mkConstInt(Rational(0));
ASSERT_EQ(output1, BagsUtils::evaluate(input1));
Node input2 = d_nodeManager->mkNode(BAG_CARD, x_4);
- Node output2 = d_nodeManager->mkConst(CONST_RATIONAL, Rational(4));
+ Node output2 = d_nodeManager->mkConstInt(Rational(4));
ASSERT_EQ(output2, BagsUtils::evaluate(input2));
Node union_disjoint = d_nodeManager->mkNode(BAG_UNION_DISJOINT, x_4, y_1);
Node input3 = d_nodeManager->mkNode(BAG_CARD, union_disjoint);
- Node output3 = d_nodeManager->mkConst(CONST_RATIONAL, Rational(5));
+ Node output3 = d_nodeManager->mkConstInt(Rational(5));
ASSERT_EQ(output3, BagsUtils::evaluate(input3));
}
Node x = d_nodeManager->mkConst(String("x"));
Node y = d_nodeManager->mkConst(String("y"));
Node z = d_nodeManager->mkConst(String("z"));
- Node x_1 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(1)));
- Node x_4 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(4)));
- Node y_1 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- y,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(1)));
+ Node x_1 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(1)));
+ Node x_4 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(4)));
+ Node y_1 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), y, d_nodeManager->mkConstInt(Rational(1)));
Node input1 = d_nodeManager->mkNode(BAG_IS_SINGLETON, empty);
Node output1 = falseNode;
Node xSingleton = d_nodeManager->mkSingleton(d_nodeManager->stringType(), x);
Node ySingleton = d_nodeManager->mkSingleton(d_nodeManager->stringType(), y);
- Node x_1 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(1)));
- Node y_1 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- y,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(1)));
+ Node x_1 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(1)));
+ Node y_1 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), y, d_nodeManager->mkConstInt(Rational(1)));
Node input2 = d_nodeManager->mkNode(BAG_FROM_SET, xSingleton);
Node output2 = x_1;
Node xSingleton = d_nodeManager->mkSingleton(d_nodeManager->stringType(), x);
Node ySingleton = d_nodeManager->mkSingleton(d_nodeManager->stringType(), y);
- Node x_4 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(4)));
- Node y_5 =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- y,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(5)));
+ Node x_4 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(4)));
+ Node y_5 = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), y, d_nodeManager->mkConstInt(Rational(5)));
Node input2 = d_nodeManager->mkNode(BAG_TO_SET, x_4);
Node output2 = xSingleton;
Node constantBag =
d_nodeManager->mkBag(d_nodeManager->stringType(),
emptyString,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(1)));
+ d_nodeManager->mkConstInt(Rational(1)));
// (= A A) = true where A is a bag
Node n1 = A.eqNode(A);
TEST_F(TestTheoryWhiteBagsRewriter, mkBag_constant_element)
{
std::vector<Node> elements = getNStrings(1);
- Node negative = d_nodeManager->mkBag(
- d_nodeManager->stringType(),
- elements[0],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(-1)));
- Node zero =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- elements[0],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(0)));
- Node positive =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- elements[0],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(1)));
+ Node negative = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[0],
+ d_nodeManager->mkConstInt(Rational(-1)));
+ Node zero = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[0],
+ d_nodeManager->mkConstInt(Rational(0)));
+ Node positive = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[0],
+ d_nodeManager->mkConstInt(Rational(1)));
Node emptybag = d_nodeManager->mkConst(
EmptyBag(d_nodeManager->mkBagType(d_nodeManager->stringType())));
RewriteResponse negativeResponse = d_rewriter->postRewrite(negative);
{
Node skolem =
d_skolemManager->mkDummySkolem("x", d_nodeManager->stringType());
- Node variable = d_nodeManager->mkBag(
- d_nodeManager->stringType(),
- skolem,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(-1)));
- Node negative = d_nodeManager->mkBag(
- d_nodeManager->stringType(),
- skolem,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(-1)));
- Node zero =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- skolem,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(0)));
- Node positive =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- skolem,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(1)));
+ Node variable = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ skolem,
+ d_nodeManager->mkConstInt(Rational(-1)));
+ Node negative = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ skolem,
+ d_nodeManager->mkConstInt(Rational(-1)));
+ Node zero = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ skolem,
+ d_nodeManager->mkConstInt(Rational(0)));
+ Node positive = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ skolem,
+ d_nodeManager->mkConstInt(Rational(1)));
Node emptybag = d_nodeManager->mkConst(
EmptyBag(d_nodeManager->mkBagType(d_nodeManager->stringType())));
RewriteResponse negativeResponse = d_rewriter->postRewrite(negative);
TEST_F(TestTheoryWhiteBagsRewriter, bag_count)
{
- Node zero = d_nodeManager->mkConst(CONST_RATIONAL, Rational(0));
- Node one = d_nodeManager->mkConst(CONST_RATIONAL, Rational(1));
- Node three = d_nodeManager->mkConst(CONST_RATIONAL, Rational(3));
+ Node zero = d_nodeManager->mkConstInt(Rational(0));
+ Node one = d_nodeManager->mkConstInt(Rational(1));
+ Node three = d_nodeManager->mkConstInt(Rational(3));
Node skolem =
d_skolemManager->mkDummySkolem("x", d_nodeManager->stringType());
Node emptyBag = d_nodeManager->mkConst(
TEST_F(TestTheoryWhiteBagsRewriter, duplicate_removal)
{
Node x = d_skolemManager->mkDummySkolem("x", d_nodeManager->stringType());
- Node bag =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(5)));
+ Node bag = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(5)));
// (bag.duplicate_removal (bag x n)) = (bag x 1)
Node n = d_nodeManager->mkNode(BAG_DUPLICATE_REMOVAL, bag);
RewriteResponse response = d_rewriter->postRewrite(n);
- Node noDuplicate =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(1)));
+ Node noDuplicate = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(1)));
ASSERT_TRUE(response.d_node == noDuplicate
&& response.d_status == REWRITE_AGAIN_FULL);
}
std::vector<Node> elements = getNStrings(2);
Node emptyBag = d_nodeManager->mkConst(
EmptyBag(d_nodeManager->mkBagType(d_nodeManager->stringType())));
- Node A =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- elements[0],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(n)));
- Node B = d_nodeManager->mkBag(
- d_nodeManager->stringType(),
- elements[1],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(n + 1)));
+ Node A = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[0],
+ d_nodeManager->mkConstInt(Rational(n)));
+ Node B = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[1],
+ d_nodeManager->mkConstInt(Rational(n + 1)));
Node unionMaxAB = d_nodeManager->mkNode(BAG_UNION_MAX, A, B);
Node unionMaxBA = d_nodeManager->mkNode(BAG_UNION_MAX, B, A);
Node unionDisjointAB = d_nodeManager->mkNode(BAG_UNION_DISJOINT, A, B);
std::vector<Node> elements = getNStrings(3);
Node emptyBag = d_nodeManager->mkConst(
EmptyBag(d_nodeManager->mkBagType(d_nodeManager->stringType())));
- Node A =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- elements[0],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(n)));
- Node B = d_nodeManager->mkBag(
- d_nodeManager->stringType(),
- elements[1],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(n + 1)));
- Node C = d_nodeManager->mkBag(
- d_nodeManager->stringType(),
- elements[2],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(n + 2)));
+ Node A = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[0],
+ d_nodeManager->mkConstInt(Rational(n)));
+ Node B = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[1],
+ d_nodeManager->mkConstInt(Rational(n + 1)));
+ Node C = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[2],
+ d_nodeManager->mkConstInt(Rational(n + 2)));
Node unionDisjointAB = d_nodeManager->mkNode(BAG_UNION_DISJOINT, A, B);
Node unionDisjointBA = d_nodeManager->mkNode(BAG_UNION_DISJOINT, B, A);
std::vector<Node> elements = getNStrings(2);
Node emptyBag = d_nodeManager->mkConst(
EmptyBag(d_nodeManager->mkBagType(d_nodeManager->stringType())));
- Node A =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- elements[0],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(n)));
- Node B = d_nodeManager->mkBag(
- d_nodeManager->stringType(),
- elements[1],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(n + 1)));
+ Node A = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[0],
+ d_nodeManager->mkConstInt(Rational(n)));
+ Node B = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[1],
+ d_nodeManager->mkConstInt(Rational(n + 1)));
Node unionMaxAB = d_nodeManager->mkNode(BAG_UNION_MAX, A, B);
Node unionMaxBA = d_nodeManager->mkNode(BAG_UNION_MAX, B, A);
Node unionDisjointAB = d_nodeManager->mkNode(BAG_UNION_DISJOINT, A, B);
std::vector<Node> elements = getNStrings(2);
Node emptyBag = d_nodeManager->mkConst(
EmptyBag(d_nodeManager->mkBagType(d_nodeManager->stringType())));
- Node A =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- elements[0],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(n)));
- Node B = d_nodeManager->mkBag(
- d_nodeManager->stringType(),
- elements[1],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(n + 1)));
+ Node A = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[0],
+ d_nodeManager->mkConstInt(Rational(n)));
+ Node B = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[1],
+ d_nodeManager->mkConstInt(Rational(n + 1)));
Node unionMaxAB = d_nodeManager->mkNode(BAG_UNION_MAX, A, B);
Node unionMaxBA = d_nodeManager->mkNode(BAG_UNION_MAX, B, A);
Node unionDisjointAB = d_nodeManager->mkNode(BAG_UNION_DISJOINT, A, B);
std::vector<Node> elements = getNStrings(2);
Node emptyBag = d_nodeManager->mkConst(
EmptyBag(d_nodeManager->mkBagType(d_nodeManager->stringType())));
- Node A =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- elements[0],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(n)));
- Node B = d_nodeManager->mkBag(
- d_nodeManager->stringType(),
- elements[1],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(n + 1)));
+ Node A = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[0],
+ d_nodeManager->mkConstInt(Rational(n)));
+ Node B = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[1],
+ d_nodeManager->mkConstInt(Rational(n + 1)));
Node unionMaxAB = d_nodeManager->mkNode(BAG_UNION_MAX, A, B);
Node unionMaxBA = d_nodeManager->mkNode(BAG_UNION_MAX, B, A);
Node unionDisjointAB = d_nodeManager->mkNode(BAG_UNION_DISJOINT, A, B);
TEST_F(TestTheoryWhiteBagsRewriter, choose)
{
Node x = d_skolemManager->mkDummySkolem("x", d_nodeManager->stringType());
- Node c = d_nodeManager->mkConst(CONST_RATIONAL, Rational(3));
+ Node c = d_nodeManager->mkConstInt(Rational(3));
Node bag = d_nodeManager->mkBag(d_nodeManager->stringType(), x, c);
// (bag.choose (bag x c)) = x where c is a constant > 0
Node x = d_skolemManager->mkDummySkolem("x", d_nodeManager->stringType());
Node emptyBag = d_nodeManager->mkConst(
EmptyBag(d_nodeManager->mkBagType(d_nodeManager->stringType())));
- Node zero = d_nodeManager->mkConst(CONST_RATIONAL, Rational(0));
- Node c = d_nodeManager->mkConst(CONST_RATIONAL, Rational(3));
+ Node zero = d_nodeManager->mkConstInt(Rational(0));
+ Node c = d_nodeManager->mkConstInt(Rational(3));
Node bag = d_nodeManager->mkBag(d_nodeManager->stringType(), x, c);
std::vector<Node> elements = getNStrings(2);
- Node A =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- elements[0],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(4)));
- Node B =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- elements[1],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(5)));
+ Node A = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[0],
+ d_nodeManager->mkConstInt(Rational(4)));
+ Node B = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[1],
+ d_nodeManager->mkConstInt(Rational(5)));
Node unionDisjointAB = d_nodeManager->mkNode(BAG_UNION_DISJOINT, A, B);
// (bag.card (as bag.empty (Bag String)) = 0
// (bag.is_singleton (bag x c) = (c == 1)
Node n2 = d_nodeManager->mkNode(BAG_IS_SINGLETON, bag);
RewriteResponse response2 = d_rewriter->postRewrite(n2);
- Node one = d_nodeManager->mkConst(CONST_RATIONAL, Rational(1));
+ Node one = d_nodeManager->mkConstInt(Rational(1));
Node equal = c.eqNode(one);
ASSERT_TRUE(response2.d_node == equal
&& response2.d_status == REWRITE_AGAIN_FULL);
// (bag.from_set (set.singleton (set.singleton_op Int) x)) = (bag x 1)
Node n = d_nodeManager->mkNode(BAG_FROM_SET, singleton);
RewriteResponse response = d_rewriter->postRewrite(n);
- Node one = d_nodeManager->mkConst(CONST_RATIONAL, Rational(1));
+ Node one = d_nodeManager->mkConstInt(Rational(1));
Node bag = d_nodeManager->mkBag(d_nodeManager->stringType(), x, one);
ASSERT_TRUE(response.d_node == bag
&& response.d_status == REWRITE_AGAIN_FULL);
TEST_F(TestTheoryWhiteBagsRewriter, to_set)
{
Node x = d_skolemManager->mkDummySkolem("x", d_nodeManager->stringType());
- Node bag =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- x,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(5)));
+ Node bag = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), x, d_nodeManager->mkConstInt(Rational(5)));
// (bag.to_set (bag x n)) = (set.singleton (set.singleton_op T) x)
Node n = d_nodeManager->mkNode(BAG_TO_SET, bag);
std::vector<Node> elements = getNStrings(2);
Node a = d_nodeManager->mkConst(String("a"));
Node b = d_nodeManager->mkConst(String("b"));
- Node A =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- a,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(3)));
- Node B =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- b,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(4)));
+ Node A = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), a, d_nodeManager->mkConstInt(Rational(3)));
+ Node B = d_nodeManager->mkBag(
+ d_nodeManager->stringType(), b, d_nodeManager->mkConstInt(Rational(4)));
Node unionDisjointAB = d_nodeManager->mkNode(BAG_UNION_DISJOINT, A, B);
ASSERT_TRUE(unionDisjointAB.isConst());
// (bag "" 7))
Node n2 = d_nodeManager->mkNode(BAG_MAP, lambda, unionDisjointAB);
Node rewritten = Rewriter::rewrite(n2);
- Node bag =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- empty,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(7)));
+ Node bag = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ empty,
+ d_nodeManager->mkConstInt(Rational(7)));
// - (bag.map f (bag.union_disjoint K1 K2)) =
// (bag.union_disjoint (bag.map f K1) (bag.map f K2))
Node k1 = d_skolemManager->mkDummySkolem("K1", A.getType());
TypeNode bagIntegerType =
d_nodeManager->mkBagType(d_nodeManager->integerType());
Node emptybag = d_nodeManager->mkConst(EmptyBag(bagIntegerType));
- Node zero = d_nodeManager->mkConst(CONST_RATIONAL, Rational(0));
- Node one = d_nodeManager->mkConst(CONST_RATIONAL, Rational(1));
- Node ten = d_nodeManager->mkConst(CONST_RATIONAL, Rational(10));
- Node n = d_nodeManager->mkConst(CONST_RATIONAL, Rational(2));
+ Node zero = d_nodeManager->mkConstInt(Rational(0));
+ Node one = d_nodeManager->mkConstInt(Rational(1));
+ Node ten = d_nodeManager->mkConstInt(Rational(10));
+ Node n = d_nodeManager->mkConstInt(Rational(2));
Node x = d_nodeManager->mkBoundVar("x", d_nodeManager->integerType());
Node y = d_nodeManager->mkBoundVar("y", d_nodeManager->integerType());
Node xy = d_nodeManager->mkNode(BOUND_VAR_LIST, x, y);
// (bag.fold (lambda ((x Int)(y Int)) (+ x y)) 1 (bag 10 2)) = 21
bag = d_nodeManager->mkBag(d_nodeManager->integerType(), ten, n);
Node node3 = d_nodeManager->mkNode(BAG_FOLD, f, one, bag);
- Node result3 = d_nodeManager->mkConst(CONST_RATIONAL, Rational(21));
+ Node result3 = d_nodeManager->mkConstInt(Rational(21));
Node response3 = Rewriter::rewrite(node3);
ASSERT_TRUE(response3 == result3);
TEST_F(TestTheoryWhiteBagsTypeRule, count_operator)
{
std::vector<Node> elements = getNStrings(1);
- Node bag = d_nodeManager->mkBag(
- d_nodeManager->stringType(),
- elements[0],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(100)));
+ Node bag = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[0],
+ d_nodeManager->mkConstInt(Rational(100)));
Node count = d_nodeManager->mkNode(BAG_COUNT, elements[0], bag);
- Node node = d_nodeManager->mkConst(CONST_RATIONAL, Rational(10));
+ Node node = d_nodeManager->mkConstInt(Rational(10));
// node of type Int is not compatible with bag of type (Bag String)
ASSERT_THROW(d_nodeManager->mkNode(BAG_COUNT, node, bag).getType(true),
TEST_F(TestTheoryWhiteBagsTypeRule, duplicate_removal_operator)
{
std::vector<Node> elements = getNStrings(1);
- Node bag = d_nodeManager->mkBag(
- d_nodeManager->stringType(),
- elements[0],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(10)));
+ Node bag = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[0],
+ d_nodeManager->mkConstInt(Rational(10)));
ASSERT_NO_THROW(d_nodeManager->mkNode(BAG_DUPLICATE_REMOVAL, bag));
ASSERT_EQ(d_nodeManager->mkNode(BAG_DUPLICATE_REMOVAL, bag).getType(),
bag.getType());
TEST_F(TestTheoryWhiteBagsTypeRule, mkBag_operator)
{
std::vector<Node> elements = getNStrings(1);
- Node negative = d_nodeManager->mkBag(
- d_nodeManager->stringType(),
- elements[0],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(-1)));
- Node zero =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- elements[0],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(0)));
- Node positive =
- d_nodeManager->mkBag(d_nodeManager->stringType(),
- elements[0],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(1)));
+ Node negative = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[0],
+ d_nodeManager->mkConstInt(Rational(-1)));
+ Node zero = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[0],
+ d_nodeManager->mkConstInt(Rational(0)));
+ Node positive = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[0],
+ d_nodeManager->mkConstInt(Rational(1)));
// only positive multiplicity are constants
ASSERT_FALSE(BagMakeTypeRule::computeIsConst(d_nodeManager, negative));
TEST_F(TestTheoryWhiteBagsTypeRule, to_set_operator)
{
std::vector<Node> elements = getNStrings(1);
- Node bag = d_nodeManager->mkBag(
- d_nodeManager->stringType(),
- elements[0],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(10)));
+ Node bag = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[0],
+ d_nodeManager->mkConstInt(Rational(10)));
ASSERT_NO_THROW(d_nodeManager->mkNode(BAG_TO_SET, bag));
ASSERT_TRUE(d_nodeManager->mkNode(BAG_TO_SET, bag).getType().isSet());
}
TEST_F(TestTheoryWhiteBagsTypeRule, map_operator)
{
std::vector<Node> elements = getNStrings(1);
- Node bag = d_nodeManager->mkBag(
- d_nodeManager->stringType(),
- elements[0],
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(10)));
+ Node bag = d_nodeManager->mkBag(d_nodeManager->stringType(),
+ elements[0],
+ d_nodeManager->mkConstInt(Rational(10)));
Node set =
d_nodeManager->mkSingleton(d_nodeManager->stringType(), elements[0]);
ASSERT_EQ(d_nodeManager->integerType(),
mappedBag.getType().getBagElementType());
- Node one = d_nodeManager->mkConst(CONST_RATIONAL, Rational(1));
+ Node one = d_nodeManager->mkConstInt(Rational(1));
Node x2 = d_nodeManager->mkBoundVar("x", d_nodeManager->integerType());
std::vector<Node> args2;
args2.push_back(x2);
{
TypeNode arrType = d_nodeManager->mkArrayType(d_nodeManager->integerType(),
d_nodeManager->integerType());
- Node zero = d_nodeManager->mkConst(CONST_RATIONAL, Rational(0));
- Node one = d_nodeManager->mkConst(CONST_RATIONAL, Rational(1));
+ Node zero = d_nodeManager->mkConstInt(Rational(0));
+ Node one = d_nodeManager->mkConstInt(Rational(1));
Node storeAll = d_nodeManager->mkConst(ArrayStoreAll(arrType, zero));
ASSERT_TRUE(storeAll.isConst());
TestSmtNoFinishInit::SetUp();
d_slvEngine->setOption("produce-models", "true");
d_slvEngine->finishInit();
- d_true = d_nodeManager->mkConst<bool>(true);
- d_one = d_nodeManager->mkConst<Rational>(CONST_RATIONAL, Rational(1));
}
- Node d_true;
- Node d_one;
};
TEST_F(TestTheoryWhiteBvIntblaster, intblaster_constants)
env.d_logic.lock();
IntBlaster intBlaster(env, options::SolveBVAsIntMode::SUM, 1);
Node result = intBlaster.translateNoChildren(bv7_4, lemmas, skolems);
- Node seven = d_nodeManager->mkConst(CONST_RATIONAL, Rational(7));
+ Node seven = d_nodeManager->mkConstInt(Rational(7));
ASSERT_EQ(seven, result);
// translating integer constants should not change them
Node z = d_nodeManager->mkVar("z", d_nodeManager->integerType());
// make the expression (ADD x y (MULT z 0))
- Node zero = d_nodeManager->mkConst(CONST_RATIONAL, Rational("0"));
+ Node zero = d_nodeManager->mkConstInt(Rational("0"));
Node zTimesZero = d_nodeManager->mkNode(MULT, z, zero);
Node n = d_nodeManager->mkNode(ADD, x, y, zTimesZero);
"g",
d_nodeManager->mkFunctionType(d_nodeManager->realType(),
d_nodeManager->integerType()));
- Node one = d_nodeManager->mkConst(CONST_RATIONAL, Rational("1"));
- Node two = d_nodeManager->mkConst(CONST_RATIONAL, Rational("2"));
+ Node one = d_nodeManager->mkConstInt(Rational("1"));
+ Node two = d_nodeManager->mkConstInt(Rational("2"));
Node f1 = d_nodeManager->mkNode(APPLY_UF, f, one);
Node f2 = d_nodeManager->mkNode(APPLY_UF, f, two);
TEST_F(TestTheoryWhiteIntOpt, max)
{
- Node ub = d_nodeManager->mkConst(CONST_RATIONAL, Rational("100"));
- Node lb = d_nodeManager->mkConst(CONST_RATIONAL, Rational("0"));
+ Node ub = d_nodeManager->mkConstInt(Rational("100"));
+ Node lb = d_nodeManager->mkConstInt(Rational("0"));
// Objectives to be optimized max_cost is max objective
Node max_cost = d_nodeManager->mkVar(*d_intType);
TEST_F(TestTheoryWhiteIntOpt, min)
{
- Node ub = d_nodeManager->mkConst(CONST_RATIONAL, Rational("100"));
- Node lb = d_nodeManager->mkConst(CONST_RATIONAL, Rational("0"));
+ Node ub = d_nodeManager->mkConstInt(Rational("100"));
+ Node lb = d_nodeManager->mkConstInt(Rational("0"));
// Objectives to be optimized max_cost is max objective
Node max_cost = d_nodeManager->mkVar(*d_intType);
TEST_F(TestTheoryWhiteIntOpt, result)
{
- Node ub = d_nodeManager->mkConst(CONST_RATIONAL, Rational("100"));
- Node lb = d_nodeManager->mkConst(CONST_RATIONAL, Rational("0"));
+ Node ub = d_nodeManager->mkConstInt(Rational("100"));
+ Node lb = d_nodeManager->mkConstInt(Rational("0"));
// Objectives to be optimized max_cost is max objective
Node max_cost = d_nodeManager->mkVar(*d_intType);
TEST_F(TestTheoryWhiteIntOpt, open_interval)
{
- Node ub1 = d_nodeManager->mkConst(CONST_RATIONAL, Rational("100"));
- Node lb1 = d_nodeManager->mkConst(CONST_RATIONAL, Rational("0"));
- Node lb2 = d_nodeManager->mkConst(CONST_RATIONAL, Rational("110"));
+ Node ub1 = d_nodeManager->mkConstInt(Rational("100"));
+ Node lb1 = d_nodeManager->mkConstInt(Rational("0"));
+ Node lb2 = d_nodeManager->mkConstInt(Rational("110"));
Node cost1 = d_nodeManager->mkVar(*d_intType);
Node cost2 = d_nodeManager->mkVar(*d_intType);
TEST_F(TestTheoryWhiteSetsRewriter, map)
{
- Node one = d_nodeManager->mkConst(CONST_RATIONAL, Rational(1));
+ Node one = d_nodeManager->mkConstInt(Rational(1));
TypeNode stringType = d_nodeManager->stringType();
TypeNode integerType = d_nodeManager->integerType();
Node emptysetInteger =
TEST_F(TestTheoryBlackStringsSkolemCache, mkSkolemCached)
{
- Node zero = d_nodeManager->mkConst(CONST_RATIONAL, Rational(0));
+ Node zero = d_nodeManager->mkConstInt(Rational(0));
Node n = d_skolemManager->mkDummySkolem("n", d_nodeManager->integerType());
Node a = d_skolemManager->mkDummySkolem("a", d_nodeManager->stringType());
Node b = d_skolemManager->mkDummySkolem("b", d_nodeManager->stringType());
{
TypeEnumerator te(d_nodeManager->integerType());
ASSERT_FALSE(te.isFinished());
- ASSERT_EQ(*te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(0)));
+ ASSERT_EQ(*te, d_nodeManager->mkConstInt(Rational(0)));
for (int i = 1; i <= 100; ++i)
{
ASSERT_FALSE(te.isFinished());
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(i)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstInt(Rational(i)));
ASSERT_FALSE(te.isFinished());
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(-i)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstInt(Rational(-i)));
}
ASSERT_FALSE(te.isFinished());
te = TypeEnumerator(d_nodeManager->realType());
ASSERT_FALSE(te.isFinished());
- ASSERT_EQ(*te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(0, 1)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(1, 1)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(-1, 1)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(2, 1)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(-2, 1)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(1, 2)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(-1, 2)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(3, 1)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(-3, 1)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(1, 3)));
+ ASSERT_EQ(*te, d_nodeManager->mkConstReal(Rational(0, 1)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(1, 1)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(-1, 1)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(2, 1)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(-2, 1)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(1, 2)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(-1, 2)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(3, 1)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(-3, 1)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(1, 3)));
ASSERT_FALSE(te.isFinished());
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(-1, 3)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(4, 1)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(-4, 1)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(3, 2)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(-3, 2)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(2, 3)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(-2, 3)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(1, 4)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(-1, 4)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(5, 1)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(-5, 1)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(-1, 3)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(4, 1)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(-4, 1)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(3, 2)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(-3, 2)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(2, 3)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(-2, 3)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(1, 4)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(-1, 4)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(5, 1)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(-5, 1)));
ASSERT_FALSE(te.isFinished());
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(1, 5)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(-1, 5)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(6, 1)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(-6, 1)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(5, 2)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(-5, 2)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(4, 3)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(-4, 3)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(3, 4)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(-3, 4)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(2, 5)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(-2, 5)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(1, 6)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(1, 5)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(-1, 5)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(6, 1)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(-6, 1)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(5, 2)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(-5, 2)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(4, 3)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(-4, 3)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(3, 4)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(-3, 4)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(2, 5)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(-2, 5)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(1, 6)));
ASSERT_FALSE(te.isFinished());
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(-1, 6)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(7, 1)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(-7, 1)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(5, 3)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(-5, 3)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(3, 5)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(-3, 5)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(1, 7)));
- ASSERT_EQ(*++te, d_nodeManager->mkConst(CONST_RATIONAL, Rational(-1, 7)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(-1, 6)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(7, 1)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(-7, 1)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(5, 3)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(-5, 3)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(3, 5)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(-3, 5)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(1, 7)));
+ ASSERT_EQ(*++te, d_nodeManager->mkConstReal(Rational(-1, 7)));
ASSERT_FALSE(te.isFinished());
}
// ensure that certain items were found
TypeNode arrayType = d_nodeManager->mkArrayType(d_nodeManager->integerType(),
d_nodeManager->integerType());
- Node zeroes = d_nodeManager->mkConst(ArrayStoreAll(
- arrayType, d_nodeManager->mkConst(CONST_RATIONAL, Rational(0))));
- Node ones = d_nodeManager->mkConst(ArrayStoreAll(
- arrayType, d_nodeManager->mkConst(CONST_RATIONAL, Rational(1))));
- Node twos = d_nodeManager->mkConst(ArrayStoreAll(
- arrayType, d_nodeManager->mkConst(CONST_RATIONAL, Rational(2))));
- Node threes = d_nodeManager->mkConst(ArrayStoreAll(
- arrayType, d_nodeManager->mkConst(CONST_RATIONAL, Rational(3))));
- Node fours = d_nodeManager->mkConst(ArrayStoreAll(
- arrayType, d_nodeManager->mkConst(CONST_RATIONAL, Rational(4))));
- Node tens = d_nodeManager->mkConst(ArrayStoreAll(
- arrayType, d_nodeManager->mkConst(CONST_RATIONAL, Rational(10))));
+ Node zeroes = d_nodeManager->mkConst(
+ ArrayStoreAll(arrayType, d_nodeManager->mkConstInt(Rational(0))));
+ Node ones = d_nodeManager->mkConst(
+ ArrayStoreAll(arrayType, d_nodeManager->mkConstInt(Rational(1))));
+ Node twos = d_nodeManager->mkConst(
+ ArrayStoreAll(arrayType, d_nodeManager->mkConstInt(Rational(2))));
+ Node threes = d_nodeManager->mkConst(
+ ArrayStoreAll(arrayType, d_nodeManager->mkConstInt(Rational(3))));
+ Node fours = d_nodeManager->mkConst(
+ ArrayStoreAll(arrayType, d_nodeManager->mkConstInt(Rational(4))));
+ Node tens = d_nodeManager->mkConst(
+ ArrayStoreAll(arrayType, d_nodeManager->mkConstInt(Rational(10))));
- Node zero = d_nodeManager->mkConst(CONST_RATIONAL, Rational(0));
- Node one = d_nodeManager->mkConst(CONST_RATIONAL, Rational(1));
- Node two = d_nodeManager->mkConst(CONST_RATIONAL, Rational(2));
- Node three = d_nodeManager->mkConst(CONST_RATIONAL, Rational(3));
- Node four = d_nodeManager->mkConst(CONST_RATIONAL, Rational(4));
- Node five = d_nodeManager->mkConst(CONST_RATIONAL, Rational(5));
- Node eleven = d_nodeManager->mkConst(CONST_RATIONAL, Rational(11));
+ Node zero = d_nodeManager->mkConstInt(Rational(0));
+ Node one = d_nodeManager->mkConstInt(Rational(1));
+ Node two = d_nodeManager->mkConstInt(Rational(2));
+ Node three = d_nodeManager->mkConstInt(Rational(3));
+ Node four = d_nodeManager->mkConstInt(Rational(4));
+ Node five = d_nodeManager->mkConstInt(Rational(5));
+ Node eleven = d_nodeManager->mkConstInt(Rational(11));
ASSERT_EQ(elts.find(d_nodeManager->mkNode(STORE, ones, zero, zero)),
elts.end());
TypeNode usort = d_nodeManager->mkSort("U");
ArrayStoreAll(d_nodeManager->mkArrayType(d_nodeManager->integerType(),
d_nodeManager->realType()),
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(9, 2)));
+ d_nodeManager->mkConstReal(Rational(9, 2)));
ArrayStoreAll(d_nodeManager->mkArrayType(d_nodeManager->mkSort("U"), usort),
d_nodeManager->mkConst(UninterpretedSortValue(usort, 0)));
ArrayStoreAll(d_nodeManager->mkArrayType(d_nodeManager->mkBitVectorType(8),
d_nodeManager->realType()),
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(0)));
+ d_nodeManager->mkConstInt(Rational(0)));
ArrayStoreAll(d_nodeManager->mkArrayType(d_nodeManager->mkBitVectorType(8),
d_nodeManager->integerType()),
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(0)));
+ d_nodeManager->mkConstInt(Rational(0)));
}
TEST_F(TestUtilWhiteArrayStoreAll, type_errors)
d_nodeManager->mkConst(UninterpretedSortValue(
d_nodeManager->mkSort("U"), 0))),
IllegalArgumentException);
- ASSERT_THROW(
- ArrayStoreAll(d_nodeManager->integerType(),
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(9, 2))),
- IllegalArgumentException);
+ ASSERT_THROW(ArrayStoreAll(d_nodeManager->integerType(),
+ d_nodeManager->mkConstReal(Rational(9, 2))),
+ IllegalArgumentException);
ASSERT_THROW(
ArrayStoreAll(d_nodeManager->mkArrayType(d_nodeManager->integerType(),
d_nodeManager->mkSort("U")),
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(9, 2))),
+ d_nodeManager->mkConstReal(Rational(9, 2))),
IllegalArgumentException);
}
ArrayStoreAll(d_nodeManager->integerType(),
d_nodeManager->mkVar("x", d_nodeManager->integerType())),
IllegalArgumentException);
- ASSERT_THROW(
- ArrayStoreAll(d_nodeManager->integerType(),
- d_nodeManager->mkNode(
- kind::ADD,
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(1)),
- d_nodeManager->mkConst(CONST_RATIONAL, Rational(0)))),
- IllegalArgumentException);
+ ASSERT_THROW(ArrayStoreAll(d_nodeManager->integerType(),
+ d_nodeManager->mkNode(
+ kind::ADD,
+ d_nodeManager->mkConstInt(Rational(1)),
+ d_nodeManager->mkConstInt(Rational(0)))),
+ IllegalArgumentException);
}
} // namespace test
} // namespace cvc5::internal
const DType& ldt = listType.getDType();
Node updater = ldt[0][0].getUpdater();
Node gt = d_nodeManager->mkGroundTerm(listType);
- Node zero = d_nodeManager->mkConst(CONST_RATIONAL, Rational(0));
+ Node zero = d_nodeManager->mkConstInt(Rational(0));
Node truen = d_nodeManager->mkConst(true);
// construct an update term
Node uterm = d_nodeManager->mkNode(kind::APPLY_UPDATER, updater, gt, zero);