SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
LRAModuleStatistics.h
Go to the documentation of this file.
1 #pragma once
2 
4 #ifdef SMTRAT_DEVOPTION_Statistics
6 
7 namespace smtrat
8 {
9  class LRAModuleStatistics : public Statistics
10  {
11  private:
12  // Members.
13  std::size_t mPivotingSteps = 0;
14  std::size_t mCurrentPivotingSteps = 0;
15  std::size_t mMostPivotingStepsInACheck = 0;
16  std::size_t mChecksWithPivoting = 0;
17  std::size_t mTableauxSize = 0;
18  std::size_t mTableauEntries = 0;
19  std::size_t mRefinements = 0;
20  std::size_t mConflicts = 0;
21  std::size_t mAllConflictsSizes = 0;
22  std::size_t mDeductions = 0;
23  std::size_t mTheoryPropagations = 0;
24  std::size_t mChecks = 0;
25  std::size_t mAllChecksSizes = 0;
26  std::size_t mUnequalConstrainSplittings = 0;
27  public:
28  // Override Statistics::collect.
29  void collect()
30  {
31  addKeyValuePair( "pivots", mPivotingSteps );
32  addKeyValuePair( "max-pivots", mMostPivotingStepsInACheck );
33  addKeyValuePair( "average-num-of_pivots", mChecksWithPivoting == 0 ? 0 : (double)mPivotingSteps/(double)mChecksWithPivoting );
34  addKeyValuePair( "tableau-size", mTableauxSize );
35  addKeyValuePair( "tableau-entries", mTableauEntries );
36  addKeyValuePair( "tableau-coverage", mTableauxSize == 0 ? 0 : (double)mTableauEntries/(double)mTableauxSize );
37  addKeyValuePair( "refinements", mRefinements );
38  addKeyValuePair( "conflicts", mConflicts );
39  addKeyValuePair( "average-conflict-size", mConflicts == 0 ? 0 : (double)mAllConflictsSizes/(double)mConflicts );
40  addKeyValuePair( "lemmas", mDeductions );
41  addKeyValuePair( "theory-propagations", mTheoryPropagations );
42  addKeyValuePair( "checks", mChecks );
43  addKeyValuePair( "checks-with-pivots", mChecksWithPivoting );
44  addKeyValuePair( "average-check-size", mChecks == 0 ? 0 : (double)mAllChecksSizes/(double)mChecks );
45  addKeyValuePair( "unequal-constraint-splittings", mUnequalConstrainSplittings );
46  }
47 
48  void pivotStep()
49  {
50  ++mPivotingSteps;
51  ++mCurrentPivotingSteps;
52  }
53 
54  void check( const ModuleInput& _formula )
55  {
56  if( mCurrentPivotingSteps > 0 )
57  {
58  if( mCurrentPivotingSteps > mMostPivotingStepsInACheck )
59  mMostPivotingStepsInACheck = mCurrentPivotingSteps;
60  ++mChecksWithPivoting;
61  }
62  mCurrentPivotingSteps = 0;
63  ++mChecks;
64  mAllChecksSizes += _formula.size();
65  }
66 
67  void add( const ConstraintT& )
68  {
69  }
70 
71  void remove( const ConstraintT& )
72  {
73  }
74 
75  void addConflict( const std::vector<FormulaSetT>& _infSubSets )
76  {
77  for( auto iss = _infSubSets.begin(); iss != _infSubSets.end(); ++iss )
78  {
79  ++mConflicts;
80  mAllConflictsSizes += iss->size();
81  }
82  }
83 
84  void addLemma()
85  {
86  ++mDeductions;
87  }
88 
89  void propagateTheory()
90  {
91  ++mTheoryPropagations;
92  }
93 
94  void addRefinement()
95  {
96  ++mRefinements;
97  }
98 
99  void splitUnequalConstraint()
100  {
101  ++mUnequalConstrainSplittings;
102  }
103 
104  void setTableauSize( size_t _size )
105  {
106  mTableauxSize = _size;
107  }
108 
109  void setNumberOfTableauxEntries( size_t _num )
110  {
111  mTableauEntries = _num;
112  }
113  };
114 }
115 
116 #endif
static void remove(V &ts, const T &t)
Definition: Alg.h:36
Class to create the formulas for axioms.
carl::Constraint< Poly > ConstraintT
Definition: types.h:29
carl::statistics::Statistics Statistics
Definition: Statistics.h:7