summaryrefslogtreecommitdiff
path: root/src/theory/theory_engine.cpp
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2018-09-14 22:15:37 -0700
committerGitHub <noreply@github.com>2018-09-14 22:15:37 -0700
commit2060f439c873c8b1928cbd5f54967571176f2aba (patch)
tree45fab904b632b6174ee66807081465693a5da83f /src/theory/theory_engine.cpp
parentc2111c86973b8a80e20a3fdf3cbd0b2ff0dc7010 (diff)
Refactor how assertions are added to decision engine (#2396)
Before refactoring the preprocessing passes, we were using three arguments to add assertions to the decision engine. Now all that information lives in the AssertionPipeline. This commit moves the AssertionPipeline to its own file and changes the `addAssertions()` methods related to the decision engine to take an AssertionPipeline as an arguement instead of three separate ones. Additionally, the TheoryEngine now uses an AssertionPipeline for lemmas.
Diffstat (limited to 'src/theory/theory_engine.cpp')
-rw-r--r--src/theory/theory_engine.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/theory/theory_engine.cpp b/src/theory/theory_engine.cpp
index 37276ac5e..b9c3ccc4e 100644
--- a/src/theory/theory_engine.cpp
+++ b/src/theory/theory_engine.cpp
@@ -29,6 +29,7 @@
#include "options/options.h"
#include "options/proof_options.h"
#include "options/quantifiers_options.h"
+#include "preprocessing/assertion_pipeline.h"
#include "proof/cnf_proof.h"
#include "proof/lemma_proof.h"
#include "proof/proof_manager.h"
@@ -53,6 +54,7 @@
using namespace std;
+using namespace CVC4::preprocessing;
using namespace CVC4::theory;
namespace CVC4 {
@@ -1818,8 +1820,7 @@ theory::LemmaStatus TheoryEngine::lemma(TNode node,
d_channels->getLemmaOutputChannel()->notifyNewLemma(node.toExpr());
}
- std::vector<Node> additionalLemmas;
- IteSkolemMap iteSkolemMap;
+ AssertionPipeline additionalLemmas;
// Run theory preprocessing, maybe
Node ppNode = preprocess ? this->preprocess(node) : Node(node);
@@ -1827,9 +1828,11 @@ theory::LemmaStatus TheoryEngine::lemma(TNode node,
// Remove the ITEs
Debug("ite") << "Remove ITE from " << ppNode << std::endl;
additionalLemmas.push_back(ppNode);
- d_tform_remover.run(additionalLemmas, iteSkolemMap);
+ additionalLemmas.updateRealAssertionsEnd();
+ d_tform_remover.run(additionalLemmas.ref(),
+ additionalLemmas.getIteSkolemMap());
Debug("ite") << "..done " << additionalLemmas[0] << std::endl;
- additionalLemmas[0] = theory::Rewriter::rewrite(additionalLemmas[0]);
+ additionalLemmas.replace(0, theory::Rewriter::rewrite(additionalLemmas[0]));
if(Debug.isOn("lemma-ites")) {
Debug("lemma-ites") << "removed ITEs from lemma: " << ppNode << endl;
@@ -1846,19 +1849,19 @@ theory::LemmaStatus TheoryEngine::lemma(TNode node,
// assert to prop engine
d_propEngine->assertLemma(additionalLemmas[0], negated, removable, rule, node);
for (unsigned i = 1; i < additionalLemmas.size(); ++ i) {
- additionalLemmas[i] = theory::Rewriter::rewrite(additionalLemmas[i]);
+ additionalLemmas.replace(i, theory::Rewriter::rewrite(additionalLemmas[i]));
d_propEngine->assertLemma(additionalLemmas[i], false, removable, rule, node);
}
// WARNING: Below this point don't assume additionalLemmas[0] to be not negated.
if(negated) {
- additionalLemmas[0] = additionalLemmas[0].notNode();
+ additionalLemmas.replace(0, additionalLemmas[0].notNode());
negated = false;
}
// assert to decision engine
if(!removable) {
- d_decisionEngine->addAssertions(additionalLemmas, 1, iteSkolemMap);
+ d_decisionEngine->addAssertions(additionalLemmas);
}
// Mark that we added some lemmas
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback