summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAina Niemetz <aina.niemetz@gmail.com>2018-08-02 17:11:36 -0700
committerGitHub <noreply@github.com>2018-08-02 17:11:36 -0700
commitfc99192e73d6147fd6a87c7b6139a800173dd4c2 (patch)
tree7c3eb10d36ef58ce06245436c25460202ba5573a
parentdf0d51e1541034656fd503dbf5561399b9a3db9f (diff)
Add timer for BV inequality solver. (#2265)
-rw-r--r--src/theory/bv/bv_subtheory_algebraic.cpp17
-rw-r--r--src/theory/bv/bv_subtheory_inequality.cpp10
-rw-r--r--src/theory/bv/bv_subtheory_inequality.h7
3 files changed, 19 insertions, 15 deletions
diff --git a/src/theory/bv/bv_subtheory_algebraic.cpp b/src/theory/bv/bv_subtheory_algebraic.cpp
index 456f627d0..8ea474ad7 100644
--- a/src/theory/bv/bv_subtheory_algebraic.cpp
+++ b/src/theory/bv/bv_subtheory_algebraic.cpp
@@ -2,7 +2,7 @@
/*! \file bv_subtheory_algebraic.cpp
** \verbatim
** Top contributors (to current version):
- ** Liana Hadarean, Tim King, Aina Niemetz
+ ** Liana Hadarean, Aina Niemetz, Tim King
** This file is part of the CVC4 project.
** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS
** in the top-level source directory) and their institutional affiliations.
@@ -252,21 +252,16 @@ AlgebraicSolver::~AlgebraicSolver() {
-bool AlgebraicSolver::check(Theory::Effort e) {
+bool AlgebraicSolver::check(Theory::Effort e)
+{
Assert(options::bitblastMode() == theory::bv::BITBLAST_MODE_LAZY);
- if (!Theory::fullEffort(e)) {
- return true;
- }
-
- if (!useHeuristic()) {
- return true;
- }
-
- ++(d_numCalls);
+ if (!Theory::fullEffort(e)) { return true; }
+ if (!useHeuristic()) { return true; }
TimerStat::CodeTimer algebraicTimer(d_statistics.d_solveTime);
Debug("bv-subtheory-algebraic") << "AlgebraicSolver::check (" << e << ")\n";
+ ++(d_numCalls);
++(d_statistics.d_numCallstoCheck);
d_explanations.clear();
diff --git a/src/theory/bv/bv_subtheory_inequality.cpp b/src/theory/bv/bv_subtheory_inequality.cpp
index 41ee74e8d..6fc167793 100644
--- a/src/theory/bv/bv_subtheory_inequality.cpp
+++ b/src/theory/bv/bv_subtheory_inequality.cpp
@@ -31,6 +31,7 @@ using namespace CVC4::theory::bv::utils;
bool InequalitySolver::check(Theory::Effort e) {
Debug("bv-subtheory-inequality") << "InequalitySolveR::check("<< e <<")\n";
+ TimerStat::CodeTimer inequalityTimer(d_statistics.d_solveTime);
++(d_statistics.d_numCallstoCheck);
d_bv->spendResource(options::theoryCheckStep());
@@ -246,10 +247,15 @@ bool InequalitySolver::addInequality(TNode a, TNode b, bool strict, TNode fact)
}
InequalitySolver::Statistics::Statistics()
- : d_numCallstoCheck("theory::bv::InequalitySolver::NumCallsToCheck", 0)
+ : d_numCallstoCheck("theory::bv::inequality::NumCallsToCheck", 0),
+ d_solveTime("theory::bv::inequality::SolveTime")
{
smtStatisticsRegistry()->registerStat(&d_numCallstoCheck);
+ smtStatisticsRegistry()->registerStat(&d_solveTime);
}
-InequalitySolver::Statistics::~Statistics() {
+
+InequalitySolver::Statistics::~Statistics()
+{
smtStatisticsRegistry()->unregisterStat(&d_numCallstoCheck);
+ smtStatisticsRegistry()->unregisterStat(&d_solveTime);
}
diff --git a/src/theory/bv/bv_subtheory_inequality.h b/src/theory/bv/bv_subtheory_inequality.h
index 06c39754f..1bdec8386 100644
--- a/src/theory/bv/bv_subtheory_inequality.h
+++ b/src/theory/bv/bv_subtheory_inequality.h
@@ -38,9 +38,12 @@ typedef expr::Attribute<IneqOnlyAttributeId, bool> IneqOnlyAttribute;
struct IneqOnlyComputedAttributeId {};
typedef expr::Attribute<IneqOnlyComputedAttributeId, bool> IneqOnlyComputedAttribute;
-class InequalitySolver: public SubtheorySolver {
- struct Statistics {
+class InequalitySolver : public SubtheorySolver
+{
+ struct Statistics
+ {
IntStat d_numCallstoCheck;
+ TimerStat d_solveTime;
Statistics();
~Statistics();
};
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback