summaryrefslogtreecommitdiff
path: root/src/theory/arith
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2020-07-28 11:03:33 -0500
committerGitHub <noreply@github.com>2020-07-28 11:03:33 -0500
commitc38f35164adc5ab255803765a568ef820fa8f3b2 (patch)
tree6cbd4b21e8e9ff364b5b2f14467cd986ea69acf2 /src/theory/arith
parentb90cfb462bde3e75c07bb14e2393ee8e4b4f4d42 (diff)
Use lemma property enum for OutputChannel::lemma (#4755)
There are 3 Boolean flags for OutputChannel::lemma, and plans to add another for relevance. This makes them into a enum.
Diffstat (limited to 'src/theory/arith')
-rw-r--r--src/theory/arith/nl/nl_lemma_utils.cpp5
-rw-r--r--src/theory/arith/nl/nl_lemma_utils.h3
-rw-r--r--src/theory/arith/nl/nonlinear_extension.cpp12
-rw-r--r--src/theory/arith/nl/nonlinear_extension.h3
4 files changed, 15 insertions, 8 deletions
diff --git a/src/theory/arith/nl/nl_lemma_utils.cpp b/src/theory/arith/nl/nl_lemma_utils.cpp
index 0497b5822..49eec186e 100644
--- a/src/theory/arith/nl/nl_lemma_utils.cpp
+++ b/src/theory/arith/nl/nl_lemma_utils.cpp
@@ -21,6 +21,11 @@ namespace theory {
namespace arith {
namespace nl {
+LemmaProperty NlLemma::getLemmaProperty() const
+{
+ return d_preprocess ? LemmaProperty::PREPROCESS : LemmaProperty::NONE;
+}
+
std::ostream& operator<<(std::ostream& out, NlLemma& n)
{
out << n.d_lemma;
diff --git a/src/theory/arith/nl/nl_lemma_utils.h b/src/theory/arith/nl/nl_lemma_utils.h
index 2b5158f18..f40857fda 100644
--- a/src/theory/arith/nl/nl_lemma_utils.h
+++ b/src/theory/arith/nl/nl_lemma_utils.h
@@ -19,6 +19,7 @@
#include <vector>
#include "expr/node.h"
#include "theory/arith/nl/inference.h"
+#include "theory/output_channel.h"
namespace CVC4 {
namespace theory {
@@ -61,6 +62,8 @@ struct NlLemma
* Cimatti et al., CADE 2017.
*/
std::vector<std::tuple<Node, unsigned, Node> > d_secantPoint;
+ /** get lemma property (preprocess or none) */
+ LemmaProperty getLemmaProperty() const;
};
/**
* Writes a non-linear lemma to a stream.
diff --git a/src/theory/arith/nl/nonlinear_extension.cpp b/src/theory/arith/nl/nonlinear_extension.cpp
index 432c25f27..4cb1c9fe6 100644
--- a/src/theory/arith/nl/nonlinear_extension.cpp
+++ b/src/theory/arith/nl/nonlinear_extension.cpp
@@ -18,6 +18,7 @@
#include "theory/arith/nl/nonlinear_extension.h"
#include "options/arith_options.h"
+#include "options/theory_options.h"
#include "theory/arith/arith_utilities.h"
#include "theory/arith/theory_arith.h"
#include "theory/ext_theory.h"
@@ -164,14 +165,14 @@ void NonlinearExtension::sendLemmas(const std::vector<NlLemma>& out)
for (const NlLemma& nlem : out)
{
Node lem = nlem.d_lemma;
- bool preprocess = nlem.d_preprocess;
+ LemmaProperty p = nlem.getLemmaProperty();
Trace("nl-ext-lemma") << "NonlinearExtension::Lemma : " << nlem.d_id
<< " : " << lem << std::endl;
- d_containing.getOutputChannel().lemma(lem, false, preprocess);
+ d_containing.getOutputChannel().lemma(lem, p);
// process the side effect
processSideEffect(nlem);
- // add to cache if not preprocess
- if (preprocess)
+ // add to cache based on preprocess
+ if (isLemmaPropertyPreprocess(p))
{
d_lemmasPp.insert(lem);
}
@@ -408,7 +409,8 @@ bool NonlinearExtension::checkModel(const std::vector<Node>& assertions,
Trace("nl-ext-cm") << "-----" << std::endl;
unsigned tdegree = d_trSlv.getTaylorDegree();
- bool ret = d_model.checkModel(passertions, tdegree, lemmas, gs);
+ bool ret =
+ d_model.checkModel(passertions, tdegree, lemmas, gs);
return ret;
}
diff --git a/src/theory/arith/nl/nonlinear_extension.h b/src/theory/arith/nl/nonlinear_extension.h
index 36875d8a3..6cc5c29d4 100644
--- a/src/theory/arith/nl/nonlinear_extension.h
+++ b/src/theory/arith/nl/nonlinear_extension.h
@@ -257,9 +257,6 @@ class NonlinearExtension
std::vector<Node>& gs);
//---------------------------end check model
- /** Is n entailed with polarity pol in the current context? */
- bool isEntailed(Node n, bool pol);
-
/**
* Potentially adds lemmas to the set out and clears lemmas. Returns
* the number of lemmas added to out. We do not add lemmas that have already
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback