summaryrefslogtreecommitdiff
path: root/src/theory/theory_engine.cpp
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@cs.nyu.edu>2013-05-10 13:01:02 -0400
committerMorgan Deters <mdeters@cs.nyu.edu>2013-05-20 16:50:31 -0400
commit01654ea86af49fdf0859811f09c64de66dcc9f59 (patch)
tree1763b4015d635591a6b95d2081d93b6fa774827f /src/theory/theory_engine.cpp
parentac2ccdf44ac9011bceb50faac23e309c3a370e20 (diff)
Fix erroneous results when the logic was incorrectly specified (by throwing LogicException). Also correct a case where sharing was doing some work during pure theory solving.
Diffstat (limited to 'src/theory/theory_engine.cpp')
-rw-r--r--src/theory/theory_engine.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/theory/theory_engine.cpp b/src/theory/theory_engine.cpp
index a81b38fe9..5ee8e5fda 100644
--- a/src/theory/theory_engine.cpp
+++ b/src/theory/theory_engine.cpp
@@ -187,7 +187,25 @@ void TheoryEngine::preRegister(TNode preprocessed) {
}
// Pre-register the terms in the atom
- bool multipleTheories = NodeVisitor<PreRegisterVisitor>::run(d_preRegistrationVisitor, preprocessed);
+ Theory::Set theories = NodeVisitor<PreRegisterVisitor>::run(d_preRegistrationVisitor, preprocessed);
+ theories = Theory::setRemove(THEORY_BOOL, theories);
+ // Remove the top theory, if any more that means multiple theories were involved
+ bool multipleTheories = Theory::setRemove(Theory::theoryOf(preprocessed), theories);
+ TheoryId i;
+ while((i = Theory::setPop(theories)) != THEORY_LAST) {
+ if(!d_logicInfo.isTheoryEnabled(i)) {
+ LogicInfo newLogicInfo = d_logicInfo.getUnlockedCopy();
+ newLogicInfo.enableTheory(i);
+ newLogicInfo.lock();
+ stringstream ss;
+ ss << "The logic was specified as " << d_logicInfo.getLogicString()
+ << ", which doesn't include " << i
+ << ", but found a term in that theory." << endl
+ << "You might want to extend your logic to " << newLogicInfo
+ << endl;
+ throw LogicException(ss.str());
+ }
+ }
if (multipleTheories) {
// Collect the shared terms if there are multipe theories
NodeVisitor<SharedTermsVisitor>::run(d_sharedTermsVisitor, preprocessed);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback