GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/preprocessing/passes/nl_ext_purify.h Lines: 1 1 100.0 %
Date: 2021-03-22 Branches: 0 0 0.0 %

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