1 |
|
/****************************************************************************** |
2 |
|
* Top contributors (to current version): |
3 |
|
* Mudathir Mohamed |
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 singleton operator for sets. |
14 |
|
*/ |
15 |
|
|
16 |
|
#include "singleton_op.h" |
17 |
|
|
18 |
|
#include <iostream> |
19 |
|
|
20 |
|
#include "expr/type_node.h" |
21 |
|
|
22 |
|
namespace cvc5 { |
23 |
|
|
24 |
|
std::ostream& operator<<(std::ostream& out, const SingletonOp& op) |
25 |
|
{ |
26 |
|
return out << "(singleton_op " << op.getType() << ')'; |
27 |
|
} |
28 |
|
|
29 |
12677 |
size_t SingletonOpHashFunction::operator()(const SingletonOp& op) const |
30 |
|
{ |
31 |
12677 |
return std::hash<TypeNode>()(op.getType()); |
32 |
|
} |
33 |
|
|
34 |
10313 |
SingletonOp::SingletonOp(const TypeNode& elementType) |
35 |
10313 |
: d_type(new TypeNode(elementType)) |
36 |
|
{ |
37 |
10313 |
} |
38 |
|
|
39 |
4018 |
SingletonOp::SingletonOp(const SingletonOp& op) |
40 |
4018 |
: d_type(new TypeNode(op.getType())) |
41 |
|
{ |
42 |
4018 |
} |
43 |
|
|
44 |
41930 |
const TypeNode& SingletonOp::getType() const { return *d_type; } |
45 |
|
|
46 |
10904 |
bool SingletonOp::operator==(const SingletonOp& op) const |
47 |
|
{ |
48 |
10904 |
return getType() == op.getType(); |
49 |
|
} |
50 |
|
|
51 |
28191 |
} // namespace cvc5 |