GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/bags/make_bag_op.h Lines: 1 1 100.0 %
Date: 2021-03-23 Branches: 0 0 0.0 %

Line Exec Source
1
/*********************                                                        */
2
/*! \file make_bag_op.h
3
 ** \verbatim
4
 ** Top contributors (to current version):
5
 **   Mudathir Mohamed
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 a class for MK_BAG operator
13
 **/
14
15
#include "cvc4_public.h"
16
17
#ifndef CVC4__MAKE_BAG_OP_H
18
#define CVC4__MAKE_BAG_OP_H
19
20
#include <memory>
21
22
namespace CVC4 {
23
24
class TypeNode;
25
26
/**
27
 * The class is an operator for kind MK_BAG used to construct bags.
28
 * It specifies the type of the element especially when it is a constant.
29
 * e.g. the type of rational 1 is Int, however
30
 * (mkBag (mkBag_op Real) 1) is of type (Bag Real), not (Bag Int).
31
 * Note that the type passed to the constructor is the element's type, not the
32
 * bag type.
33
 */
34
666
class MakeBagOp
35
{
36
 public:
37
  explicit MakeBagOp(const TypeNode& elementType);
38
  MakeBagOp(const MakeBagOp& op);
39
40
  /** return the type of the current object */
41
  const TypeNode& getType() const;
42
43
  bool operator==(const MakeBagOp& op) const;
44
45
 private:
46
  /** a pointer to the type of the bag element */
47
  std::unique_ptr<TypeNode> d_type;
48
}; /* class MakeBagOp */
49
50
std::ostream& operator<<(std::ostream& out, const MakeBagOp& op);
51
52
/**
53
 * Hash function for the MakeBagOpHashFunction objects.
54
 */
55
struct MakeBagOpHashFunction
56
{
57
  size_t operator()(const MakeBagOp& op) const;
58
}; /* struct MakeBagOpHashFunction */
59
60
}  // namespace CVC4
61
62
#endif /* CVC4__MAKE_BAG_OP_H */