Fix normal form for re.comp (#4676)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Tue, 30 Jun 2020 23:08:54 +0000 (18:08 -0500)
committerGitHub <noreply@github.com>
Tue, 30 Jun 2020 23:08:54 +0000 (18:08 -0500)
Fixes #4674.

src/theory/strings/regexp_solver.cpp
test/regress/CMakeLists.txt
test/regress/regress0/strings/issue4674-recomp-nf.smt2 [new file with mode: 0644]

index 627258a4c2f0766c987f33ea161c44ab9e6a8431..53c6c9accbe80e20276cc484c023343b642234ef 100644 (file)
@@ -672,6 +672,7 @@ Node RegExpSolver::getNormalSymRegExp(Node r, std::vector<Node>& nf_exp)
     case REGEXP_UNION:
     case REGEXP_INTER:
     case REGEXP_STAR:
+    case REGEXP_COMPLEMENT:
     {
       std::vector<Node> vec_nodes;
       for (const Node& cr : r)
index 9a58457e690c9e5e11024f3ca779aab55072675f..10e2f414e2d949bba7ff38daa3bb046d823c0174 100644 (file)
@@ -967,6 +967,7 @@ set(regress_0_tests
   regress0/strings/issue4070.smt2
   regress0/strings/issue4376.smt2
   regress0/strings/issue4662-consume-nterm.smt2
+  regress0/strings/issue4674-recomp-nf.smt2
   regress0/strings/itos-entail.smt2
   regress0/strings/large-model.smt2
   regress0/strings/leadingzero001.smt2
diff --git a/test/regress/regress0/strings/issue4674-recomp-nf.smt2 b/test/regress/regress0/strings/issue4674-recomp-nf.smt2
new file mode 100644 (file)
index 0000000..2096d51
--- /dev/null
@@ -0,0 +1,5 @@
+(set-logic QF_S)
+(set-info :status sat)
+(declare-fun a () String)
+(assert (str.in_re "" (re.++ (str.to_re a) (re.comp re.allchar))))
+(check-sat)