summaryrefslogtreecommitdiff
path: root/src/theory/strings
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2018-11-28 14:58:33 -0600
committerGitHub <noreply@github.com>2018-11-28 14:58:33 -0600
commitc92e6e49040b3ca4c33fbedb8e2a30ac3318fb8d (patch)
tree9d960c0de1fe5fbf4fbdc114839341112077f19b /src/theory/strings
parenteef3d0d658aed64e8014c28eae5841eed298139a (diff)
Optimize re-elim for re.allchar components (#2725)
Diffstat (limited to 'src/theory/strings')
-rw-r--r--src/theory/strings/regexp_elim.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/theory/strings/regexp_elim.cpp b/src/theory/strings/regexp_elim.cpp
index a0d806c52..749816280 100644
--- a/src/theory/strings/regexp_elim.cpp
+++ b/src/theory/strings/regexp_elim.cpp
@@ -110,8 +110,14 @@ Node RegExpElimination::eliminateConcat(Node atom)
else
{
Node curr = nm->mkNode(STRING_SUBSTR, x, currEnd, childLengths[i]);
- Node currMem = nm->mkNode(STRING_IN_REGEXP, curr, re[i]);
- conc.push_back(currMem);
+ // We do not need to include memberships of the form
+ // (str.substr x n 1) in re.allchar
+ // since we know that by construction, n < len( x ).
+ if (re[i].getKind() != REGEXP_SIGMA)
+ {
+ Node currMem = nm->mkNode(STRING_IN_REGEXP, curr, re[i]);
+ conc.push_back(currMem);
+ }
currEnd = nm->mkNode(PLUS, currEnd, childLengths[i]);
currEnd = Rewriter::rewrite(currEnd);
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback