diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2019-02-05 09:08:19 -0800 |
---|---|---|
committer | Andres Noetzli <andres.noetzli@gmail.com> | 2019-02-05 09:08:19 -0800 |
commit | d1e312cfe865bd7c167dff473f508f739d5ddc3b (patch) | |
tree | b2ec78178e0892224ca11c6a57585909ed4293ca /src | |
parent | ac1d170fa6c287614ffcadc5e27f136cee593664 (diff) |
Make stripConstantEndpoints() less aggressive
`stripConstantEndpoints({ "A" }, { "A". (int.to.str n) }, {}, {}, 0)`
was cutting off "A" because it is a non-digit. This is wrong, however,
because `(int.to.str n)` can return the empty string. This commit
makes `stripConstantEndpoints()` less aggressive by not using
`str.to.int` terms to cut off non-digits anymore.
Diffstat (limited to 'src')
-rw-r--r-- | src/theory/strings/theory_strings_rewriter.cpp | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/src/theory/strings/theory_strings_rewriter.cpp b/src/theory/strings/theory_strings_rewriter.cpp index 8d9d6a230..cbb298c5f 100644 --- a/src/theory/strings/theory_strings_rewriter.cpp +++ b/src/theory/strings/theory_strings_rewriter.cpp @@ -3683,26 +3683,6 @@ bool TheoryStringsRewriter::stripConstantEndpoints(std::vector<Node>& n1, overlap = s.size() - ret; } } - else if (n2[index1].getKind() == kind::STRING_ITOS) - { - const std::vector<unsigned>& svec = s.getVec(); - // can remove up to the first occurrence of a digit - unsigned svsize = svec.size(); - for (unsigned i = 0; i < svsize; i++) - { - unsigned sindex = r == 0 ? i : (svsize - 1) - i; - if (String::isDigit(svec[sindex])) - { - break; - } - else if (sss.empty()) // only if not substr - { - // e.g. str.contains( str.++( "a", x ), int.to.str(y) ) --> - // str.contains( x, int.to.str(y) ) - overlap--; - } - } - } else { // inconclusive |