GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/expr/emptyset.cpp Lines: 9 21 42.9 %
Date: 2021-03-22 Branches: 7 16 43.8 %

Line Exec Source
1
/*********************                                                        */
2
/*! \file emptyset.cpp
3
 ** \verbatim
4
 ** Top contributors (to current version):
5
 **   Tim King, Kshitij Bansal, Andres Noetzli
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 [[ Add one-line brief description here ]]
13
 **
14
 ** [[ Add lengthier description here ]]
15
 ** \todo document this file
16
 **/
17
18
#include "expr/emptyset.h"
19
20
#include <iostream>
21
22
#include "expr/type_node.h"
23
24
namespace CVC4 {
25
26
std::ostream& operator<<(std::ostream& out, const EmptySet& asa) {
27
  return out << "emptyset(" << asa.getType() << ')';
28
}
29
30
9526
size_t EmptySetHashFunction::operator()(const EmptySet& es) const {
31
9526
  return TypeNodeHashFunction()(es.getType());
32
}
33
34
/**
35
 * Constructs an emptyset of the specified type. Note that the argument
36
 * is the type of the set itself, NOT the type of the elements.
37
 */
38
2690
EmptySet::EmptySet(const TypeNode& setType) : d_type(new TypeNode(setType)) {}
39
40
3405
EmptySet::EmptySet(const EmptySet& es) : d_type(new TypeNode(es.getType())) {}
41
42
EmptySet& EmptySet::operator=(const EmptySet& es) {
43
  (*d_type) = es.getType();
44
  return *this;
45
}
46
47
6089
EmptySet::~EmptySet() {}
48
23412
const TypeNode& EmptySet::getType() const { return *d_type; }
49
4390
bool EmptySet::operator==(const EmptySet& es) const
50
{
51
4390
  return getType() == es.getType();
52
}
53
54
bool EmptySet::operator!=(const EmptySet& es) const { return !(*this == es); }
55
bool EmptySet::operator<(const EmptySet& es) const
56
{
57
  return getType() < es.getType();
58
}
59
60
bool EmptySet::operator<=(const EmptySet& es) const
61
{
62
  return getType() <= es.getType();
63
}
64
65
bool EmptySet::operator>(const EmptySet& es) const { return !(*this <= es); }
66
bool EmptySet::operator>=(const EmptySet& es) const { return !(*this < es); }
67
26676
}/* CVC4 namespace */