ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
statistics.h
Go to the documentation of this file.
1#ifndef _statistics_h_INCLUDED
2#define _statistics_h_INCLUDED
3
4#include <stdbool.h>
5#include <stdint.h>
6
7#include "global.h"
9
10// clang-format off
11
12#define METRICS_COUNTERS_AND_STATISTICS \
13\
14 METRIC (allocated_collected, 2, PCNT_RESIDENT_SET, "%", "resident set") \
15 METRIC (allocated_current, 2, PCNT_RESIDENT_SET, "%", "resident set") \
16 METRIC (allocated_max, 2, PCNT_RESIDENT_SET, "%", "resident set") \
17 STATISTIC (ands_eliminated, 1, PCNT_ELIMINATED, "%", "eliminated") \
18 METRIC (ands_extracted, 1, PCNT_EXTRACTED, "%", "extracted") \
19 METRIC (arena_enlarged, 1, PCNT_ARENA_RESIZED, "%", "resize") \
20 METRIC (arena_garbage, 1, PCNT_RESIDENT_SET, "%", "resident set") \
21 METRIC (arena_resized, 1, CONF_INT, "", "interval") \
22 METRIC (arena_shrunken, 1, PCNT_ARENA_RESIZED, "%", "resize") \
23 COUNTER (backbone_computations, 2, CONF_INT, "", "interval") \
24 METRIC (backbone_implied, 1, PER_BACKBONE_UNIT, 0, "per unit") \
25 METRIC (backbone_probes, 2, PER_VARIABLE, "", "per variable") \
26 METRIC (backbone_propagations, 2, PCNT_PROPS, "%", "propagations") \
27 METRIC (backbone_rounds, 2, PER_BACKBONE, 0, "per backbone") \
28 COUNTER (backbone_ticks, 2, PCNT_TICKS, "%", "ticks") \
29 STATISTIC (backbone_units, 1, PCNT_VARIABLES, "%", "variables") \
30 METRIC (best_saved, 1, CONF_INT, "", "interval") \
31 COUNTER (chronological, 1, PCNT_CONFLICTS, "%", "conflicts") \
32 COUNTER (clauses_added, 2, PCNT_CLS_ADDED, "%", "added") \
33 COUNTER (clauses_binary, 2, PCNT_CLS_ADDED, "%", "added") \
34 STATISTIC (clauses_deleted, 1, PCNT_CLS_ADDED, "%", "added") \
35 STATISTIC (clauses_factored, 1, PCNT_CLS_ADDED, "%", "added") \
36 STATISTIC (clauses_improved, 1, PCNT_CLS_LEARNED, "%", "learned") \
37 COUNTER (clauses_irredundant, 2, PCNT_CLS_ADDED, "%", "added") \
38 STATISTIC (clauses_kept1, 1, PCNT_CLS_IMPROVED, "%", "improved") \
39 STATISTIC (clauses_kept2, 1, PCNT_CLS_IMPROVED, "%", "improved") \
40 STATISTIC (clauses_kept3, 1, PCNT_CLS_IMPROVED, "%", "improved") \
41 COUNTER (clauses_learned, 2, PCNT_CONFLICTS, "%", "conflicts") \
42 COUNTER (clauses_original, 2, PCNT_CLS_ADDED, "%", "added") \
43 STATISTIC (clauses_promoted1, 1, PCNT_CLS_IMPROVED, "%", "improved") \
44 STATISTIC (clauses_promoted2, 1, PCNT_CLS_IMPROVED, "%", "improved") \
45 STATISTIC (clauses_reduced, 1, PCNT_CLS_LEARNED, "%", "learned") \
46 STATISTIC (clauses_reduced_tier1, 1, PCNT_CLS_REDUCED, "%", "reduced") \
47 STATISTIC (clauses_reduced_tier2, 1, PCNT_CLS_REDUCED, "%", "reduced") \
48 STATISTIC (clauses_reduced_tier3, 1, PCNT_CLS_REDUCED, "%", "reduced") \
49 COUNTER (clauses_redundant, 2, NO_SECONDARY, 0, 0) \
50 STATISTIC (clauses_unfactored, 1, PCNT_CLS_FACTORED, "%", "factored") \
51 COUNTER (clauses_used, 2, PCNT_CLS_LEARNED, "%", "learned") \
52 COUNTER (clauses_used_focused, 2, PCNT_CLS_USED, "%", "used") \
53 COUNTER (clauses_used_stable, 2, PCNT_CLS_USED, "%", "used") \
54 COUNTER (closures, 2, CONF_INT, "", "interval") \
55 METRIC (compacted, 1, PCNT_REDUCTIONS, "%", "reductions") \
56 COUNTER (conflicts, 0, PER_SECOND, 0, "per second") \
57 COUNTER (congruent, 1, PCNT_VARIABLES, "%", "variables") \
58 STATISTIC (congruent_ands, 1, PCNT_CONGRUENT, "%", "congruent") \
59 STATISTIC (congruent_arity, 1, PER_CONGRGATES, 0, "per gate") \
60 STATISTIC (congruent_arity_ands, 1, PER_CONGRANDS, 0, "per AND") \
61 STATISTIC (congruent_arity_xors, 1, PER_CONGRXORS, 0, "per XOR") \
62 STATISTIC (congruent_binaries, 1, PCNT_CLS_ADDED, "%", "clauses added") \
63 STATISTIC (congruent_ites, 1, PCNT_CONGRUENT, "%", "congruent") \
64 STATISTIC (congruent_collisions, 1, PER_CONGRLOOKUP, 0, "per lookup") \
65 STATISTIC (congruent_collisions_find, 1, PCNT_CONGRCOLS, "%", "collisions") \
66 STATISTIC (congruent_collisions_index, 1, PCNT_CONGRCOLS, "%", "collisions") \
67 STATISTIC (congruent_collisions_removed, 1, PCNT_CONGRCOLS, "%", "collisions") \
68 STATISTIC (congruent_equivalences, 1, PCNT_CONGRUENT, "%", "congruent") \
69 COUNTER (congruent_gates, 2, PER_CLOSURE, 0, "per closure") \
70 COUNTER (congruent_gates_ands, 2, PCNT_CONGRGATES, "%", "gates") \
71 COUNTER (congruent_gates_ites, 2, PCNT_CONGRGATES, "%", "gates") \
72 COUNTER (congruent_gates_xors, 2, PCNT_CONGRGATES, "%", "gates") \
73 STATISTIC (congruent_indexed, 1, PER_CONGRGATES, 0, "per gate") \
74 STATISTIC (congruent_lookups, 1, PER_CONGRGATES, 0, "per gate") \
75 STATISTIC (congruent_lookups_find, 1, PCNT_CONGRLOOKUP, "%", "lookups") \
76 STATISTIC (congruent_lookups_removed, 1, PCNT_CONGRLOOKUP, "%", "lookups") \
77 COUNTER (congruent_matched, 2, PCNT_CONGRUENT, "%", "congruent") \
78 COUNTER (congruent_matched_ands, 2, PCNT_CONGRMATCHED, "%", "matched") \
79 COUNTER (congruent_matched_ites, 2, PCNT_CONGRMATCHED, "%", "matched") \
80 COUNTER (congruent_matched_xors, 2, PCNT_CONGRMATCHED, "%", "matched") \
81 STATISTIC (congruent_rewritten, 1, PCNT_CONGRGATES, "%", "gates") \
82 STATISTIC (congruent_rewritten_ands, 1, PCNT_CONGREWR, "%", "rewritten") \
83 STATISTIC (congruent_rewritten_ites, 1, PCNT_CONGREWR, "%", "rewritten") \
84 STATISTIC (congruent_rewritten_xors, 1, PCNT_CONGREWR, "%", "rewritten") \
85 STATISTIC (congruent_simplified, 1, PCNT_CONGRGATES, "%", "gates") \
86 STATISTIC (congruent_simplified_ands, 1, PCNT_CONGRSIMPS, "%", "simplified") \
87 STATISTIC (congruent_simplified_ites, 1, PCNT_CONGRSIMPS, "%", "simplified") \
88 STATISTIC (congruent_simplified_xors, 1, PCNT_CONGRSIMPS, "%", "simplified") \
89 STATISTIC (congruent_subsumed, 1, PCNT_CLS_ORIGINAL, "%", "original") \
90 STATISTIC (congruent_trivial_ite, 1, PCNT_CONGRUENT, "%", "congruent") \
91 STATISTIC (congruent_unary, 1, PCNT_CONGRUENT, "%", "congruent") \
92 STATISTIC (congruent_unary_ands, 1, PCNT_CONGRUNARY, "%", "unary") \
93 STATISTIC (congruent_unary_ites, 1, PCNT_CONGRUNARY, "%", "unary") \
94 STATISTIC (congruent_unary_xors, 1, PCNT_CONGRUNARY, "%", "unary") \
95 STATISTIC (congruent_units, 1, PCNT_VARIABLES, "%", "variables") \
96 STATISTIC (congruent_xors, 1, PCNT_CONGRUENT, "%", "congruent") \
97 COUNTER (decisions, 0, PER_CONFLICT, 0, "per conflict") \
98 METRIC (definitions_checked, 1, PCNT_ELIM_ATTEMPTS, "%", "attempts") \
99 STATISTIC (definitions_eliminated, 1, PCNT_ELIMINATED, "%", "eliminated") \
100 METRIC (definitions_extracted, 1, PCNT_EXTRACTED, "%", "extracted") \
101 STATISTIC (definition_units, 1, PCNT_VARIABLES, "%", "variables") \
102 METRIC (defragmentations, 1, CONF_INT, "", "interval") \
103 METRIC (dense_garbage_collections, 2, PCNT_COLLECTIONS, "%", "collections") \
104 METRIC (dense_propagations, 1, PCNT_PROPS, "%", "propagations") \
105 METRIC (dense_ticks, 1, PCNT_TICKS, "%", "ticks") \
106 METRIC (duplicated, 1, PCNT_CLS_ADDED, "%", "added") \
107 STATISTIC (eagerly_subsumed, 1, PCNT_CLS_LEARNED, "%", "learned") \
108 STATISTIC (eliminate_attempted, 1, PER_VARIABLE, 0, "per variable") \
109 COUNTER (eliminated, 1, PCNT_VARIABLES, "%", "variables") \
110 COUNTER (eliminate_resolutions, 2, PER_SECOND, 0, "per second") \
111 STATISTIC (eliminate_units, 1, PCNT_VARIABLES, "%", "variables") \
112 COUNTER (eliminations, 2, CONF_INT, "", "interval") \
113 STATISTIC (equivalences_eliminated, 1, PCNT_ELIMINATED, "%", "eliminated") \
114 METRIC (equivalences_extracted, 1, PCNT_EXTRACTED, "%", "extracted") \
115 METRIC (extensions, 1, PCNT_SEARCHES, "%", "searches") \
116 COUNTER (factored, 1, PCNT_VARIABLES, "%", "variables") \
117 COUNTER (factorizations, 2, CONF_INT, "", "interval") \
118 COUNTER (factor_ticks, 2, PCNT_TICKS, "%", "ticks") \
119 COUNTER (fast_eliminated, 1, PCNT_ELIMINATED, "%", "eliminated") \
120 COUNTER (fast_strengthened, 1, PCNT_STRENGTHENED, "%", "per strengthened") \
121 COUNTER (fast_subsumed, 1, PCNT_SUBSUMED, "%", "per subsumed") \
122 STATISTIC (fresh, 1, PCNT_VARIABLES, "%", "variables") \
123 STATISTIC (flipped, 1, PER_WALKS, 0, "per walk") \
124 METRIC (flushed, 2, PER_FIXED, 0, "per fixed") \
125 METRIC (focused_decisions, 1, PCNT_DECISIONS, "%", "decisions") \
126 METRIC (focused_modes, 1, CONF_INT, "", "interval") \
127 METRIC (focused_propagations, 1, PCNT_PROPS, "%", "propagations") \
128 METRIC (focused_restarts, 1, PCNT_RESTARTS, "%", "restarts") \
129 METRIC (focused_ticks, 1, PCNT_TICKS, "%", "ticks") \
130 COUNTER (forward_checks, 2, NO_SECONDARY, 0, 0) \
131 COUNTER (forward_steps, 2, PER_FORWARD_CHECK, 0, "per check") \
132 STATISTIC (forward_strengthened, 1, PCNT_STRENGTHENED, "%", "per strengthened") \
133 STATISTIC (forward_subsumed, 1, PCNT_SUBSUMED, "%", "per subsumed") \
134 METRIC (forward_subsumptions, 1, CONF_INT, "", "interval") \
135 METRIC (garbage_collections, 2, CONF_INT, "", "interval") \
136 METRIC (gates_checked, 1, PCNT_ELIM_ATTEMPTS, "%", "attempts") \
137 STATISTIC (gates_eliminated, 1, PCNT_ELIMINATED, "%", "eliminated") \
138 METRIC (gates_extracted, 1, PCNT_ELIM_ATTEMPTS, "%", "attempts") \
139 STATISTIC (if_then_else_eliminated, 1, PCNT_ELIMINATED, "%", "eliminated") \
140 METRIC (if_then_else_extracted, 1, PCNT_EXTRACTED, "%", "extracted") \
141 METRIC (initial_decisions, 1, PCNT_DECISIONS, "%", "decisions") \
142 COUNTER (iterations, 1, PCNT_VARIABLES, "%", "variables") \
143 STATISTIC (jumped_reasons, 1, PCNT_PROPS, "%", "propagations") \
144 STATISTIC (kitten_conflicts, 1, PER_KITTEN_SOLVED, 0, "per solved") \
145 STATISTIC (kitten_decisions, 1, PER_KITTEN_SOLVED, 0, "per solved") \
146 STATISTIC (kitten_flip, 1, NO_SECONDARY, 0, 0) \
147 STATISTIC (kitten_flipped, 1, PCNT_KITTEN_FLIP, "%", "flip") \
148 COUNTER (kitten_propagations, 2, PER_KITTEN_SOLVED, 0, "per solved") \
149 STATISTIC (kitten_sat, 1, PCNT_KITTEN_SOLVED, "%", "solved") \
150 COUNTER (kitten_solved, 2, NO_SECONDARY, 0, 0) \
151 COUNTER (kitten_ticks, 2, PER_KITTEN_PROP, 0, "per prop") \
152 STATISTIC (kitten_unknown, 1, PCNT_KITTEN_SOLVED, "%", "solved") \
153 STATISTIC (kitten_unsat, 1, PCNT_KITTEN_SOLVED, "%", "solved") \
154 METRIC (literals_bumped, 1, PER_CLS_LEARNED, 0, "per clause") \
155 METRIC (literals_deduced, 1, PER_CLS_LEARNED, 0, "per clause") \
156 COUNTER (literals_factor, 2, PER_VARIABLE, 0, "per variable") \
157 STATISTIC (literals_factored, 1, PER_CLS_FACTORED, 0, "per factored") \
158 METRIC (literals_learned, 1, PER_CLS_LEARNED, 0, "per clause") \
159 METRIC (literals_minimized, 1, PCNT_LITS_DEDUCED, "%", "deduced") \
160 METRIC (literals_minshrunken, 1, PCNT_LITS_SHRUNKEN, "%", "shrunken") \
161 METRIC (literals_shrunken, 1, PCNT_LITS_DEDUCED, "%", "deduced") \
162 STATISTIC (literals_unfactored, 2, PER_CLS_UNFACTORED, 0, "per unfactored") \
163 METRIC (moved, 1, PCNT_REDUCTIONS, "%", "reductions") \
164 STATISTIC (on_the_fly_strengthened, 1, PCNT_CONFLICTS, "%", "of conflicts") \
165 STATISTIC (on_the_fly_subsumed, 1, PCNT_CONFLICTS, "%", "of conflicts") \
166 METRIC (probing_propagations, 1, PCNT_PROPS, "%", "propagations") \
167 COUNTER (probings, 2, CONF_INT, "", "interval") \
168 COUNTER (probing_ticks, 2, PCNT_TICKS, "%", "ticks") \
169 COUNTER (propagations, 0, PER_SECOND, "", "per second") \
170 STATISTIC (queue_decisions, 1, PCNT_DECISIONS, "%", "decision") \
171 STATISTIC (random_decisions, 1, PCNT_DECISIONS, "%", "decision") \
172 COUNTER (random_sequences, 2, CONF_INT, "", "interval") \
173 COUNTER (reductions, 1, CONF_INT, "", "interval") \
174 COUNTER (reordered, 1, CONF_INT, "", "interval") \
175 STATISTIC (reordered_focused, 1, PCNT_REORDERED, "%", "reordered") \
176 STATISTIC (reordered_stable, 1, PCNT_REORDERED, "%", "reordered") \
177 COUNTER (rephased, 1, CONF_INT, "", "interval") \
178 METRIC (rephased_best, 1, PCNT_REPHASED, "%", "rephased") \
179 METRIC (rephased_inverted, 1, PCNT_REPHASED, "%", "rephased") \
180 METRIC (rephased_original, 1, PCNT_REPHASED, "%", "rephased") \
181 METRIC (rephased_walking, 1, PCNT_REPHASED, "%", "rephased") \
182 METRIC (rescaled, 2, CONF_INT, "", "interval") \
183 COUNTER (restarts, 1, CONF_INT, "", "interval") \
184 STATISTIC (restarts_levels, 1, PER_RESTART, 0, "per restart") \
185 STATISTIC (restarts_reused_levels, 1, PCNT_RESTARTS_LEVELS, "%", "levels") \
186 STATISTIC (restarts_reused_trails, 1, PCNT_RESTARTS, "%", "restarts") \
187 COUNTER (retiered, 2, CONF_INT, "", "interval") \
188 METRIC (saved_decisions, 1, PCNT_DECISIONS, "%", "decisions") \
189 METRIC (score_decisions, 0, PCNT_DECISIONS, "%", "decision") \
190 COUNTER (searches, 2, CONF_INT, "", "interval") \
191 METRIC (search_propagations, 2, PCNT_PROPS, "%", "propagations") \
192 COUNTER (search_ticks, 2, PCNT_TICKS, "%", "ticks") \
193 METRIC (sparse_gcs, 2, PCNT_COLLECTIONS, "%", "collections") \
194 METRIC (stable_decisions, 1, PCNT_DECISIONS, "%", "decisions") \
195 METRIC (stable_modes, 2, CONF_INT, "", "interval") \
196 METRIC (stable_propagations, 1, PCNT_PROPS, "%", "propagations") \
197 METRIC (stable_restarts, 1, PCNT_RESTARTS, "%", "restarts") \
198 METRIC (stable_ticks, 2, PCNT_TICKS, "%", "ticks") \
199 COUNTER (strengthened, 1, PCNT_SUBSUMPTION_CHECK, "%", "checks") \
200 COUNTER (substituted, 1, PCNT_VARIABLES, "%", "variables") \
201 COUNTER (substitute_ticks, 2, PCNT_TICKS, "%", "ticks") \
202 STATISTIC (substitute_units, 1, PCNT_VARIABLES, "%", "variables") \
203 STATISTIC (substitutions, 2, CONF_INT, "", "interval") \
204 COUNTER (subsumed, 1, PCNT_SUBSUMPTION_CHECK, "%", "checks") \
205 COUNTER (subsumption_checks, 2, NO_SECONDARY, 0, 0) \
206 COUNTER (sweep, 2, CONF_INT, "", "interval") \
207 STATISTIC (sweep_clauses, 1, PER_SWEEP_VARIABLES, 0, "per sweep_variables") \
208 COUNTER (sweep_completed, 2, SWEEPS_PER_COMPLETED, 0, "sweeps") \
209 STATISTIC (sweep_depth, 1, PER_SWEEP_VARIABLES, 0, "per sweep_variables") \
210 STATISTIC (sweep_environment, 1, PER_SWEEP_VARIABLES, 0, "per sweep_variables") \
211 COUNTER (sweep_equivalences, 2, PCNT_VARIABLES, "%", "variables") \
212 STATISTIC (sweep_fixed_backbone, 1, PER_SWEEP_VARIABLES, 0, "per sweep_variables") \
213 STATISTIC (sweep_flip_backbone, 1, PER_SWEEP_VARIABLES, 0, "per sweep_variables") \
214 STATISTIC (sweep_flipped_backbone, 1, PCNT_SWEEP_FLIP_BACKBONE, "%", "sweep_flip_backbone") \
215 STATISTIC (sweep_flip_equivalences, 1, PER_SWEEP_VARIABLES, 0, "per sweep_variables") \
216 STATISTIC (sweep_flipped_equivalences, 1, PCNT_SWEEP_FLIP_EQUIVALENCES, "%", "sweep_flip_equivalences") \
217 STATISTIC (sweep_sat, 1, PCNT_SWEEP_SOLVED, "%", "sweep_solved") \
218 STATISTIC (sweep_sat_backbone, 1, PCNT_SWEEP_SOLVED_BACKBONE, "%", "sweep_solved_backbone") \
219 STATISTIC (sweep_sat_equivalences, 1, PCNT_SWEEP_SOLVED_EQUIVALENCES, "%", "sweep_solved_equivalences") \
220 COUNTER (sweep_solved, 2, PCNT_KITTEN_SOLVED, "%", "kitten_solved") \
221 STATISTIC (sweep_solved_backbone, 1, PCNT_SWEEP_SOLVED, "%", "sweep_solved") \
222 STATISTIC (sweep_solved_equivalences, 1, PCNT_SWEEP_SOLVED, "%", "sweep_solved") \
223 STATISTIC (sweep_unknown_backbone, 1, PCNT_SWEEP_SOLVED_BACKBONE, "%", "sweep_solved_backbone") \
224 STATISTIC (sweep_unknown_equivalences, 1, PCNT_SWEEP_SOLVED_EQUIVALENCES, "%", "sweep_solved_equivalences") \
225 COUNTER (sweep_units, 2, PCNT_VARIABLES, "%", "variables") \
226 STATISTIC (sweep_unsat, 1, PCNT_SWEEP_SOLVED, "%", "sweep_solved") \
227 STATISTIC (sweep_unsat_backbone, 1, PCNT_SWEEP_SOLVED_BACKBONE, "%", "sweep_solve_backbone") \
228 STATISTIC (sweep_unsat_equivalences, 1, PCNT_SWEEP_SOLVED_EQUIVALENCES, "%", "sweep_solve_equivalences") \
229 STATISTIC (sweep_variables, 1, PCNT_VARIABLES, "%", "variables") \
230 COUNTER (switched, 0, CONF_INT, "", "interval") \
231 METRIC (target_decisions, 1, PCNT_DECISIONS, "%", "decisions") \
232 METRIC (target_saved, 1, CONF_INT, "", "interval") \
233 STATISTIC (ticks, 2, PER_PROPAGATION, 0, "per prop") \
234 METRIC (transitive_probes, 2, PER_VARIABLE, "", "per variable") \
235 METRIC (transitive_propagations, 2, PCNT_PROPS, "%", "propagations") \
236 METRIC (transitive_reduced, 1, PCNT_CLS_ADDED, "%", "added") \
237 METRIC (transitive_reductions, 1, CONF_INT, "", "interval") \
238 COUNTER (transitive_ticks, 2, PCNT_TICKS, "%", "ticks") \
239 METRIC (transitive_units, 1, PCNT_VARIABLES, "%", "variables") \
240 COUNTER (units, 2, PCNT_VARIABLES, "%", "variables") \
241 COUNTER (variables_activated, 2, PER_VARIABLE, 0, "per variable") \
242 COUNTER (variables_eliminate, 2, PER_VARIABLE, 0, "variables") \
243 COUNTER (variables_extension, 2, PER_VARIABLE, 0, "per variable") \
244 COUNTER (variables_factor, 2, PER_VARIABLE, 0, "per variable") \
245 COUNTER (variables_original, 2, PER_VARIABLE, 0, "per variable") \
246 COUNTER (variables_subsume, 2, PER_VARIABLE, 0, "per variable") \
247 METRIC (vectors_defrags_needed, 1, PCNT_DEFRAGS, "%", "defrags") \
248 METRIC (vectors_enlarged, 2, CONF_INT, "", "interval") \
249 COUNTER (vivifications, 2, CONF_INT, "", "interval") \
250 COUNTER (vivified, 1, PCNT_VIVIFY_CHECK, "%", "checks") \
251 STATISTIC (vivified_asym, 1, PCNT_VIVIFIED, "%", "vivified") \
252 STATISTIC (vivified_implied, 1, PCNT_VIVIFIED, "%", "vivified") \
253 STATISTIC (vivified_instantiated, 1, PCNT_VIVIFIED, "%", "vivified") \
254 STATISTIC (vivified_instirr, 1, PCNT_VIVIFY_INST, "%", "instantiated") \
255 STATISTIC (vivified_instred, 1, PCNT_VIVIFY_INST, "%", "instantiated") \
256 STATISTIC (vivified_irredundant, 1, PCNT_VIVIFIED, "%", "vivified") \
257 STATISTIC (vivified_promoted, 1, PCNT_VIVIFIED, "%", "vivified") \
258 STATISTIC (vivified_shrunken, 1, PCNT_VIVIFIED, "%", "vivified") \
259 STATISTIC (vivified_shrunkirr, 1, PCNT_VIVIFY_SHRUNKEN, "%", "shrunken") \
260 STATISTIC (vivified_shrunkred, 1, PCNT_VIVIFY_SHRUNKEN, "%", "shrunken") \
261 STATISTIC (vivified_subirr, 1, PCNT_VIVIFY_SUB, "%", "subsumed") \
262 STATISTIC (vivified_subred, 1, PCNT_VIVIFY_SUB, "%", "subsumed") \
263 STATISTIC (vivified_subsumed, 1, PCNT_VIVIFIED, "%", "vivified") \
264 STATISTIC (vivified_tier1, 1, PCNT_VIVIFIED, "%", "vivified") \
265 STATISTIC (vivified_tier2, 1, PCNT_VIVIFIED, "%", "vivified") \
266 STATISTIC (vivified_tier3, 1, PCNT_VIVIFIED, "%", "vivified") \
267 STATISTIC (vivified_unlearn, 1, PCNT_VIVIFIED, "%", "vivified") \
268 COUNTER (vivify_checks, 2, PER_VIVIFICATION, "", "per vivify") \
269 COUNTER (vivify_probes, 2, PER_VIVIFY_CHECK, 0, "per check") \
270 STATISTIC (vivify_propagations, 2, PCNT_PROPS, "%", "propagations") \
271 COUNTER (vivify_reused, 2, PCNT_VIVIFY_PROBES, "%", "probes") \
272 STATISTIC (vivify_ticks, 2, PCNT_TICKS, "%", "ticks") \
273 STATISTIC (vivify_units, 1, PCNT_VARIABLES, "%", "variables") \
274 METRIC (walk_decisions, 1, PCNT_WALKS, "%", "walks") \
275 STATISTIC (walk_improved, 1, PCNT_WALKS, "%", "walks") \
276 METRIC (walk_previous, 1, PCNT_WALKS, "%", "walks") \
277 COUNTER (walks, 1, CONF_INT, "", "interval") \
278 COUNTER (walk_steps, 2, PER_FLIPPED, 0, "per flipped") \
279 STATISTIC (warming_conflicts, 1, PER_WALKS, 0, "per walk") \
280 COUNTER (warming_decisions, 2, PER_WALKS, 0, "per walk") \
281 COUNTER (warming_propagations, 2, PCNT_PROPS, "%", "propagations") \
282 COUNTER (warmups, 2, PCNT_WALKS, "%", "walks") \
283 METRIC (weakened, 1, PCNT_CLS_ADDED, "%", "added")
284
285// clang-format on
286
287/*------------------------------------------------------------------------*/
288#ifdef METRICS
289
290#define METRIC COUNTER
291#define STATISTIC COUNTER
292
293#ifndef STATISTICS
294#define STATISTICS
295#endif
296
297#elif STATISTICS
298
299#define METRIC IGNORE
300#define STATISTIC COUNTER
301
302#else
303
304#define METRIC IGNORE
305#define STATISTIC IGNORE
306
307#endif
308/*------------------------------------------------------------------------*/
309// clang-format off
310
311typedef struct statistics statistics;
312
313#define MAX_GLUE_USED 127
314
315struct statistics
316{
317#define COUNTER(NAME,VERBOSE,OTHER,UNITS,TYPE) \
318 uint64_t NAME;
319#define IGNORE(...)
320
322
323#undef COUNTER
324#undef IGNORE
325
326 struct {
327 uint64_t glue[MAX_GLUE_USED + 1];
328 } used[2];
329};
330
331// clang-format on
332/*------------------------------------------------------------------------*/
333
334#define CLAUSES (IRREDUNDANT_CLAUSES + BINARY_CLAUSES + REDUNDANT_CLAUSES)
335#define CONFLICTS (solver->statistics_.conflicts)
336#define DECISIONS (solver->statistics_.decisions)
337#define IRREDUNDANT_CLAUSES (solver->statistics_.clauses_irredundant)
338#define LEARNED_CLAUSES (solver->statistics_.learned)
339#define REDUNDANT_CLAUSES (solver->statistics_.clauses_redundant)
340#define BINARY_CLAUSES (solver->statistics_.clauses_binary)
341#define BINIRR_CLAUSES (BINARY_CLAUSES + IRREDUNDANT_CLAUSES)
342
343/*------------------------------------------------------------------------*/
344
345#define COUNTER(NAME, VERBOSE, OTHER, UNITS, TYPE) \
346\
347 static inline void kissat_inc_##NAME (statistics *statistics) { \
348 KISSAT_assert (statistics->NAME < UINT64_MAX); \
349 statistics->NAME++; \
350 } \
351\
352 static inline void kissat_dec_##NAME (statistics *statistics) { \
353 KISSAT_assert (statistics->NAME); \
354 statistics->NAME--; \
355 } \
356\
357 static inline void kissat_add_##NAME (statistics *statistics, \
358 uint64_t n) { \
359 KISSAT_assert (UINT64_MAX - n >= statistics->NAME); \
360 statistics->NAME += n; \
361 } \
362\
363 static inline void kissat_sub_##NAME (statistics *statistics, \
364 uint64_t n) { \
365 KISSAT_assert (n <= statistics->NAME); \
366 statistics->NAME -= n; \
367 } \
368\
369 static inline uint64_t kissat_get_##NAME (statistics *statistics) { \
370 return statistics->NAME; \
371 }
372
373/*------------------------------------------------------------------------*/
374
375#define IGNORE(NAME, VERBOSE, OTHER, UNITS, TYPE) \
376\
377 static inline void kissat_inc_##NAME (statistics *statistics) { \
378 (void) statistics; \
379 } \
380\
381 static inline void kissat_dec_##NAME (statistics *statistics) { \
382 (void) statistics; \
383 } \
384\
385 static inline void kissat_add_##NAME (statistics *statistics, \
386 uint64_t n) { \
387 (void) statistics; \
388 (void) n; \
389 } \
390\
391 static inline void kissat_sub_##NAME (statistics *statistics, \
392 uint64_t n) { \
393 (void) statistics; \
394 (void) n; \
395 } \
396 static inline uint64_t kissat_get_##NAME (statistics *statistics) { \
397 (void) statistics; \
398 return UINT64_MAX; \
399 }
400
401/*------------------------------------------------------------------------*/
402// clang-format off
403
405
406#undef COUNTER
407#undef IGNORE
408
409// clang-format on
410/*------------------------------------------------------------------------*/
411
412#define INC(NAME) kissat_inc_##NAME (&solver->statistics_)
413#define DEC(NAME) kissat_dec_##NAME (&solver->statistics_)
414#define ADD(NAME, N) kissat_add_##NAME (&solver->statistics_, (N))
415#define SUB(NAME, N) kissat_sub_##NAME (&solver->statistics_, (N))
416#define GET(NAME) kissat_get_##NAME (&solver->statistics_)
417
418/*------------------------------------------------------------------------*/
419#ifndef KISSAT_QUIET
420
421struct kissat;
422
423void kissat_statistics_print (struct kissat *, bool verbose);
424void kissat_print_glue_usage (struct kissat *);
425
426// Format widths of individual parts during printing statistics lines.
427// Shared between 'statistics.c' and 'resources.c' to align the printing.
428
429#define SFW1 "30"
430#define SFW2 "12"
431#define SFW3 "5"
432#define SFW4 "10"
433
434#define SFW34 "16" // SFE3 + space + SFE 4
435#define SFW34EXTENDED "19" // SFE3 + space + SFE 4 + ".2"
436
437#define PRINT_STAT(NAME, PRIMARY, SECONDARY, UNITS, TYPE) \
438 do { \
439 printf ("%s%-" SFW1 "s %" SFW2 PRIu64 " ", solver->prefix, NAME ":", \
440 (uint64_t) PRIMARY); \
441 const double SAVED_SECONDARY = (double) (SECONDARY); \
442 const char *SAVED_UNITS = (const char *) (UNITS); \
443 const char *SAVED_TYPE = (const char *) (TYPE); \
444 if (SAVED_TYPE && SAVED_SECONDARY >= 0) { \
445 if (SAVED_UNITS) \
446 printf ("%" SFW34 ".0f %-2s", SAVED_SECONDARY, SAVED_UNITS); \
447 else \
448 printf ("%" SFW34EXTENDED ".2f", SAVED_SECONDARY); \
449 fputc (' ', stdout); \
450 fputs (SAVED_TYPE, stdout); \
451 } \
452 fputc ('\n', stdout); \
453 } while (0)
454
455#endif
456
457#ifndef KISSAT_NDEBUG
458
459struct kissat;
460void kissat_check_statistics (struct kissat *);
461
462#else
463
464#define kissat_check_statistics(...) \
465 do { \
466 } while (0)
467
468#endif
469
471
472#endif
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
#define METRICS_COUNTERS_AND_STATISTICS
Definition statistics.h:12
#define kissat_check_statistics(...)
Definition statistics.h:464
#define MAX_GLUE_USED
Definition statistics.h:313
METRICS_COUNTERS_AND_STATISTICS struct statistics::@210323365176300370122154220272050204040253242144 used[2]
uint64_t glue[MAX_GLUE_USED+1]
Definition statistics.h:327