summaryrefslogtreecommitdiff
path: root/src/theory
diff options
context:
space:
mode:
authorTim King <taking@cs.nyu.edu>2013-04-01 11:26:14 -0400
committerTim King <taking@cs.nyu.edu>2013-04-01 19:43:06 -0400
commit3740d285d939b85af47804871abbf545ddda01af (patch)
tree4e08546eefce906c5b6cdbf8c667b4ba404c3a49 /src/theory
parent7e011fd7ae1a95eb70a393d780e13c559cdce4a1 (diff)
Adding demand restart.
Diffstat (limited to 'src/theory')
-rw-r--r--src/theory/output_channel.h7
-rw-r--r--src/theory/theory_engine.h17
2 files changed, 22 insertions, 2 deletions
diff --git a/src/theory/output_channel.h b/src/theory/output_channel.h
index ca22f29b6..1bb6b5a9c 100644
--- a/src/theory/output_channel.h
+++ b/src/theory/output_channel.h
@@ -216,6 +216,13 @@ public:
*/
virtual void handleUserAttribute(const char* attr, Theory* t) {}
+
+ /** Demands that the search restart from sat search level 0.
+ * Using this leads to non-termination issues.
+ * It is appropraite for prototyping for theories.
+ */
+ virtual void demandRestart() throw(TypeCheckingExceptionPrivate, AssertionException) {}
+
};/* class OutputChannel */
}/* CVC4::theory namespace */
diff --git a/src/theory/theory_engine.h b/src/theory/theory_engine.h
index a8fe52498..f72b824cd 100644
--- a/src/theory/theory_engine.h
+++ b/src/theory/theory_engine.h
@@ -208,20 +208,22 @@ class TheoryEngine {
public:
- IntStat conflicts, propagations, lemmas, requirePhase, flipDecision;
+ IntStat conflicts, propagations, lemmas, requirePhase, flipDecision, restartDemands;
Statistics(theory::TheoryId theory):
conflicts(mkName("theory<", theory, ">::conflicts"), 0),
propagations(mkName("theory<", theory, ">::propagations"), 0),
lemmas(mkName("theory<", theory, ">::lemmas"), 0),
requirePhase(mkName("theory<", theory, ">::requirePhase"), 0),
- flipDecision(mkName("theory<", theory, ">::flipDecision"), 0)
+ flipDecision(mkName("theory<", theory, ">::flipDecision"), 0),
+ restartDemands(mkName("theory<", theory, ">::restartDemands"), 0)
{
StatisticsRegistry::registerStat(&conflicts);
StatisticsRegistry::registerStat(&propagations);
StatisticsRegistry::registerStat(&lemmas);
StatisticsRegistry::registerStat(&requirePhase);
StatisticsRegistry::registerStat(&flipDecision);
+ StatisticsRegistry::registerStat(&restartDemands);
}
~Statistics() {
@@ -230,6 +232,7 @@ class TheoryEngine {
StatisticsRegistry::unregisterStat(&lemmas);
StatisticsRegistry::unregisterStat(&requirePhase);
StatisticsRegistry::unregisterStat(&flipDecision);
+ StatisticsRegistry::unregisterStat(&restartDemands);
}
};/* class TheoryEngine::Statistics */
@@ -292,6 +295,16 @@ class TheoryEngine {
return d_engine->lemma(lemma, false, removable);
}
+ void demandRestart() throw(TypeCheckingExceptionPrivate, AssertionException) {
+ NodeManager* curr = NodeManager::currentNM();
+ Node restartVar = curr->mkSkolem("restartVar",
+ curr->booleanType(),
+ "A boolean variable assrted to be true to force a restart");
+ Trace("theory::restart") << "EngineOutputChannel<" << d_theory << ">::restart(" << restartVar << ")" << std::endl;
+ ++ d_statistics.restartDemands;
+ lemma(restartVar, true);
+ }
+
void requirePhase(TNode n, bool phase)
throw(theory::Interrupted, AssertionException) {
Debug("theory") << "EngineOutputChannel::requirePhase("
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback