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

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