summaryrefslogtreecommitdiff
path: root/src/theory/strings
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2021-02-19 08:43:22 -0600
committerGitHub <noreply@github.com>2021-02-19 08:43:22 -0600
commit00479d03cdeac3e864a1930dddb16c71c5bf2ce9 (patch)
tree0870425e639bfb51933fd66e1d7bdd5da6648497 /src/theory/strings
parentb30adb7a22091dfcd2f81f7cf04334e2240c19bd (diff)
Fix rewrite for contains over replace (#5924)
Fixes model soundness issue (fixes #5915).
Diffstat (limited to 'src/theory/strings')
-rw-r--r--src/theory/strings/sequences_rewriter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/theory/strings/sequences_rewriter.cpp b/src/theory/strings/sequences_rewriter.cpp
index 2a30727ba..be1bd9045 100644
--- a/src/theory/strings/sequences_rewriter.cpp
+++ b/src/theory/strings/sequences_rewriter.cpp
@@ -2206,7 +2206,7 @@ Node SequencesRewriter::rewriteContains(Node node)
// if (str.contains z w) ---> false and (str.len w) = 1
if (StringsEntail::checkLengthOne(node[1]))
{
- Node ctn = d_stringsEntail.checkContains(node[1], node[0][2]);
+ Node ctn = d_stringsEntail.checkContains(node[0][2], node[1]);
if (!ctn.isNull() && !ctn.getConst<bool>())
{
Node empty = Word::mkEmptyWord(stype);
@@ -2558,7 +2558,7 @@ Node SequencesRewriter::rewriteReplace(Node node)
// check if contains definitely does (or does not) hold
Node cmp_con = nm->mkNode(kind::STRING_STRCTN, node[0], node[1]);
Node cmp_conr = Rewriter::rewrite(cmp_con);
- if (!d_stringsEntail.checkContains(node[0], node[1]).isNull())
+ if (cmp_conr.isConst())
{
if (cmp_conr.getConst<bool>())
{
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback