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