SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
SATModuleStatistics.h
Go to the documentation of this file.
1 /**
2  * @file SATstatistics.h
3  * Created on October 8, 2012, 11:07 PM
4  * @author: Florian Corzilius
5  *
6  *
7  */
8 
9 #pragma once
10 
12 
13 //#include <lib/utilities/stats/Statistics.h>
14 #ifdef SMTRAT_DEVOPTION_Statistics
15 
16 namespace smtrat
17 {
18  class SATModuleStatistics : public Statistics
19  {
20  private:
21  // Members.
22  std::size_t mNrTotalVariablesBefore = 0;
23  std::size_t mNrTotalVariablesAfter = 0;
24  std::size_t mNrTseitinVariables = 0;
25  std::size_t mNrClauses = 0;
26  std::size_t mNrLearnedLemmas = 0;
27  std::size_t mVarsWithPolarityTrue = 0;
28  std::size_t mPropagations = 0;
29  std::size_t mRestarts = 0;
30  std::size_t mDecisions = 0;
31 
32  public:
33  void collect()
34  {
35  addKeyValuePair( "variables", mNrTotalVariablesBefore );
36  addKeyValuePair( "introduced_variables", mNrTotalVariablesAfter-mNrTotalVariablesBefore );
37  addKeyValuePair( "tseitin_variables", mNrTseitinVariables );
38  addKeyValuePair( "variables_preferably_set_to_true", mVarsWithPolarityTrue );
39  addKeyValuePair( "clauses", mNrClauses );
40  addKeyValuePair( "lemmas_learned", mNrLearnedLemmas );
41  addKeyValuePair( "propagations", mPropagations );
42  addKeyValuePair( "decisions", mDecisions );
43  addKeyValuePair( "restarts", mRestarts );
44  }
45 
46  void lemmaLearned()
47  {
48  ++mNrLearnedLemmas;
49  }
50 
51  void initialTrue()
52  {
53  ++mVarsWithPolarityTrue;
54  }
55 
56  void propagate()
57  {
58  ++mPropagations;
59  }
60 
61  void decide()
62  {
63  ++mDecisions;
64  }
65 
66  void restart()
67  {
68  ++mRestarts;
69  }
70 
71  size_t& rNrClauses()
72  {
73  return mNrClauses;
74  }
75 
76  size_t& rNrTotalVariablesBefore()
77  {
78  return mNrTotalVariablesBefore;
79  }
80 
81  size_t& rNrTotalVariablesAfter()
82  {
83  return mNrTotalVariablesAfter;
84  }
85 
86  size_t& rNrTseitinVariables()
87  {
88  return mNrTseitinVariables;
89  }
90 
91  };
92 
93 }
94 #endif
Class to create the formulas for axioms.
carl::statistics::Statistics Statistics
Definition: Statistics.h:7