1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
/*
* This file is part of the source code of the software program
* Vampire. It is protected by applicable
* copyright laws.
*
* This source code is distributed under the licence found here
* https://vprover.github.io/license.html
* and in the source directory
*/
/**
* @file Statistics.hpp
* Defines proof-search statistics
*
* @since 02/01/2008 Manchester
*/
#ifndef __Statistics__
#define __Statistics__
#include <array>
#include <ostream>
#include "Forwards.hpp"
#include "Debug/Assertion.hpp"
#include "Kernel/Inference.hpp"
extern const char *VERSION_STRING;
namespace Kernel {
class Unit;
}
namespace Shell {
using namespace Kernel;
/** termination reason */
enum class TerminationReason {
/** refutation found */
REFUTATION,
/** satisfiability detected (saturated set built) */
SATISFIABLE,
/** saturation terminated but an incomplete strategy was used */
REFUTATION_NOT_FOUND,
/** inappropriate strategy **/
INAPPROPRIATE,
/** unknown termination reason */
UNKNOWN,
/** time limit reached */
TIME_LIMIT,
/** instruction limit reached */
INSTRUCTION_LIMIT,
/** memory limit reached */
MEMORY_LIMIT,
/** activation limit reached */
ACTIVATION_LIMIT
};
enum class ExecutionPhase {
/** Whatever happens before we start parsing the problem */
INITIALIZATION,
PARSING,
/** Scanning for properties to be passed to preprocessing */
PROPERTY_SCANNING,
NORMALIZATION,
SHUFFLING,
SINE_SELECTION,
INCLUDING_THEORY_AXIOMS,
PREPROCESS_1,
UNUSED_PREDICATE_DEFINITION_REMOVAL,
BLOCKED_CLAUSE_ELIMINATION,
TWEE,
ANSWER_LITERAL,
PREPROCESS_2,
NEW_CNF,
NAMING,
PREPROCESS_3,
CLAUSIFICATION,
FUNCTION_DEFINITION_ELIMINATION,
INEQUALITY_SPLITTING,
EQUALITY_RESOLUTION_WITH_DELETION,
EQUALITY_PROXY,
GENERAL_SPLITTING,
SATURATION,
/** Whatever happens after the saturation algorithm finishes */
FINALIZATION,
FMB_PREPROCESSING,
FMB_CONSTRAINT_GEN,
FMB_SOLVING
};
/**
* Class Statistics
* @since 02/01/2008 Manchester
*/
class Statistics {
public:
enum UnitCountCategory { TOTAL_CNT = 0, INPROOF_CNT = 1 };
void print(std::ostream& out);
void explainRefutationNotFound(std::ostream& out);
void reportUnit(Unit* u, UnitCountCategory idx);
// Preprocessing
/** number of formula names introduced during preprocessing */
unsigned formulaNames = 0;
/** number of skolem functions (also predicates in FOOL) introduced during skolemization */
unsigned skolemFunctions = 0;
/** number of initial clauses */
unsigned initialClauses = 0;
/** number of inequality splittings performed */
unsigned splitInequalities = 0;
/** number of pure predicates */
unsigned purePredicates = 0;
/** number of unused predicate definitions */
unsigned unusedPredicateDefinitions = 0;
/** number of eliminated function definitions */
unsigned eliminatedFunctionDefinitions = 0;
/** number of formulas selected by SInE selector */
unsigned selectedBySine = 0;
/** number of iterations before SInE reached fixpoint */
unsigned sineIterations = 0;
/** number of detected blocked clauses */
unsigned blockedClauses = 0;
// Induction
unsigned maxInductionDepth = 0;
unsigned inductionApplication = 0;
// Redundant inferences
unsigned skippedSuperposition = 0;
unsigned skippedResolution = 0;
unsigned inferencesSkippedDueToOrderingConstraints = 0;
unsigned inferencesSkippedDueToAvatarConstraints = 0;
unsigned inferencesSkippedDueToLiteralConstraints = 0;
unsigned inferencesBlockedDueToOrderingAftercheck = 0;
unsigned inferencesSkippedDueToColors = 0;
// Simplifying inferences
/** number of duplicate literals deleted */
unsigned duplicateLiterals = 0;
/** number of literals s != s deleted */
unsigned trivialInequalities = 0;
/** number of forward demodulations into equational tautologies */
unsigned forwardDemodulationsToEqTaut = 0;
/** number of backward demodulations into equational tautologies */
unsigned backwardDemodulationsToEqTaut = 0;
/** number of forward subsumption demodulations into equational tautologies */
unsigned forwardSubsumptionDemodulationsToEqTaut = 0;
/** number of backward subsumption demodulations into equational tautologies */
unsigned backwardSubsumptionDemodulationsToEqTaut = 0;
// Deletion inferences
/** number of tautologies A \/ ~A */
unsigned simpleTautologies = 0;
/** number of equational tautologies s=s */
unsigned equationalTautologies = 0;
/** number of forward subsumed clauses */
unsigned forwardSubsumed = 0;
/** number of backward subsumed clauses */
unsigned backwardSubsumed = 0;
/** number of forward ground joinable clauses */
unsigned forwardGroundJoinable = 0;
/** number of term algebra distinctness tautology deletions */
unsigned taDistinctnessTautologyDeletions = 0;
/** number of inner rewrites into equational tautologies */
unsigned innerRewritesToEqTaut = 0;
/** number of equational tautologies discovered by CC */
unsigned deepEquationalTautologies = 0;
// Saturation
unsigned activations = 0; // NOTE: This is not a mere stat, it is also used for LRS estimation!
/** all passive clauses */
unsigned passiveClauses = 0;
/** all active clauses */
unsigned activeClauses = 0;
/** all extensionality clauses */
unsigned extensionalityClauses = 0;
unsigned discardedNonRedundantClauses = 0;
bool smtReturnedUnknown = false;
bool smtDidNotEvaluate = false;
/** passive clauses at the end of the saturation algorithm run */
unsigned finalPassiveClauses = 0;
/** active clauses at the end of the saturation algorithm run */
unsigned finalActiveClauses = 0;
/** extensionality clauses at the end of the saturation algorithm run */
unsigned finalExtensionalityClauses = 0;
unsigned splitClauses = 0;
unsigned splitComponents = 0;
/** Number of clauses generated for the SAT solver */
unsigned satClauses = 0;
/** Number of unit clauses generated for the SAT solver */
unsigned unitSatClauses = 0;
/** Number of binary clauses generated for the SAT solver */
unsigned binarySatClauses = 0;
unsigned satSplitRefutations = 0;
unsigned smtFallbacks = 0;
friend std::ostream& operator<<(std::ostream& out, TerminationReason const& self)
{
switch (self) {
case TerminationReason::REFUTATION:
return out << "REFUTATION";
case TerminationReason::SATISFIABLE:
return out << "SATISFIABLE";
case TerminationReason::REFUTATION_NOT_FOUND:
return out << "REFUTATION_NOT_FOUND";
case TerminationReason::INAPPROPRIATE:
return out << "INAPPROPRIATE";
case TerminationReason::UNKNOWN:
return out << "UNKNOWN";
case TerminationReason::TIME_LIMIT:
return out << "TIME_LIMIT";
case TerminationReason::INSTRUCTION_LIMIT:
return out << "INSTRUCTION_LIMIT";
case TerminationReason::MEMORY_LIMIT:
return out << "MEMORY_LIMIT";
case TerminationReason::ACTIVATION_LIMIT:
return out << "ACTIVATION_LIMIT";
}
ASSERTION_VIOLATION
}
/** termination reason */
TerminationReason terminationReason = TerminationReason::UNKNOWN;
/** refutation, if any */
Kernel::Unit *refutation = nullptr;
/** the saturated set of clauses, if any */
Kernel::UnitList *saturatedSet = nullptr;
/** if problem is satisfiable and we obtained a model, contains its
* representation; otherwise it is an empty string */
std::string model;
ExecutionPhase phase = ExecutionPhase::INITIALIZATION;
private:
static const char* phaseToString(ExecutionPhase p);
/** A pair counting the total and in-proof value of a statistic. */
typedef std::array<unsigned,2> StatPair;
/** number of input clauses */
StatPair inputClauses;
/** number of input formulas */
StatPair inputFormulas;
/** all clauses */
StatPair clauses;
/** all formulas */
StatPair formulas;
/** inference counts indexed by InferenceRule */
std::array<StatPair, toNumber(InferenceRule::GENERIC_THEORY_AXIOM_LAST)> inferenceCnts = {};
/** input types indexed by UnitInputType */
std::array<StatPair, toNumber(UnitInputType::MODEL_DEFINITION)> inputTypeCnts = {};
}; // class Statistics
} // namespace Shell
#endif