1 |
|
/****************************************************************************** |
2 |
|
* Top contributors (to current version): |
3 |
|
* Andrew Reynolds, Haniel Barbosa, Gereon Kremer |
4 |
|
* |
5 |
|
* This file is part of the cvc5 project. |
6 |
|
* |
7 |
|
* Copyright (c) 2009-2021 by the authors listed in the file AUTHORS |
8 |
|
* in the top-level source directory and their institutional affiliations. |
9 |
|
* All rights reserved. See the file COPYING in the top-level source |
10 |
|
* directory for licensing information. |
11 |
|
* **************************************************************************** |
12 |
|
* |
13 |
|
* The module for final processing proof nodes. |
14 |
|
*/ |
15 |
|
|
16 |
|
#include "cvc5_private.h" |
17 |
|
|
18 |
|
#ifndef CVC5__SMT__PROOF_FINAL_CALLBACK_H |
19 |
|
#define CVC5__SMT__PROOF_FINAL_CALLBACK_H |
20 |
|
|
21 |
|
#include <map> |
22 |
|
#include <sstream> |
23 |
|
#include <unordered_set> |
24 |
|
|
25 |
|
#include "proof/proof_node_updater.h" |
26 |
|
#include "theory/inference_id.h" |
27 |
|
#include "util/statistics_stats.h" |
28 |
|
|
29 |
|
namespace cvc5 { |
30 |
|
namespace smt { |
31 |
|
|
32 |
|
/** Final callback class, for stats and pedantic checking */ |
33 |
3796 |
class ProofFinalCallback : public ProofNodeUpdaterCallback |
34 |
|
{ |
35 |
|
public: |
36 |
|
ProofFinalCallback(ProofNodeManager* pnm); |
37 |
|
/** |
38 |
|
* Initialize, called once for each new ProofNode to process. This initializes |
39 |
|
* static information to be used by successive calls to update. |
40 |
|
*/ |
41 |
|
void initializeUpdate(); |
42 |
|
/** Should proof pn be updated? Returns false, adds to stats. */ |
43 |
|
bool shouldUpdate(std::shared_ptr<ProofNode> pn, |
44 |
|
const std::vector<Node>& fa, |
45 |
|
bool& continueUpdate) override; |
46 |
|
/** was pedantic failure */ |
47 |
|
bool wasPedanticFailure(std::ostream& out) const; |
48 |
|
|
49 |
|
private: |
50 |
|
/** Counts number of postprocessed proof nodes for each kind of proof rule */ |
51 |
|
HistogramStat<PfRule> d_ruleCount; |
52 |
|
/** |
53 |
|
* Counts number of postprocessed proof nodes of rule INSTANTIATE that were |
54 |
|
* marked with the given inference id. |
55 |
|
*/ |
56 |
|
HistogramStat<theory::InferenceId> d_instRuleIds; |
57 |
|
/** Total number of postprocessed rule applications */ |
58 |
|
IntStat d_totalRuleCount; |
59 |
|
/** The minimum pedantic level of any rule encountered */ |
60 |
|
IntStat d_minPedanticLevel; |
61 |
|
/** The total number of final proofs */ |
62 |
|
IntStat d_numFinalProofs; |
63 |
|
/** Proof node manager (used for pedantic checking) */ |
64 |
|
ProofNodeManager* d_pnm; |
65 |
|
/** Was there a pedantic failure? */ |
66 |
|
bool d_pedanticFailure; |
67 |
|
/** The pedantic failure string for debugging */ |
68 |
|
std::stringstream d_pedanticFailureOut; |
69 |
|
}; |
70 |
|
|
71 |
|
} // namespace smt |
72 |
|
} // namespace cvc5 |
73 |
|
|
74 |
|
#endif |