GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/uf/theory_uf_rewriter.h Lines: 1 1 100.0 %
Date: 2021-05-22 Branches: 0 12 0.0 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Andrew Reynolds, Haniel Barbosa, Dejan Jovanovic
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
 * [[ Add one-line brief description here ]]
14
 *
15
 * [[ Add lengthier description here ]]
16
 * \todo document this file
17
 */
18
19
#include "cvc5_private.h"
20
21
#ifndef CVC5__THEORY__UF__THEORY_UF_REWRITER_H
22
#define CVC5__THEORY__UF__THEORY_UF_REWRITER_H
23
24
#include "expr/node_algorithm.h"
25
#include "options/uf_options.h"
26
#include "theory/rewriter.h"
27
#include "theory/substitutions.h"
28
#include "theory/theory_rewriter.h"
29
30
namespace cvc5 {
31
namespace theory {
32
namespace uf {
33
34
18920
class TheoryUfRewriter : public TheoryRewriter
35
{
36
 public:
37
  RewriteResponse postRewrite(TNode node) override;
38
39
  RewriteResponse preRewrite(TNode node) override;
40
41
 public:  // conversion between HO_APPLY AND APPLY_UF
42
  // converts an APPLY_UF to a curried HO_APPLY e.g. (f a b) becomes (@ (@ f a)
43
  // b)
44
  static Node getHoApplyForApplyUf(TNode n);
45
  // converts a curried HO_APPLY into an APPLY_UF e.g. (@ (@ f a) b) becomes (f a b)
46
  static Node getApplyUfForHoApply(TNode n);
47
  /**
48
   * Given a curried HO_APPLY term n, this method adds its arguments into args
49
   * and returns its operator. If the argument opInArgs is true, then we add
50
   * its operator to args.
51
   */
52
  static Node decomposeHoApply(TNode n,
53
                               std::vector<TNode>& args,
54
                               bool opInArgs = false);
55
  /** returns true if this node can be used as an operator of an APPLY_UF node.  In higher-order logic,
56
   * terms can have function types and not just variables.
57
   * Currently, we want only free variables to be used as operators of APPLY_UF nodes. This is motivated by
58
   * E-matching, ite-lifting among other things.  For example:
59
   * f: Int -> Int, g : Int -> Int
60
   * forall x : ( Int -> Int ), y : Int. (x y) = (f 0)
61
   * Then, f and g can be used as APPLY_UF operators, but (ite C f g), (lambda x1. (f x1)) as well as the variable x above are not.
62
   */
63
  static bool canUseAsApplyUfOperator(TNode n);
64
}; /* class TheoryUfRewriter */
65
66
}  // namespace uf
67
}  // namespace theory
68
}  // namespace cvc5
69
70
#endif /* CVC5__THEORY__UF__THEORY_UF_REWRITER_H */