diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2018-11-28 14:58:33 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-28 14:58:33 -0600 |
commit | c92e6e49040b3ca4c33fbedb8e2a30ac3318fb8d (patch) | |
tree | 9d960c0de1fe5fbf4fbdc114839341112077f19b /src/theory/strings/regexp_elim.cpp | |
parent | eef3d0d658aed64e8014c28eae5841eed298139a (diff) |
Optimize re-elim for re.allchar components (#2725)
Diffstat (limited to 'src/theory/strings/regexp_elim.cpp')
-rw-r--r-- | src/theory/strings/regexp_elim.cpp | 10 |
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); } |