Fixes #8481.
bool EagerSolver::addArithmeticBound(EqcInfo* e, Node t, bool isLower)
{
+ Trace("strings-eager-aconf-debug")
+ << "addArithmeticBound " << t << ", isLower = " << isLower << "..."
+ << std::endl;
Assert(e != nullptr);
Assert(!t.isNull());
Node tb = t.isConst() ? t : getBoundForLength(t, isLower);
Assert(!prevob.isNull() && prevob.isConst()
&& prevob.getType().isRealOrInt());
Rational prevobr = prevob.getConst<Rational>();
+ Trace("strings-eager-aconf-debug")
+ << "Previous opposite bound was " << prevobr << ", current bound is "
+ << br << ", isLower = " << isLower << std::endl;
if (prevobr != br && (prevobr < br) == isLower)
{
// conflict
{
if (t.getKind() == STRING_IN_REGEXP)
{
- return d_rent.getConstantBoundLengthForRegexp(t[1]);
+ return d_rent.getConstantBoundLengthForRegexp(t[1], isLower);
}
Assert(t.getKind() == STRING_LENGTH);
// it is prohibitively expensive to convert to original form and rewrite,
{
ret = d_zero;
}
+ Trace("strings-rentail") << "getConstantBoundLengthForRegexp: " << n
+ << ", isLower=" << isLower << " returns " << ret
+ << std::endl;
setConstantBoundCache(n, ret, isLower);
return ret;
}
* regular expression n. Return null if a constant bound cannot be determined.
* This method will always worst case return 0 as a lower bound.
*/
- Node getConstantBoundLengthForRegexp(TNode n, bool isLower = true) const;
+ Node getConstantBoundLengthForRegexp(TNode n, bool isLower) const;
/**
* Returns true if we can show that the regular expression `r1` includes
* the regular expression `r2` (i.e. `r1` matches a superset of sequences
regress0/strings/issue7974-incomplete-neg-member.smt2
regress0/strings/issue8295-star-union-char.smt2
regress0/strings/issue8346-idof-max.smt2
+ regress0/strings/issue8481.smt2
+ regress0/strings/issue8481-2.smt2
regress0/strings/itos-entail.smt2
regress0/strings/large-model.smt2
regress0/strings/leadingzero001.smt2
--- /dev/null
+; COMMAND-LINE: --strings-eager-len-re
+; EXPECT: sat
+(set-logic QF_S)
+(declare-fun v () String)
+(assert (str.in_re (str.++ v v) (re.++ (str.to_re "a") (re.opt (str.to_re "a")))))
+(assert (str.in_re v (re.range "a" "u")))
+(check-sat)
--- /dev/null
+; COMMAND-LINE: --strings-eager-len-re
+; EXPECT: sat
+(set-logic QF_S)
+(declare-fun a () String)
+(declare-fun b () String)
+(assert (str.in_re (str.replace b a "") (re.++ (str.to_re "u") (re.union (str.to_re "b") (str.to_re "")))))
+(assert (= (str.to_int (str.++ a a)) 0))
+(check-sat)