std::vector<Node>{})),
d_zero(NodeManager::currentNM()->mkConst(::CVC4::Rational(0))),
d_one(NodeManager::currentNM()->mkConst(::CVC4::Rational(1))),
- d_rMaxInt(UINT32_MAX),
d_sigma(NodeManager::currentNM()->mkNode(kind::REGEXP_SIGMA,
std::vector<Node>{})),
d_sigma_star(NodeManager::currentNM()->mkNode(kind::REGEXP_STAR, d_sigma))
bool RegExpOpr::containC2(unsigned cnt, Node n) {
if(n.getKind() == kind::REGEXP_RV) {
- Assert(n[0].getConst<Rational>() <= d_rMaxInt,
+ Assert(n[0].getConst<Rational>() <= Rational(String::maxSize()),
"Exceeded UINT32_MAX in RegExpOpr::containC2");
unsigned y = n[0].getConst<Rational>().getNumerator().toUnsignedInt();
return cnt == y;
r1 = d_emptySingleton;
r2 = d_emptySingleton;
} else if(n.getKind() == kind::REGEXP_RV) {
- Assert(n[0].getConst<Rational>() <= d_rMaxInt,
+ Assert(n[0].getConst<Rational>() <= Rational(String::maxSize()),
"Exceeded UINT32_MAX in RegExpOpr::convert2");
unsigned y = n[0].getConst<Rational>().getNumerator().toUnsignedInt();
r1 = d_emptySingleton;
Node d_emptyRegexp;
Node d_zero;
Node d_one;
- CVC4::Rational d_rMaxInt;
Node d_sigma;
Node d_sigma_star;
Valuation valuation,
const LogicInfo& logicInfo)
: Theory(THEORY_STRINGS, c, u, out, valuation, logicInfo),
- d_rMaxInt(UINT32_MAX),
d_notify(*this),
d_equalityEngine(d_notify, c, "theory::strings", true),
d_conflict(c, false),
Trace("strings-model") << " } (length is " << lts[i] << ")" << std::endl;
if( lts[i].isConst() ) {
lts_values.push_back( lts[i] );
- Assert(lts[i].getConst<Rational>() <= d_rMaxInt,
+ Assert(lts[i].getConst<Rational>() <= Rational(String::maxSize()),
"Exceeded UINT32_MAX in string model");
unsigned lvalue = lts[i].getConst<Rational>().getNumerator().toUnsignedInt();
values_used[ lvalue ] = true;
Node v = d_valuation.getModelValue(lts[i]);
Trace("strings-model") << "Model value for " << lts[i] << " is " << v << std::endl;
lts_values.push_back( v );
- Assert(v.getConst<Rational>() <= d_rMaxInt,
+ Assert(v.getConst<Rational>() <= Rational(String::maxSize()),
"Exceeded UINT32_MAX in string model");
unsigned lvalue = v.getConst<Rational>().getNumerator().toUnsignedInt();
values_used[ lvalue ] = true;
Trace("strings-model") << std::endl;
//use type enumerator
- Assert(lts_values[i].getConst<Rational>() <= d_rMaxInt,
+ Assert(lts_values[i].getConst<Rational>() <= Rational(String::maxSize()),
"Exceeded UINT32_MAX in string model");
StringEnumeratorLength sel(lts_values[i].getConst<Rational>().getNumerator().toUnsignedInt());
for (const Node& eqc : pure_eq)
Node d_zero;
Node d_one;
Node d_neg_one;
- CVC4::Rational d_rMaxInt;
unsigned d_card_size;
// Helper functions
Node getRepresentative( Node t );
}
TNode n1 = node[1];
NodeManager* nm = NodeManager::currentNM();
- CVC4::Rational rMaxInt(UINT32_MAX);
+ CVC4::Rational rMaxInt(String::maxSize());
AlwaysAssert(n1.isConst(), "re.loop contains non-constant integer (1).");
AlwaysAssert(n1.getConst<Rational>().sgn() >= 0,
"Negative integer in string REGEXP_LOOP (1)");
if (node[1].isConst() && node[2].isConst())
{
CVC4::String s = node[0].getConst<String>();
- CVC4::Rational rMaxInt(UINT32_MAX);
+ CVC4::Rational rMaxInt(String::maxSize());
uint32_t start;
if (node[1].getConst<Rational>() > rMaxInt)
{
// we can remove part of the constant
// lower bound minus the length of a concrete string is negative,
// hence lowerBound cannot be larger than long max
- Assert(lbr < Rational(UINT32_MAX));
+ Assert(lbr < Rational(String::maxSize()));
curr = Rewriter::rewrite(NodeManager::currentNM()->mkNode(
kind::MINUS, curr, lowerBound));
uint32_t lbsize = lbr.getNumerator().toUnsignedInt();
return c >= '0' && c <= '9';
}
-size_t String::maxSize()
-{
- return std::numeric_limits<size_t>::max();
-}
+size_t String::maxSize() { return std::numeric_limits<uint32_t>::max(); }
+
Rational String::toNumber() const
{
// when smt2 standard for strings is set, this may change, based on the