pos = new_pos + s.size();
}
}
- else if (n[i].getKind() == kind::STRING_ITOS)
+ else if (n[i].getKind() == kind::STRING_ITOS && checkEntailArith(n[i][0]))
{
// find the first occurrence of a digit starting at pos
while (pos < tvec.size() && !String::isDigit(tvec[pos]))
regress0/strings/ilc-like.smt2
regress0/strings/indexof-sym-simp.smt2
regress0/strings/issue1189.smt2
+ regress0/strings/itos-entail.smt2
regress0/strings/leadingzero001.smt2
regress0/strings/loop001.smt2
regress0/strings/model001.smt2
--- /dev/null
+(set-info :smt-lib-version 2.5)
+(set-logic ALL)
+(set-info :status sat)
+(set-option :strings-exp true)
+(declare-fun x () Int)
+(declare-fun y () String)
+(declare-fun z () String)
+
+(assert (str.contains "ABCD" (str.++ y (int.to.str x) z)))
+
+(check-sat)
(set-info :status unsat)
(declare-fun x () String)
(declare-fun y () String)
-(declare-fun z () Int)
+(declare-fun z () String)
; these should all rewrite to false
(assert (or
-(str.contains "abcdef0ghij1abced" (str.++ "g" (int.to.str z) x "a" y (int.to.str (+ z 1))))
-(str.contains "abc23cd" (str.++ (int.to.str z) (int.to.str z) (int.to.str z)))
+(str.contains "abcdef0ghij1abced" (str.++ "g" (int.to.str (str.len z)) x "a" y (int.to.str (+ (str.len z) 1))))
+(str.contains "abc23cd" (str.++ (int.to.str (str.len z)) (int.to.str (str.len z)) (int.to.str (str.len z))))
(not (str.contains (str.++ x "ab" y) (str.++ "b" (str.substr y 0 4))))
(not (str.contains (str.++ x "ab" y) (str.++ (str.substr x 5 (str.len x)) "a")))
(str.contains (str.++ x y) (str.++ x "a" y))