SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
OCStatistics.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #ifdef SMTRAT_DEVOPTION_Statistics
6 
8 
9 namespace smtrat {
10 namespace mcsat {
11 namespace onecell {
12 
13 class OCStatistics : public Statistics {
14 private:
15  std::size_t mExplanationCalled = 0;
16  std::size_t mExplanationSuccess = 0;
17  carl::statistics::Timer mOneCellTimer;
18 
19  std::size_t m_algebraic_samples = 0;
20  carl::statistics::MultiCounter<std::size_t> m_levels;
21 
22 public:
23  bool enabled() const {
24  return true;
25  }
26 
27  void collect() {
28  Statistics::addKeyValuePair("explanation_called", mExplanationCalled);
29  Statistics::addKeyValuePair("explanation_success", mExplanationSuccess);
30  Statistics::addKeyValuePair("onecell_called", mOneCellTimer);
31 
32  Statistics::addKeyValuePair("algebraic_samples", m_algebraic_samples);
33  Statistics::addKeyValuePair("levels", m_levels);
34 
35  }
36 
37  auto& timer() {
38  return mOneCellTimer;
39  }
40 
41  void explanationCalled() {
42  ++mExplanationCalled;
43  }
44 
45  void explanationSuccess() {
46  ++mExplanationSuccess;
47  }
48 
49  void assignment(const smtrat::cadcells::Assignment& ass) {
50  if (std::find_if(ass.begin(), ass.end(), [](const auto& m) { return !m.second.is_numeric(); }) != ass.end()) {
51  m_algebraic_samples++;
52  }
53  m_levels.inc(ass.size(), 1);
54  }
55 };
56 
57 }
58 }
59 }
60 
61 #endif
carl::Assignment< RAN > Assignment
Definition: common.h:25
std::optional< cadcells::DNF > onecell(const std::vector< cadcells::Atom > &constraints, const cadcells::Polynomial::ContextType &context, const cadcells::Assignment &sample)
An MCSAT-style single cell explanation function.
Definition: onecell.h:31
Class to create the formulas for axioms.
carl::statistics::Statistics Statistics
Definition: Statistics.h:7