From: Andres Noetzli Date: Fri, 28 May 2021 03:28:20 +0000 (-0700) Subject: `STRINGS_CTN_DECOMPOSE`: Avoid multiple conflicts (#6632) X-Git-Tag: cvc5-1.0.0~1680 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=972dcfafe5eeb10b7b45892d1291000e73746c76;p=cvc5.git `STRINGS_CTN_DECOMPOSE`: Avoid multiple conflicts (#6632) 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. --- diff --git a/src/theory/strings/extf_solver.cpp b/src/theory/strings/extf_solver.cpp index 9576c1d81..8b5e35023 100644 --- a/src/theory/strings/extf_solver.cpp +++ b/src/theory/strings/extf_solver.cpp @@ -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())) { diff --git a/test/regress/CMakeLists.txt b/test/regress/CMakeLists.txt index e10b89c79..7de2d9789 100644 --- a/test/regress/CMakeLists.txt +++ b/test/regress/CMakeLists.txt @@ -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 index 000000000..1d7d208c9 --- /dev/null +++ b/test/regress/regress0/strings/issue5508-multiple-conflicts.smt2 @@ -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)