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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
/********************* */
/*! \file preprocess_proof_generator.h
** \verbatim
** Top contributors (to current version):
** 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 The module for proofs for preprocessing in an SMT engine.
**/
#include "cvc4_private.h"
#ifndef CVC4__SMT__PREPROCESS_PROOF_GENERATOR_H
#define CVC4__SMT__PREPROCESS_PROOF_GENERATOR_H
#include <map>
#include "expr/proof_generator.h"
#include "expr/proof_node_manager.h"
#include "theory/trust_node.h"
namespace CVC4 {
namespace smt {
/**
* A proof generator storing proofs of preprocessing. This has two main
* interfaces during solving:
* (1) notifyNewAssert, for assertions that are not part of the input and are
* added by preprocessing passes,
* (2) notifyPreprocessed, which is called when a preprocessing pass rewrites
* an assertion into another.
* Notice that input assertions do not need to be provided to this class.
*
* Its getProofFor method produces a proof for a preprocessed assertion
* whose free assumptions are intended to be input assertions, which are
* implictly all assertions that are not notified to this class.
*/
class PreprocessProofGenerator : public ProofGenerator
{
public:
PreprocessProofGenerator(ProofNodeManager* pnm);
~PreprocessProofGenerator() {}
/**
* Notify that n is a new assertion, where pg can provide a proof of n.
*/
void notifyNewAssert(Node n, ProofGenerator* pg);
/**
* Notify that n was replaced by np due to preprocessing, where pg can
* provide a proof of the equality n=np.
*/
void notifyPreprocessed(Node n, Node np, ProofGenerator* pg);
/**
* Get proof for f, which returns a proof based on proving an equality based
* on transitivity of preprocessing steps, and then using the original
* assertion with EQ_RESOLVE to obtain the proof of the ending assertion f.
*/
std::shared_ptr<ProofNode> getProofFor(Node f) override;
/** Identify */
std::string identify() const override;
private:
/** The proof node manager */
ProofNodeManager* d_pnm;
/**
* The trust node that was the source of each node constructed during
* preprocessing. For each n, d_src[n] is a trust node whose node is n. This
* can either be:
* (1) A trust node REWRITE proving (n_src = n) for some n_src, or
* (2) A trust node LEMMA proving n.
*/
std::map<Node, theory::TrustNode> d_src;
};
} // namespace smt
} // namespace CVC4
#endif
|