summaryrefslogtreecommitdiff
path: root/src/prop/bvminisat/bvminisat.h
diff options
context:
space:
mode:
authorTim King <taking@google.com>2016-01-08 16:44:57 -0800
committerTim King <taking@google.com>2016-01-08 16:44:57 -0800
commitf4ef7af0a2295691f281ee1604dfeb4082fe229c (patch)
tree995e512e5669cec6bbc9447d00ec912d5e4c19e3 /src/prop/bvminisat/bvminisat.h
parentdef0a07f9676a292a849d7fc8269ffd0901ce156 (diff)
Removing StatisticsRegistry's static functions current() and registerStat().
- The functionality the get the StatisticsRegistry attached to the SmtEngine was previously through StatisticsRegistry::current(). This is the dominant StatisticsRegistry in the code. (There is another StatisticsRegistry attached to the NodeManager.) Having this be a static function on StatisticsRegistry requires the use of an SmtEngine in the wrong compilation unit. - Usages of StatisticsRegistry::current() that were visible in prop/{bvminisat,minisat} has been removed. A pointer to the relevant StatisticsRegistry should be passed instead into the constructor. - The function StatisticsRegistry::current() has been replaced by SmtScope::currentStatisticsRegistry(). SmtScope is in the libcvc4 package, where SmtEngine is available in the compilation unit. - The function smtStatisticsRegistry() is a synonym for SmtScope::currentStatisticsRegistry() in smt/smt_statistics_registry.h. This header has fewer include dependencies than the one for SmtScope. - Correspondingly, the static functions StatisticsRegistry::{registerStat, unregisterStat} have been removed. One should instead use smtStatisticsRegistry()->{registerStat,unregisterStat} instead. - The KEEP_STATISTIC macro has been moved into smt/smt_statistics_registry.h. - Documents the reason StatisticsRegistry is CVC4_PUBLIC. This lets me remove the warning I added. - Removing most operators for timespec from statistics_registry.h file. These a bit error prone in clang. - Most of the really confusing ifdef's in util/statistics_registry.h are gone.
Diffstat (limited to 'src/prop/bvminisat/bvminisat.h')
-rw-r--r--src/prop/bvminisat/bvminisat.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/prop/bvminisat/bvminisat.h b/src/prop/bvminisat/bvminisat.h
index fc5b29e89..986fbf339 100644
--- a/src/prop/bvminisat/bvminisat.h
+++ b/src/prop/bvminisat/bvminisat.h
@@ -20,9 +20,10 @@
#pragma once
-#include "prop/sat_solver.h"
-#include "prop/bvminisat/simp/SimpSolver.h"
#include "context/cdo.h"
+#include "prop/bvminisat/simp/SimpSolver.h"
+#include "prop/sat_solver.h"
+#include "util/statistics_registry.h"
namespace CVC4 {
namespace prop {
@@ -67,13 +68,7 @@ protected:
public:
- BVMinisatSatSolver() :
- ContextNotifyObj(NULL, false),
- d_assertionsRealCount(NULL, (unsigned)0),
- d_lastPropagation(NULL, (unsigned)0),
- d_statistics("")
- { Unreachable(); }
- BVMinisatSatSolver(context::Context* mainSatContext, const std::string& name = "");
+ BVMinisatSatSolver(StatisticsRegistry* registry, context::Context* mainSatContext, const std::string& name = "");
~BVMinisatSatSolver() throw(AssertionException);
void setNotify(Notify* notify);
@@ -90,7 +85,7 @@ public:
void markUnremovable(SatLiteral lit);
void interrupt();
-
+
SatValue solve();
SatValue solve(long unsigned int&);
void getUnsatCore(SatClause& unsatCore);
@@ -117,11 +112,16 @@ public:
void explain(SatLiteral lit, std::vector<SatLiteral>& explanation);
SatValue assertAssumption(SatLiteral lit, bool propagate);
-
+
void popAssumption();
+private:
+ /* Disable the default constructor. */
+ BVMinisatSatSolver() CVC4_UNUSED;
+
class Statistics {
public:
+ StatisticsRegistry* d_registry;
ReferenceStat<uint64_t> d_statStarts, d_statDecisions;
ReferenceStat<uint64_t> d_statRndDecisions, d_statPropagations;
ReferenceStat<uint64_t> d_statConflicts, d_statClausesLiterals;
@@ -131,7 +131,7 @@ public:
IntStat d_statCallsToSolve;
BackedStat<double> d_statSolveTime;
bool d_registerStats;
- Statistics(const std::string& prefix);
+ Statistics(StatisticsRegistry* registry, const std::string& prefix);
~Statistics();
void init(BVMinisat::SimpSolver* minisat);
};
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback