summaryrefslogtreecommitdiff
path: root/src/theory/arith/nl/nonlinear_extension.cpp
diff options
context:
space:
mode:
authorGereon Kremer <gkremer@stanford.edu>2021-02-19 09:34:36 +0100
committerGitHub <noreply@github.com>2021-02-19 09:34:36 +0100
commitce58453982ddd53a5fc08d9db4c6c3f49b852838 (patch)
treee77cb66ff4d5bca985524d3c2befd33d580916af /src/theory/arith/nl/nonlinear_extension.cpp
parent6ae21de6f85d9629018c1b6bf912ef39f3e169fb (diff)
Cleanup of inferences in arithmetic theory (#5927)
This PR cleans up several issues in the arithmetic theory mostly related to its usage of InferenceId and the TheoryInferenceManager: remove the ArithLemma class and uses SimpleTheoryLemma instead only use NlLemma if we actually need it use proper InferenceIds everywhere remove unused code in the nonlinear extension
Diffstat (limited to 'src/theory/arith/nl/nonlinear_extension.cpp')
-rw-r--r--src/theory/arith/nl/nonlinear_extension.cpp65
1 files changed, 5 insertions, 60 deletions
diff --git a/src/theory/arith/nl/nonlinear_extension.cpp b/src/theory/arith/nl/nonlinear_extension.cpp
index 36ddecee9..4d29f1955 100644
--- a/src/theory/arith/nl/nonlinear_extension.cpp
+++ b/src/theory/arith/nl/nonlinear_extension.cpp
@@ -106,63 +106,6 @@ void NonlinearExtension::computeRelevantAssertions(
<< " assertions" << std::endl;
}
-unsigned NonlinearExtension::filterLemma(NlLemma lem, std::vector<NlLemma>& out)
-{
- Trace("nl-ext-lemma-debug")
- << "NonlinearExtension::Lemma pre-rewrite : " << lem.d_node << std::endl;
- lem.d_node = Rewriter::rewrite(lem.d_node);
-
- if (d_im.hasCachedLemma(lem.d_node, lem.d_property))
- {
- Trace("nl-ext-lemma-debug")
- << "NonlinearExtension::Lemma duplicate : " << lem.d_node << std::endl;
- return 0;
- }
- out.emplace_back(lem);
- return 1;
-}
-
-unsigned NonlinearExtension::filterLemmas(std::vector<NlLemma>& lemmas,
- std::vector<NlLemma>& out)
-{
- if (options::nlExtEntailConflicts())
- {
- // check if any are entailed to be false
- for (const NlLemma& lem : lemmas)
- {
- Node ch_lemma = lem.d_node.negate();
- ch_lemma = Rewriter::rewrite(ch_lemma);
- Trace("nl-ext-et-debug")
- << "Check entailment of " << ch_lemma << "..." << std::endl;
- std::pair<bool, Node> et = d_containing.getValuation().entailmentCheck(
- options::TheoryOfMode::THEORY_OF_TYPE_BASED, ch_lemma);
- Trace("nl-ext-et-debug") << "entailment test result : " << et.first << " "
- << et.second << std::endl;
- if (et.first)
- {
- Trace("nl-ext-et") << "*** Lemma entailed to be in conflict : "
- << lem.d_node << std::endl;
- // return just this lemma
- if (filterLemma(lem, out) > 0)
- {
- lemmas.clear();
- return 1;
- }
- }
- }
- }
-
- unsigned sum = 0;
- for (const NlLemma& lem : lemmas)
- {
- sum += filterLemma(lem, out);
- d_containing.getOutputChannel().spendResource(
- ResourceManager::Resource::ArithNlLemmaStep);
- }
- lemmas.clear();
- return sum;
-}
-
void NonlinearExtension::getAssertions(std::vector<Node>& assertions)
{
Trace("nl-ext-assert-debug") << "Getting assertions..." << std::endl;
@@ -293,7 +236,7 @@ bool NonlinearExtension::checkModel(const std::vector<Node>& assertions)
bool ret = d_model.checkModel(passertions, tdegree, lemmas);
for (const auto& al: lemmas)
{
- d_im.addPendingArithLemma(al);
+ d_im.addPendingLemma(al);
}
return ret;
}
@@ -500,8 +443,10 @@ bool NonlinearExtension::modelBasedRefinement()
d_containing.getOutputChannel().requirePhase(literal, true);
Trace("nl-ext-debug") << "Split on : " << literal << std::endl;
Node split = literal.orNode(literal.negate());
- NlLemma nsplit(split, InferenceId::ARITH_NL_SHARED_TERM_VALUE_SPLIT);
- d_im.addPendingArithLemma(nsplit, true);
+ d_im.addPendingLemma(split,
+ InferenceId::ARITH_NL_SHARED_TERM_VALUE_SPLIT,
+ nullptr,
+ true);
}
if (d_im.hasWaitingLemma())
{
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback