Exclude redundant lemmas when tracking inst lemmas. (#3210)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Fri, 23 Aug 2019 19:00:53 +0000 (14:00 -0500)
committerGitHub <noreply@github.com>
Fri, 23 Aug 2019 19:00:53 +0000 (14:00 -0500)
src/theory/quantifiers/inst_match_trie.cpp
test/regress/CMakeLists.txt
test/regress/regress1/sygus/issue3205.smt2 [new file with mode: 0644]

index 8b8689835a8d9d2b1efcd7f2d58949bae2fdbeb6..19ef8894912d66b22b2ba02d94b425eb8b8635ff 100644 (file)
@@ -210,8 +210,12 @@ void InstMatchTrie::getInstantiations(std::vector<Node>& insts,
       {
         insts.push_back(getInstLemma());
       }
-      else
+      else if (!options::trackInstLemmas())
       {
+        // If we are tracking instantiation lemmas, then hasInstLemma()
+        // corresponds exactly to when the lemma was successfully added.
+        // Hence the above condition guards the case where the instantiation
+        // was recorded but not sent out as a lemma.
         insts.push_back(qe->getInstantiate()->getInstantiation(q, terms, true));
       }
     }
@@ -469,8 +473,11 @@ void CDInstMatchTrie::getInstantiations(std::vector<Node>& insts,
         {
           insts.push_back(getInstLemma());
         }
-        else
+        else if (!options::trackInstLemmas())
         {
+          // Like in the context-independent case, hasInstLemma()
+          // corresponds exactly to when the lemma was successfully added when
+          // trackInstLemmas() is true.
           insts.push_back(
               qe->getInstantiate()->getInstantiation(q, terms, true));
         }
index 74b6021192d17e7d43bb049dc99b7c59d40df5b8..e3287983c62ae785437392bfa4f4fd45aa3ec99e 100644 (file)
@@ -1681,6 +1681,7 @@ set(regress_1_tests
   regress1/sygus/issue3199.smt2
   regress1/sygus/issue3200.smt2
   regress1/sygus/issue3201.smt2
+  regress1/sygus/issue3205.smt2
   regress1/sygus/large-const-simp.sy
   regress1/sygus/let-bug-simp.sy
   regress1/sygus/list-head-x.sy
diff --git a/test/regress/regress1/sygus/issue3205.smt2 b/test/regress/regress1/sygus/issue3205.smt2
new file mode 100644 (file)
index 0000000..b560491
--- /dev/null
@@ -0,0 +1,7 @@
+; EXPECT: sat
+; COMMAND-LINE: --sygus-inference
+(set-logic ALL)
+(declare-fun a () Real) 
+(assert (= (* a a) 1))
+(check-sat)
+(exit)