GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/sets/singleton_op.cpp Lines: 12 14 85.7 %
Date: 2021-03-22 Branches: 7 16 43.8 %

Line Exec Source
1
/*********************                                                        */
2
/*! \file singleton_op.cpp
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 "singleton_op.h"
16
17
#include <iostream>
18
19
#include "expr/type_node.h"
20
21
namespace CVC4 {
22
23
std::ostream& operator<<(std::ostream& out, const SingletonOp& op)
24
{
25
  return out << "(singleton_op " << op.getType() << ')';
26
}
27
28
14550
size_t SingletonOpHashFunction::operator()(const SingletonOp& op) const
29
{
30
14550
  return TypeNodeHashFunction()(op.getType());
31
}
32
33
12238
SingletonOp::SingletonOp(const TypeNode& elementType)
34
12238
    : d_type(new TypeNode(elementType))
35
{
36
12238
}
37
38
4362
SingletonOp::SingletonOp(const SingletonOp& op)
39
4362
    : d_type(new TypeNode(op.getType()))
40
{
41
4362
}
42
43
48328
const TypeNode& SingletonOp::getType() const { return *d_type; }
44
45
12816
bool SingletonOp::operator==(const SingletonOp& op) const
46
{
47
12816
  return getType() == op.getType();
48
}
49
50
26676
}  // namespace CVC4