`STRINGS_CTN_DECOMPOSE`: Avoid multiple conflicts (#6632)
authorAndres Noetzli <andres.noetzli@gmail.com>
Fri, 28 May 2021 03:28:20 +0000 (20:28 -0700)
committerGitHub <noreply@github.com>
Fri, 28 May 2021 03:28:20 +0000 (20:28 -0700)
Fixes #5508. `STRINGS_CTN_DECOMPOSE` could be triggered multiple times
by the same term, which resulted in an assertion failure. This commit
returns immediately after the first conflict to avoid the assertion
failure.

src/theory/strings/extf_solver.cpp
test/regress/CMakeLists.txt
test/regress/regress0/strings/issue5508-multiple-conflicts.smt2 [new file with mode: 0644]

index 9576c1d81b106a66b6c65bd735b348d4dced1bda..8b5e35023dc684fbb9dcefbd34cdfee8eeef35a3 100644 (file)
@@ -548,6 +548,8 @@ void ExtfSolver::checkExtfInference(Node n,
             {
               // we are in conflict
               d_im.sendInference(in.d_exp, conc, InferenceId::STRINGS_CTN_DECOMPOSE);
+              Assert(d_state.isInConflict());
+              return;
             }
             else if (d_extt.hasFunctionKind(conc.getKind()))
             {
index e10b89c79786ba62467b440c7e446d6667a7c04e..7de2d978906de49736da3a58d9098d506be62f11 100644 (file)
@@ -1132,6 +1132,7 @@ set(regress_0_tests
   regress0/strings/issue5090.smt2
   regress0/strings/issue5384-double-conflict.smt2
   regress0/strings/issue5428-re-diff-assoc.smt2
+  regress0/strings/issue5508-multiple-conflicts.smt2
   regress0/strings/issue5542-strings-seq-mix.smt2
   regress0/strings/issue5608-eager-pp.smt2
   regress0/strings/issue5666-orig-unit-deq.smt2
diff --git a/test/regress/regress0/strings/issue5508-multiple-conflicts.smt2 b/test/regress/regress0/strings/issue5508-multiple-conflicts.smt2
new file mode 100644 (file)
index 0000000..1d7d208
--- /dev/null
@@ -0,0 +1,8 @@
+(set-logic QF_SLIA)
+(declare-fun i2 () Int)
+(declare-fun str10 () String)
+(declare-fun str19 () String)
+(declare-fun i19 () Int)
+(assert (str.contains (str.from_int i2) (str.++ str19 "uKykCsFtVM" (str.from_int i19) "hORknmKIFtylbjBJVLsMNyAUKzpayeBQPHqN" str10)))
+(set-info :status unsat)
+(check-sat)