From a39f1719ede136579cbd15c34b6a763a2b08a464 Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Sun, 1 Dec 2019 23:34:18 -0600 Subject: [PATCH] Ensure quantifiers options are set with --no-strings-lazy-pp (#3515) --- src/smt/smt_engine.cpp | 8 +++++--- test/regress/CMakeLists.txt | 1 + test/regress/regress0/strings/issue3440.smt2 | 11 +++++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 test/regress/regress0/strings/issue3440.smt2 diff --git a/src/smt/smt_engine.cpp b/src/smt/smt_engine.cpp index ca5558e87..eb10f580a 100644 --- a/src/smt/smt_engine.cpp +++ b/src/smt/smt_engine.cpp @@ -1251,10 +1251,12 @@ void SmtEngine::setDefaults() { } } - // set default options associated with strings-exp - if (options::stringExp()) + // Set default options associated with strings-exp. We also set these options + // if we are using eager string preprocessing, which may introduce quantified + // formulas at preprocess time. + if (options::stringExp() || !options::stringLazyPreproc()) { - // We require quantifiers since extended functions reduce using them + // We require quantifiers since extended functions reduce using them. if (!d_logic.isQuantified()) { d_logic = d_logic.getUnlockedCopy(); diff --git a/test/regress/CMakeLists.txt b/test/regress/CMakeLists.txt index e4b5b8057..da9679e2d 100644 --- a/test/regress/CMakeLists.txt +++ b/test/regress/CMakeLists.txt @@ -871,6 +871,7 @@ set(regress_0_tests regress0/strings/indexof-sym-simp.smt2 regress0/strings/issue1189.smt2 regress0/strings/issue2958.smt2 + regress0/strings/issue3440.smt2 regress0/strings/issue3497.smt2 regress0/strings/itos-entail.smt2 regress0/strings/leadingzero001.smt2 diff --git a/test/regress/regress0/strings/issue3440.smt2 b/test/regress/regress0/strings/issue3440.smt2 new file mode 100644 index 000000000..7eb3419f2 --- /dev/null +++ b/test/regress/regress0/strings/issue3440.smt2 @@ -0,0 +1,11 @@ +; COMMAND-LINE: --no-strings-lazy-pp +; EXPECT: sat +(set-info :smt-lib-version 2.5) +(set-logic QF_S) +(set-info :status sat) +(declare-fun a () String) +(declare-fun b () String) +(declare-fun c () String) +(declare-fun d () String) +(assert (= (str.replace a b "") (str.++ c d))) +(check-sat) -- 2.30.2