summaryrefslogtreecommitdiff
path: root/src/theory
diff options
context:
space:
mode:
authorTim King <taking@cs.nyu.edu>2011-04-04 20:42:23 +0000
committerTim King <taking@cs.nyu.edu>2011-04-04 20:42:23 +0000
commit41dddac33ba0332a2ab52983b94044cbdc9e762e (patch)
tree21c938e9fc5c8967e34e087293d441821ab19fd6 /src/theory
parent2935af06e3fae46418c10450df9e02465f0a8038 (diff)
Merging the satliteral-before-prereg branch into trunk. Theory preregistration is now called during the conversion to cnf. This fixes bug 257.
Diffstat (limited to 'src/theory')
-rw-r--r--src/theory/Makefile.am1
-rw-r--r--src/theory/registrar.h31
-rw-r--r--src/theory/theory_engine.cpp8
-rw-r--r--src/theory/theory_engine.h1
4 files changed, 37 insertions, 4 deletions
diff --git a/src/theory/Makefile.am b/src/theory/Makefile.am
index a9ff5376d..b72502eca 100644
--- a/src/theory/Makefile.am
+++ b/src/theory/Makefile.am
@@ -19,6 +19,7 @@ libtheory_la_SOURCES = \
shared_term_manager.cpp \
shared_data.h \
shared_data.cpp \
+ registrar.h \
rewriter.h \
rewriter_attributes.h \
rewriter.cpp \
diff --git a/src/theory/registrar.h b/src/theory/registrar.h
new file mode 100644
index 000000000..ce3a301d7
--- /dev/null
+++ b/src/theory/registrar.h
@@ -0,0 +1,31 @@
+#include "cvc4_private.h"
+
+#ifndef __CVC4__THEORY_REGISTRAR_H
+#define __CVC4__THEORY_REGISTRAR_H
+#include "theory/theory_engine.h"
+
+namespace CVC4 {
+namespace theory {
+
+class Registrar {
+private:
+ TheoryEngine* d_theoryEngine;
+
+public:
+ Registrar() : d_theoryEngine(NULL){ }
+
+ Registrar(TheoryEngine* te) : d_theoryEngine(te){ }
+
+ void preRegister(Node n){
+ if(d_theoryEngine != NULL){
+ d_theoryEngine->preRegister(n);
+ }
+ }
+
+};/* class Registrar */
+
+
+}/* CVC4::theory namespace */
+}/* CVC4 namespace */
+
+#endif /* __CVC4__THEORY_REGISTRAR_H */
diff --git a/src/theory/theory_engine.cpp b/src/theory/theory_engine.cpp
index d1040e6fc..aa70a9bda 100644
--- a/src/theory/theory_engine.cpp
+++ b/src/theory/theory_engine.cpp
@@ -162,13 +162,15 @@ struct preprocess_stack_element {
};
Node TheoryEngine::preprocess(TNode node) {
-
// Remove ITEs and rewrite the node
Node preprocessed = Rewriter::rewrite(removeITEs(node));
+ return preprocessed;
+}
+void TheoryEngine::preRegister(TNode preprocessed) {
// If we are pre-registered already we are done
if (preprocessed.getAttribute(PreRegistered())) {
- return preprocessed;
+ return;
}
// Do a topological sort of the subexpressions and preregister them
@@ -223,8 +225,6 @@ Node TheoryEngine::preprocess(TNode node) {
}
}
}
-
- return preprocessed;
}
/**
diff --git a/src/theory/theory_engine.h b/src/theory/theory_engine.h
index be2e6e271..2e12d3a16 100644
--- a/src/theory/theory_engine.h
+++ b/src/theory/theory_engine.h
@@ -247,6 +247,7 @@ public:
* @param n the node to preprocess
*/
Node preprocess(TNode n);
+ void preRegister(TNode preprocessed);
/**
* Assert the formula to the appropriate theory.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback