summaryrefslogtreecommitdiff
path: root/src/theory
diff options
context:
space:
mode:
authorKshitij Bansal <kshitij@cs.nyu.edu>2014-09-02 18:28:52 -0400
committerKshitij Bansal <kshitij@cs.nyu.edu>2014-09-03 15:19:10 -0400
commit8dc1280a5161633fddfb8334811a86c911bb25c1 (patch)
treef4b100a3f70acc10e6ca05a1d4c28c659df0eafe /src/theory
parente9fb730333b2719cddaa0a9209aa7953d7f30b0b (diff)
check() optimization
Details of testing here: http://church.cims.nyu.edu/wiki/User:Kshitij/theorycheckoptimization
Diffstat (limited to 'src/theory')
-rw-r--r--src/theory/bv/theory_bv.cpp3
-rw-r--r--src/theory/datatypes/theory_datatypes.cpp4
-rw-r--r--src/theory/idl/theory_idl.cpp4
-rw-r--r--src/theory/quantifiers/theory_quantifiers.cpp4
-rw-r--r--src/theory/sets/theory_sets.cpp3
-rw-r--r--src/theory/strings/theory_strings.cpp6
-rw-r--r--src/theory/theory.h2
-rw-r--r--src/theory/uf/theory_uf.cpp4
8 files changed, 28 insertions, 2 deletions
diff --git a/src/theory/bv/theory_bv.cpp b/src/theory/bv/theory_bv.cpp
index 40bc2417b..91150f663 100644
--- a/src/theory/bv/theory_bv.cpp
+++ b/src/theory/bv/theory_bv.cpp
@@ -357,6 +357,9 @@ void TheoryBV::checkForLemma(TNode fact) {
void TheoryBV::check(Effort e)
{
+ if (done() && !fullEffort(e)) {
+ return;
+ }
Debug("bitvector") << "TheoryBV::check(" << e << ")" << std::endl;
// we may be getting new assertions so the model cache may not be sound
d_invalidateModelCache.set(true);
diff --git a/src/theory/datatypes/theory_datatypes.cpp b/src/theory/datatypes/theory_datatypes.cpp
index f74384d59..87d1f6517 100644
--- a/src/theory/datatypes/theory_datatypes.cpp
+++ b/src/theory/datatypes/theory_datatypes.cpp
@@ -118,6 +118,10 @@ TNode TheoryDatatypes::getEqcConstructor( TNode r ) {
}
void TheoryDatatypes::check(Effort e) {
+ if (done() && !fullEffort(e)) {
+ return;
+ }
+
Trace("datatypes-debug") << "Check effort " << e << std::endl;
while(!done() && !d_conflict) {
// Get all the assertions
diff --git a/src/theory/idl/theory_idl.cpp b/src/theory/idl/theory_idl.cpp
index 8597c117d..9e402f430 100644
--- a/src/theory/idl/theory_idl.cpp
+++ b/src/theory/idl/theory_idl.cpp
@@ -49,6 +49,10 @@ Node TheoryIdl::ppRewrite(TNode atom) {
}
void TheoryIdl::check(Effort level) {
+ //// Not needed for now, as no code outside while() loop below.
+ // if (done() && !fullEffort(e)) {
+ // return;
+ // }
while(!done()) {
diff --git a/src/theory/quantifiers/theory_quantifiers.cpp b/src/theory/quantifiers/theory_quantifiers.cpp
index 4e8a0a411..18546b09c 100644
--- a/src/theory/quantifiers/theory_quantifiers.cpp
+++ b/src/theory/quantifiers/theory_quantifiers.cpp
@@ -109,6 +109,10 @@ void TheoryQuantifiers::collectModelInfo(TheoryModel* m, bool fullModel) {
}
void TheoryQuantifiers::check(Effort e) {
+ if (done() && !fullEffort(e)) {
+ return;
+ }
+
CodeTimer codeTimer(d_theoryTime);
Trace("quantifiers-check") << "quantifiers::check(" << e << ")" << std::endl;
diff --git a/src/theory/sets/theory_sets.cpp b/src/theory/sets/theory_sets.cpp
index faba2aab1..106ad6e56 100644
--- a/src/theory/sets/theory_sets.cpp
+++ b/src/theory/sets/theory_sets.cpp
@@ -39,6 +39,9 @@ void TheorySets::addSharedTerm(TNode n) {
}
void TheorySets::check(Effort e) {
+ if (done() && !fullEffort(e)) {
+ return;
+ }
d_internal->check(e);
}
diff --git a/src/theory/strings/theory_strings.cpp b/src/theory/strings/theory_strings.cpp
index 30e529663..ac1b1b1ed 100644
--- a/src/theory/strings/theory_strings.cpp
+++ b/src/theory/strings/theory_strings.cpp
@@ -550,6 +550,10 @@ Node TheoryStrings::expandDefinition(LogicRequest &logicRequest, Node node) {
void TheoryStrings::check(Effort e) {
+ if (done() && !fullEffort(e)) {
+ return;
+ }
+
bool polarity;
TNode atom;
@@ -3330,4 +3334,4 @@ TheoryStrings::Statistics::~Statistics(){
}/* CVC4::theory::strings namespace */
}/* CVC4::theory namespace */
-}/* CVC4 namespace */ \ No newline at end of file
+}/* CVC4 namespace */
diff --git a/src/theory/theory.h b/src/theory/theory.h
index ac3d018fb..867dd7c31 100644
--- a/src/theory/theory.h
+++ b/src/theory/theory.h
@@ -377,7 +377,7 @@ public:
/**
* Returns true if the assertFact queue is empty
*/
- bool done() throw() {
+ bool done() const throw() {
return d_factsHead == d_facts.size();
}
diff --git a/src/theory/uf/theory_uf.cpp b/src/theory/uf/theory_uf.cpp
index 0da8e8c32..4fcf4166b 100644
--- a/src/theory/uf/theory_uf.cpp
+++ b/src/theory/uf/theory_uf.cpp
@@ -89,6 +89,10 @@ static Node mkAnd(const std::vector<TNode>& conjunctions) {
}/* mkAnd() */
void TheoryUF::check(Effort level) {
+ if (done() && !fullEffort(level)) {
+ return;
+ }
+
while (!done() && !d_conflict)
{
// Get all the assertions
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback