1 |
|
/****************************************************************************** |
2 |
|
* Top contributors (to current version): |
3 |
|
* Haniel Barbosa, Mathias Preiner |
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 |
|
* The NlExtPurify preprocessing pass. |
14 |
|
* |
15 |
|
* Purifies non-linear terms by replacing sums under multiplications by fresh |
16 |
|
* variables. |
17 |
|
*/ |
18 |
|
|
19 |
|
#include "cvc5_private.h" |
20 |
|
|
21 |
|
#ifndef CVC5__PREPROCESSING__PASSES__NL_EXT_PURIFY_H |
22 |
|
#define CVC5__PREPROCESSING__PASSES__NL_EXT_PURIFY_H |
23 |
|
|
24 |
|
#include <unordered_map> |
25 |
|
#include <vector> |
26 |
|
|
27 |
|
#include "expr/node.h" |
28 |
|
#include "preprocessing/preprocessing_pass.h" |
29 |
|
|
30 |
|
namespace cvc5 { |
31 |
|
namespace preprocessing { |
32 |
|
namespace passes { |
33 |
|
|
34 |
|
using NodeMap = std::unordered_map<Node, Node>; |
35 |
|
|
36 |
19824 |
class NlExtPurify : public PreprocessingPass |
37 |
|
{ |
38 |
|
public: |
39 |
|
NlExtPurify(PreprocessingPassContext* preprocContext); |
40 |
|
|
41 |
|
protected: |
42 |
|
PreprocessingPassResult applyInternal( |
43 |
|
AssertionPipeline* assertionsToPreprocess) override; |
44 |
|
|
45 |
|
private: |
46 |
|
Node purifyNlTerms(TNode n, |
47 |
|
NodeMap& cache, |
48 |
|
NodeMap& bcache, |
49 |
|
std::vector<Node>& var_eq, |
50 |
|
bool beneathMult = false); |
51 |
|
}; |
52 |
|
|
53 |
|
} // namespace passes |
54 |
|
} // namespace preprocessing |
55 |
|
} // namespace cvc5 |
56 |
|
|
57 |
|
#endif /* CVC5__PREPROCESSING__PASSES__NL_EXT_PURIFY_H */ |