Pass empty vector when constructing re empty, fixes rewrite (#6576)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Wed, 19 May 2021 22:50:43 +0000 (17:50 -0500)
committerGitHub <noreply@github.com>
Wed, 19 May 2021 22:50:43 +0000 (22:50 +0000)
Fixes #6567.

src/theory/strings/sequences_rewriter.cpp
test/regress/CMakeLists.txt
test/regress/regress1/strings/issue6567-empty-re-range.smt2 [new file with mode: 0644]

index e827e87d349d29916f5056a3a074728a7da5218d..bc77a9bc52b9728fa87422136254f6002963eb77 100644 (file)
@@ -1151,7 +1151,8 @@ Node SequencesRewriter::rewriteRangeRegExp(TNode node)
   if (ch[0] > ch[1])
   {
     // re.range( "B", "A" ) ---> re.none
-    Node retNode = nm->mkNode(REGEXP_EMPTY, {});
+    std::vector<Node> emptyVec;
+    Node retNode = nm->mkNode(REGEXP_EMPTY, emptyVec);
     return returnRewrite(node, retNode, Rewrite::RE_RANGE_EMPTY);
   }
   return node;
index 1478ae0721724ad853fd3e208edb2ecc34a6ad49..fe034c519adf35b4a30d51bda2d57334d215b267 100644 (file)
@@ -2086,6 +2086,7 @@ set(regress_1_tests
   regress1/strings/issue6270.smt2
   regress1/strings/issue6271-rnf.smt2
   regress1/strings/issue6271-2-rnf.smt2
+  regress1/strings/issue6567-empty-re-range.smt2
   regress1/strings/kaluza-fl.smt2
   regress1/strings/loop002.smt2
   regress1/strings/loop003.smt2
diff --git a/test/regress/regress1/strings/issue6567-empty-re-range.smt2 b/test/regress/regress1/strings/issue6567-empty-re-range.smt2
new file mode 100644 (file)
index 0000000..abf2fd2
--- /dev/null
@@ -0,0 +1,4 @@
+(set-logic ALL)
+(set-info :status sat)
+(assert (str.in_re "" (re.* (re.range "b" "a"))))
+(check-sat)