SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
STropModuleStatistics.h
Go to the documentation of this file.
1 #pragma once
2 
4 #ifdef SMTRAT_DEVOPTION_Statistics
6 namespace smtrat {
7 class STropModuleStatistics : public Statistics {
8 public:
9  enum class AnswerBy { NONE = 0,
10  TRIVIAL_UNSAT = 1,
11  METHOD = 2,
12  BACKEND = 3,
13  PARSER = 4 };
14 
15 private:
16  carl::statistics::Timer m_theory_timer;
17  carl::statistics::Timer m_transformation_timer;
18  std::size_t m_answer_by_TRIVIAL_UNSAT = 0;
19  std::size_t m_answer_by_METHOD = 0;
20  std::size_t m_answer_by_BACKEND = 0;
21  std::size_t m_answer_by_PARSER = 0;
22  std::size_t m_failed = 0;
23  std::size_t m_transformation_applicable = 0;
24 
25 public:
26  void collect() {
27  Statistics::addKeyValuePair("theory_call_time", m_theory_timer);
28  Statistics::addKeyValuePair("transformation_time", m_transformation_timer);
29  Statistics::addKeyValuePair("answer_by_TRIVIAL_UNSAT", m_answer_by_TRIVIAL_UNSAT);
30  Statistics::addKeyValuePair("answer_by_METHOD", m_answer_by_METHOD);
31  Statistics::addKeyValuePair("answer_by_BACKEND", m_answer_by_BACKEND);
32  Statistics::addKeyValuePair("answer_by_PARSER", m_answer_by_PARSER);
33  Statistics::addKeyValuePair("failed", m_failed);
34  Statistics::addKeyValuePair("transformation_applicable", m_transformation_applicable);
35  }
36 
37  void answer_by(AnswerBy answer_by) {
38  switch (answer_by) {
39  case AnswerBy::TRIVIAL_UNSAT:
40  m_answer_by_TRIVIAL_UNSAT++;
41  break;
42  case AnswerBy::METHOD:
43  m_answer_by_METHOD++;
44  break;
45  case AnswerBy::BACKEND:
46  m_answer_by_BACKEND++;
47  break;
48  case AnswerBy::PARSER:
49  m_answer_by_PARSER++;
50  break;
51  default:
52  break;
53  }
54  }
55 
56  void failed() {
57  m_failed++;
58  }
59 
60  void transformation_applicable() {
61  m_transformation_applicable++;
62  }
63 
64  auto& theory_timer() {
65  return m_theory_timer;
66  }
67 
68  auto& transformation_timer() {
69  return m_transformation_timer;
70  }
71 };
72 } // namespace smtrat
73 #endif
Class to create the formulas for axioms.
@ NONE
Definition: types.h:53
carl::statistics::Statistics Statistics
Definition: Statistics.h:7