1 /********************* */
2 /*! \file theory_engine.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 theory engine proof generator
15 #include "cvc4_private.h"
17 #ifndef CVC4__THEORY_ENGINE_PROOF_GENERATOR_H
18 #define CVC4__THEORY_ENGINE_PROOF_GENERATOR_H
22 #include "context/cdhashmap.h"
23 #include "context/context.h"
24 #include "expr/lazy_proof.h"
25 #include "expr/proof_generator.h"
26 #include "expr/proof_node_manager.h"
27 #include "theory/trust_node.h"
32 * A simple proof generator class used by the theory engine. This class
33 * stores proofs for TheoryEngine::getExplanation.
35 * Notice that this class could be made general purpose. Its main feature is
36 * storing lazy proofs for facts in a context-dependent manner.
38 class TheoryEngineProofGenerator
: public ProofGenerator
41 CDHashMap
<Node
, std::shared_ptr
<LazyCDProof
>, NodeHashFunction
>
45 TheoryEngineProofGenerator(ProofNodeManager
* pnm
, context::UserContext
* u
);
46 ~TheoryEngineProofGenerator() {}
48 * Make trust explanation. Called when lpf has a proof of lit from free
51 * This stores lpf in the map d_proofs below and returns the trust node for
52 * this propagation, which has TrustNodeKind TrustNodeKind::PROP_EXP. If this
53 * explanation already exists, then the previous explanation is taken, which
54 * also suffices for proving the implication.
56 theory::TrustNode
mkTrustExplain(TNode lit
,
58 std::shared_ptr
<LazyCDProof
> lpf
);
60 * Get proof for, which expects implications corresponding to explained
61 * propagations (=> exp lit) registered by the above method. This currently
62 * involves calling the mkScope method of ProofNodeManager internally, which
63 * returns a closed proof.
65 std::shared_ptr
<ProofNode
> getProofFor(Node f
) override
;
66 /** Identify this generator (for debugging, etc..) */
67 std::string
identify() const override
;
70 /** The proof manager, used for allocating new ProofNode objects */
71 ProofNodeManager
* d_pnm
;
72 /** Map from formulas to lazy CD proofs */
73 NodeLazyCDProofMap d_proofs
;
78 #endif /* CVC4__THEORY_ENGINE_PROOF_GENERATOR_H */