summaryrefslogtreecommitdiff
path: root/src/theory/bags/make_bag_op.h
blob: 33de51ed70eba6bbc30eb863d8a4377600ef42a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*********************                                                        */
/*! \file make_bag_op.h
 ** \verbatim
 ** Top contributors (to current version):
 **   Mudathir Mohamed
 ** This file is part of the CVC4 project.
 ** Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
 ** in the top-level source directory and their institutional affiliations.
 ** All rights reserved.  See the file COPYING in the top-level source
 ** directory for licensing information.\endverbatim
 **
 ** \brief a class for MK_BAG operator
 **/

#include "cvc4_public.h"

#ifndef CVC5__MAKE_BAG_OP_H
#define CVC5__MAKE_BAG_OP_H

#include <memory>

namespace cvc5 {

class TypeNode;

/**
 * The class is an operator for kind MK_BAG used to construct bags.
 * It specifies the type of the element especially when it is a constant.
 * e.g. the type of rational 1 is Int, however
 * (mkBag (mkBag_op Real) 1) is of type (Bag Real), not (Bag Int).
 * Note that the type passed to the constructor is the element's type, not the
 * bag type.
 */
class MakeBagOp
{
 public:
  explicit MakeBagOp(const TypeNode& elementType);
  MakeBagOp(const MakeBagOp& op);

  /** return the type of the current object */
  const TypeNode& getType() const;

  bool operator==(const MakeBagOp& op) const;

 private:
  /** a pointer to the type of the bag element */
  std::unique_ptr<TypeNode> d_type;
}; /* class MakeBagOp */

std::ostream& operator<<(std::ostream& out, const MakeBagOp& op);

/**
 * Hash function for the MakeBagOpHashFunction objects.
 */
struct MakeBagOpHashFunction
{
  size_t operator()(const MakeBagOp& op) const;
}; /* struct MakeBagOpHashFunction */

}  // namespace cvc5

#endif /* CVC5__MAKE_BAG_OP_H */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback