diff options
author | Tim King <taking@google.com> | 2016-01-08 16:44:57 -0800 |
---|---|---|
committer | Tim King <taking@google.com> | 2016-01-08 16:44:57 -0800 |
commit | f4ef7af0a2295691f281ee1604dfeb4082fe229c (patch) | |
tree | 995e512e5669cec6bbc9447d00ec912d5e4c19e3 /src/theory/arith/congruence_manager.cpp | |
parent | def0a07f9676a292a849d7fc8269ffd0901ce156 (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/arith/congruence_manager.cpp')
-rw-r--r-- | src/theory/arith/congruence_manager.cpp | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/theory/arith/congruence_manager.cpp b/src/theory/arith/congruence_manager.cpp index 964c92eb5..746121b70 100644 --- a/src/theory/arith/congruence_manager.cpp +++ b/src/theory/arith/congruence_manager.cpp @@ -13,10 +13,11 @@ ** [[ Add lengthier description here ]] ** \todo document this file **/ +#include "theory/arith/congruence_manager.h" #include "base/output.h" +#include "smt/smt_statistics_registry.h" #include "theory/arith/arith_utilities.h" -#include "theory/arith/congruence_manager.h" #include "theory/arith/constraint.h" namespace CVC4 { @@ -45,23 +46,23 @@ ArithCongruenceManager::Statistics::Statistics(): d_propagateConstraints("theory::arith::congruence::propagateConstraints", 0), d_conflicts("theory::arith::congruence::conflicts", 0) { - StatisticsRegistry::registerStat(&d_watchedVariables); - StatisticsRegistry::registerStat(&d_watchedVariableIsZero); - StatisticsRegistry::registerStat(&d_watchedVariableIsNotZero); - StatisticsRegistry::registerStat(&d_equalsConstantCalls); - StatisticsRegistry::registerStat(&d_propagations); - StatisticsRegistry::registerStat(&d_propagateConstraints); - StatisticsRegistry::registerStat(&d_conflicts); + smtStatisticsRegistry()->registerStat(&d_watchedVariables); + smtStatisticsRegistry()->registerStat(&d_watchedVariableIsZero); + smtStatisticsRegistry()->registerStat(&d_watchedVariableIsNotZero); + smtStatisticsRegistry()->registerStat(&d_equalsConstantCalls); + smtStatisticsRegistry()->registerStat(&d_propagations); + smtStatisticsRegistry()->registerStat(&d_propagateConstraints); + smtStatisticsRegistry()->registerStat(&d_conflicts); } ArithCongruenceManager::Statistics::~Statistics(){ - StatisticsRegistry::unregisterStat(&d_watchedVariables); - StatisticsRegistry::unregisterStat(&d_watchedVariableIsZero); - StatisticsRegistry::unregisterStat(&d_watchedVariableIsNotZero); - StatisticsRegistry::unregisterStat(&d_equalsConstantCalls); - StatisticsRegistry::unregisterStat(&d_propagations); - StatisticsRegistry::unregisterStat(&d_propagateConstraints); - StatisticsRegistry::unregisterStat(&d_conflicts); + smtStatisticsRegistry()->unregisterStat(&d_watchedVariables); + smtStatisticsRegistry()->unregisterStat(&d_watchedVariableIsZero); + smtStatisticsRegistry()->unregisterStat(&d_watchedVariableIsNotZero); + smtStatisticsRegistry()->unregisterStat(&d_equalsConstantCalls); + smtStatisticsRegistry()->unregisterStat(&d_propagations); + smtStatisticsRegistry()->unregisterStat(&d_propagateConstraints); + smtStatisticsRegistry()->unregisterStat(&d_conflicts); } ArithCongruenceManager::ArithCongruenceNotify::ArithCongruenceNotify(ArithCongruenceManager& acm) |