Leads to incorrect rewrites. Fixes #8970.
}
}
}
- if (sindex > 0 && (!strict || curr == zero))
+ if (strict && curr != zero)
+ {
+ // return false if we did not strip the entire length
+ ret = false;
+ }
+ else if (sindex > 0)
{
if (dir == 1)
{
regress1/strings/issue8918-str-nth-crange-red.smt2
regress1/strings/issue8932-cmi-unit.smt2
regress1/strings/issue8944-sygus-inst.smt2
+ regress1/strings/issue8970-strip-sym-len.smt2
regress1/strings/kaluza-fl.smt2
regress1/strings/loop002.smt2
regress1/strings/loop003.smt2
--- /dev/null
+; EXPECT: sat
+(set-logic QF_SLIA)
+(declare-fun t () String)
+(assert (str.prefixof "-" (str.substr t 0 1)))
+(assert (> (str.len (str.substr t 0 2)) 1))
+(assert (= "-0" (str.update "-0" 0 t)))
+(assert (str.suffixof (str.replace t "-0" "-") "-"))
+(check-sat)