blob: 15ae6ea8373c3b170e4024760de9666d4c903821 (
plain)
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
|
/********************* */
/*! \file buffered_proof_generator.h
** \verbatim
** Top contributors (to current version):
** Haniel Barbosa, Andrew Reynolds
** This file is part of the CVC4 project.
** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS
** in the top-level source directory and their institutional affiliations.
** All rights reserved. See the file COPYING in the top-level source
** directory for licensing information.\endverbatim
**
** \brief A proof generator for buffered proof steps
**/
#include "cvc4_private.h"
#ifndef CVC4__EXPR__BUFFERED_PROOF_GENERATOR_H
#define CVC4__EXPR__BUFFERED_PROOF_GENERATOR_H
#include "context/cdhashmap.h"
#include "expr/proof_generator.h"
namespace CVC4 {
class ProofNodeManager;
class ProofStep;
/**
* The proof generator for buffered steps. This class is a context-dependent
* mapping from formulas to proof steps. It does not generate ProofNodes until it
* is asked to provide a proof for a given fact.
*/
class BufferedProofGenerator : public ProofGenerator
{
typedef context::CDHashMap<Node, std::shared_ptr<ProofStep>, NodeHashFunction>
NodeProofStepMap;
public:
BufferedProofGenerator(context::Context* c, ProofNodeManager* pnm);
~BufferedProofGenerator() {}
/** add step
* Unless the overwrite policy is ALWAYS it does not replace previously
* registered steps (modulo (dis)equality symmetry).
*/
bool addStep(Node fact,
ProofStep ps,
CDPOverwrite opolicy = CDPOverwrite::NEVER);
/** Get proof for. It is robust to (dis)equality symmetry. */
std::shared_ptr<ProofNode> getProofFor(Node f) override;
/** identify */
std::string identify() const override { return "BufferedProofGenerator"; }
private:
/** maps expected to ProofStep */
NodeProofStepMap d_facts;
/** the proof node manager */
ProofNodeManager* d_pnm;
};
} // namespace CVC4
#endif /* CVC4__EXPR__BUFFERED_PROOF_GENERATOR_H */
|