summaryrefslogtreecommitdiff
path: root/src/theory/bv/lazy_bitblaster.cpp
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/theory/bv/lazy_bitblaster.cpp
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/theory/bv/lazy_bitblaster.cpp')
-rw-r--r--src/theory/bv/lazy_bitblaster.cpp35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/theory/bv/lazy_bitblaster.cpp b/src/theory/bv/lazy_bitblaster.cpp
index b8173cb8b..34a9418dd 100644
--- a/src/theory/bv/lazy_bitblaster.cpp
+++ b/src/theory/bv/lazy_bitblaster.cpp
@@ -20,6 +20,7 @@
#include "prop/cnf_stream.h"
#include "prop/sat_solver.h"
#include "prop/sat_solver_factory.h"
+#include "smt/smt_statistics_registry.h"
#include "theory/bv/abstraction.h"
#include "theory/bv/theory_bv.h"
#include "theory/rewriter.h"
@@ -46,7 +47,8 @@ TLazyBitblaster::TLazyBitblaster(context::Context* c, bv::TheoryBV* bv,
, d_name(name)
, d_statistics(name) {
- d_satSolver = prop::SatSolverFactory::createMinisat(c, name);
+ d_satSolver = prop::SatSolverFactory::createMinisat(
+ c, smtStatisticsRegistry(), name);
d_nullRegistrar = new prop::NullRegistrar();
d_nullContext = new context::Context();
d_cnfStream = new prop::TseitinCnfStream(d_satSolver, d_nullRegistrar,
@@ -307,24 +309,24 @@ TLazyBitblaster::Statistics::Statistics(const std::string& prefix) :
d_numBitblastingPropagations("theory::bv::"+prefix+"::NumberOfBitblastingPropagations", 0),
d_bitblastTimer("theory::bv::"+prefix+"::BitblastTimer")
{
- StatisticsRegistry::registerStat(&d_numTermClauses);
- StatisticsRegistry::registerStat(&d_numAtomClauses);
- StatisticsRegistry::registerStat(&d_numTerms);
- StatisticsRegistry::registerStat(&d_numAtoms);
- StatisticsRegistry::registerStat(&d_numExplainedPropagations);
- StatisticsRegistry::registerStat(&d_numBitblastingPropagations);
- StatisticsRegistry::registerStat(&d_bitblastTimer);
+ smtStatisticsRegistry()->registerStat(&d_numTermClauses);
+ smtStatisticsRegistry()->registerStat(&d_numAtomClauses);
+ smtStatisticsRegistry()->registerStat(&d_numTerms);
+ smtStatisticsRegistry()->registerStat(&d_numAtoms);
+ smtStatisticsRegistry()->registerStat(&d_numExplainedPropagations);
+ smtStatisticsRegistry()->registerStat(&d_numBitblastingPropagations);
+ smtStatisticsRegistry()->registerStat(&d_bitblastTimer);
}
TLazyBitblaster::Statistics::~Statistics() {
- StatisticsRegistry::unregisterStat(&d_numTermClauses);
- StatisticsRegistry::unregisterStat(&d_numAtomClauses);
- StatisticsRegistry::unregisterStat(&d_numTerms);
- StatisticsRegistry::unregisterStat(&d_numAtoms);
- StatisticsRegistry::unregisterStat(&d_numExplainedPropagations);
- StatisticsRegistry::unregisterStat(&d_numBitblastingPropagations);
- StatisticsRegistry::unregisterStat(&d_bitblastTimer);
+ smtStatisticsRegistry()->unregisterStat(&d_numTermClauses);
+ smtStatisticsRegistry()->unregisterStat(&d_numAtomClauses);
+ smtStatisticsRegistry()->unregisterStat(&d_numTerms);
+ smtStatisticsRegistry()->unregisterStat(&d_numAtoms);
+ smtStatisticsRegistry()->unregisterStat(&d_numExplainedPropagations);
+ smtStatisticsRegistry()->unregisterStat(&d_numBitblastingPropagations);
+ smtStatisticsRegistry()->unregisterStat(&d_bitblastTimer);
}
bool TLazyBitblaster::MinisatNotify::notify(prop::SatLiteral lit) {
@@ -496,7 +498,8 @@ void TLazyBitblaster::clearSolver() {
invalidateModelCache();
// recreate sat solver
- d_satSolver = prop::SatSolverFactory::createMinisat(d_ctx);
+ d_satSolver = prop::SatSolverFactory::createMinisat(
+ d_ctx, smtStatisticsRegistry());
d_cnfStream = new prop::TseitinCnfStream(d_satSolver, d_nullRegistrar,
d_nullContext, d_bv->globals());
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback