From: Andrew Reynolds Date: Fri, 23 Aug 2019 19:00:53 +0000 (-0500) Subject: Exclude redundant lemmas when tracking inst lemmas. (#3210) X-Git-Tag: cvc5-1.0.0~3997 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9ddb42136e0a63495d232226cd8dfd0134e54fa6;p=cvc5.git Exclude redundant lemmas when tracking inst lemmas. (#3210) --- diff --git a/src/theory/quantifiers/inst_match_trie.cpp b/src/theory/quantifiers/inst_match_trie.cpp index 8b8689835..19ef88949 100644 --- a/src/theory/quantifiers/inst_match_trie.cpp +++ b/src/theory/quantifiers/inst_match_trie.cpp @@ -210,8 +210,12 @@ void InstMatchTrie::getInstantiations(std::vector& 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& 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)); } diff --git a/test/regress/CMakeLists.txt b/test/regress/CMakeLists.txt index 74b602119..e3287983c 100644 --- a/test/regress/CMakeLists.txt +++ b/test/regress/CMakeLists.txt @@ -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 index 000000000..b560491cd --- /dev/null +++ b/test/regress/regress1/sygus/issue3205.smt2 @@ -0,0 +1,7 @@ +; EXPECT: sat +; COMMAND-LINE: --sygus-inference +(set-logic ALL) +(declare-fun a () Real) +(assert (= (* a a) 1)) +(check-sat) +(exit)