GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/smt/defined_function.h Lines: 6 7 85.7 %
Date: 2021-03-23 Branches: 4 10 40.0 %

Line Exec Source
1
/*********************                                                        */
2
/*! \file defined_function.h
3
 ** \verbatim
4
 ** Top contributors (to current version):
5
 **   Andrew Reynolds, Morgan Deters
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 Defined function data structure
13
 **/
14
15
#include "cvc4_private.h"
16
17
#ifndef CVC4__SMT__DEFINED_FUNCTION_H
18
#define CVC4__SMT__DEFINED_FUNCTION_H
19
20
#include <vector>
21
22
#include "expr/node.h"
23
24
namespace CVC4 {
25
namespace smt {
26
27
/**
28
 * Representation of a defined function.  We keep these around in
29
 * SmtEngine to permit expanding definitions late (and lazily), to
30
 * support getValue() over defined functions, to support user output
31
 * in terms of defined functions, etc.
32
 */
33
22078
class DefinedFunction
34
{
35
 public:
36
  DefinedFunction() {}
37
2700
  DefinedFunction(Node func, const std::vector<Node>& formals, Node formula)
38
2700
      : d_func(func), d_formals(formals), d_formula(formula)
39
  {
40
2700
  }
41
  /** get the function */
42
  Node getFunction() const { return d_func; }
43
  /** get the formal argument list of the function */
44
6260
  const std::vector<Node>& getFormals() const { return d_formals; }
45
  /** get the formula that defines it */
46
6260
  Node getFormula() const { return d_formula; }
47
48
 private:
49
  /** the function */
50
  Node d_func;
51
  /** the formal argument list */
52
  std::vector<Node> d_formals;
53
  /** the formula */
54
  Node d_formula;
55
}; /* class DefinedFunction */
56
57
}  // namespace smt
58
}  // namespace CVC4
59
60
#endif /* CVC4__SMT__DEFINED_FUNCTION_H */