1 |
|
/****************************************************************************** |
2 |
|
* Top contributors (to current version): |
3 |
|
* Andrew Reynolds, Aina Niemetz, 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 |
|
* Non-clausal simplification preprocessing pass. |
14 |
|
*/ |
15 |
|
|
16 |
|
#include "cvc5_private.h" |
17 |
|
|
18 |
|
#ifndef CVC5__PREPROCESSING__PASSES__NON_CLAUSAL_SIMP_H |
19 |
|
#define CVC5__PREPROCESSING__PASSES__NON_CLAUSAL_SIMP_H |
20 |
|
|
21 |
|
#include "context/cdlist.h" |
22 |
|
#include "expr/node.h" |
23 |
|
#include "preprocessing/preprocessing_pass.h" |
24 |
|
#include "proof/trust_node.h" |
25 |
|
|
26 |
|
namespace cvc5 { |
27 |
|
|
28 |
|
class LazyCDProof; |
29 |
|
class ProofNodeManager; |
30 |
|
|
31 |
|
namespace smt { |
32 |
|
class PreprocessProofGenerator; |
33 |
|
} |
34 |
|
namespace theory { |
35 |
|
class TrustSubstitutionMap; |
36 |
|
} |
37 |
|
|
38 |
|
namespace preprocessing { |
39 |
|
namespace passes { |
40 |
|
|
41 |
19706 |
class NonClausalSimp : public PreprocessingPass |
42 |
|
{ |
43 |
|
public: |
44 |
|
NonClausalSimp(PreprocessingPassContext* preprocContext); |
45 |
|
|
46 |
|
protected: |
47 |
|
PreprocessingPassResult applyInternal( |
48 |
|
AssertionPipeline* assertionsToPreprocess) override; |
49 |
|
|
50 |
|
private: |
51 |
|
struct Statistics |
52 |
|
{ |
53 |
|
IntStat d_numConstantProps; |
54 |
|
Statistics(); |
55 |
|
}; |
56 |
|
|
57 |
|
Statistics d_statistics; |
58 |
|
/** |
59 |
|
* Transform learned literal lit. We apply substitutions in subs once and then |
60 |
|
* apply constant propagations cp to fixed point. Return the rewritten |
61 |
|
* form of lit. |
62 |
|
* |
63 |
|
* If proofs are enabled, then we require that the learned literal preprocess |
64 |
|
* proof generator (d_llpg) has a proof of lit when this method is called, |
65 |
|
* and ensure that the return literal also has a proof in d_llpg. |
66 |
|
*/ |
67 |
|
Node processLearnedLit(Node lit, |
68 |
|
theory::TrustSubstitutionMap* subs, |
69 |
|
theory::TrustSubstitutionMap* cp); |
70 |
|
/** |
71 |
|
* Process rewritten learned literal. This is called when we have a |
72 |
|
* learned literal lit that is rewritten to litr based on the proof generator |
73 |
|
* contained in trn (if it exists). The trust node trn should be of kind |
74 |
|
* REWRITE and proving (= lit litr). |
75 |
|
* |
76 |
|
* This tracks the proof in the learned literal preprocess proof generator |
77 |
|
* d_llpg below and returns the rewritten learned literal. |
78 |
|
*/ |
79 |
|
Node processRewrittenLearnedLit(TrustNode trn); |
80 |
|
/** Is proof enabled? */ |
81 |
|
bool isProofEnabled() const; |
82 |
|
/** The proof node manager */ |
83 |
|
ProofNodeManager* d_pnm; |
84 |
|
/** the learned literal preprocess proof generator */ |
85 |
|
std::unique_ptr<smt::PreprocessProofGenerator> d_llpg; |
86 |
|
/** |
87 |
|
* An lazy proof for learned literals that are reasserted into the assertions |
88 |
|
* pipeline by this class. |
89 |
|
*/ |
90 |
|
std::unique_ptr<LazyCDProof> d_llra; |
91 |
|
/** |
92 |
|
* A context-dependent list of trust substitution maps, which are required |
93 |
|
* for storing proofs. |
94 |
|
*/ |
95 |
|
context::CDList<std::shared_ptr<theory::TrustSubstitutionMap> > d_tsubsList; |
96 |
|
}; |
97 |
|
|
98 |
|
} // namespace passes |
99 |
|
} // namespace preprocessing |
100 |
|
} // namespace cvc5 |
101 |
|
|
102 |
|
#endif |