Ensure quantifiers options are set with --no-strings-lazy-pp (#3515)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Mon, 2 Dec 2019 05:34:18 +0000 (23:34 -0600)
committerGitHub <noreply@github.com>
Mon, 2 Dec 2019 05:34:18 +0000 (23:34 -0600)
src/smt/smt_engine.cpp
test/regress/CMakeLists.txt
test/regress/regress0/strings/issue3440.smt2 [new file with mode: 0644]

index ca5558e8721d342d6064dd55d742008ed03898b0..eb10f580afe20056df9356eaaf4ecd1656fa3a48 100644 (file)
@@ -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();
index e4b5b8057fa1ecb224c0068e4705e28249182387..da9679e2d249a8d2f5fdcce205dea8aa8308d889 100644 (file)
@@ -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 (file)
index 0000000..7eb3419
--- /dev/null
@@ -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)