1 /********************* */
2 /*! \file proof_manager.h
4 ** Top contributors (to current version):
6 ** This file is part of the CVC4 project.
7 ** Copyright (c) 2009-2020 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.\endverbatim
12 ** \brief The proof manager of SmtEngine
15 #include "cvc4_private.h"
17 #ifndef CVC4__SMT__PROOF_MANAGER_H
18 #define CVC4__SMT__PROOF_MANAGER_H
20 #include "context/cdhashmap.h"
21 #include "context/cdlist.h"
22 #include "expr/node.h"
23 #include "expr/proof_checker.h"
24 #include "expr/proof_node.h"
25 #include "expr/proof_node_manager.h"
26 #include "smt/preprocess_proof_generator.h"
27 #include "smt/proof_post_processor.h"
36 class DefinedFunction
;
39 * This class is responsible for managing the proof output of SmtEngine, as
40 * well as setting up the global proof checker and proof node manager.
44 /** The type of our internal map of defined functions */
45 using DefinedFunctionMap
=
46 context::CDHashMap
<Node
, smt::DefinedFunction
, NodeHashFunction
>;
49 PfManager(context::UserContext
* u
, SmtEngine
* smte
);
52 * Print the proof on the output channel of the current options in scope.
54 * The argument pfn is the proof for false in the current context.
56 * Throws an assertion failure if pg cannot provide a closed proof with
57 * respect to assertions in as and df. For the latter, entries in the defined
58 * function map correspond to equalities of the form (= f (lambda (...) t)),
59 * which are considered assertions in the final proof.
61 void printProof(std::shared_ptr
<ProofNode
> pfn
,
63 DefinedFunctionMap
& df
);
65 * Check proof, same as above, without printing.
67 void checkProof(std::shared_ptr
<ProofNode
> pfn
,
69 DefinedFunctionMap
& df
);
74 * The argument pfn is the proof for false in the current context.
76 std::shared_ptr
<ProofNode
> getFinalProof(std::shared_ptr
<ProofNode
> pfn
,
78 DefinedFunctionMap
& df
);
79 //--------------------------- access to utilities
80 /** Get a pointer to the ProofChecker owned by this. */
81 ProofChecker
* getProofChecker() const;
82 /** Get a pointer to the ProofNodeManager owned by this. */
83 ProofNodeManager
* getProofNodeManager() const;
84 /** Get the proof generator for proofs of preprocessing. */
85 smt::PreprocessProofGenerator
* getPreprocessProofGenerator() const;
86 //--------------------------- end access to utilities
89 * Set final proof, which initializes d_finalProof to the given proof node of
90 * false, postprocesses it, and stores it in d_finalProof.
92 void setFinalProof(std::shared_ptr
<ProofNode
> pfn
,
94 DefinedFunctionMap
& df
);
96 * Get assertions from the assertions
98 void getAssertions(Assertions
& as
,
99 DefinedFunctionMap
& df
,
100 std::vector
<Node
>& assertions
);
101 /** The false node */
103 /** For the new proofs module */
104 std::unique_ptr
<ProofChecker
> d_pchecker
;
105 /** A proof node manager based on the above checker */
106 std::unique_ptr
<ProofNodeManager
> d_pnm
;
107 /** The preprocess proof generator. */
108 std::unique_ptr
<smt::PreprocessProofGenerator
> d_pppg
;
109 /** The proof post-processor */
110 std::unique_ptr
<smt::ProofPostproccess
> d_pfpp
;
112 * The final proof produced by the SMT engine.
113 * Combines the proofs of preprocessing, prop engine and theory engine, to be
114 * connected by setFinalProof().
116 std::shared_ptr
<ProofNode
> d_finalProof
;
117 }; /* class SmtEngine */
122 #endif /* CVC4__SMT__PROOF_MANAGER_H */