GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/expr/ascription_type.cpp Lines: 11 19 57.9 %
Date: 2021-03-22 Branches: 7 22 31.8 %

Line Exec Source
1
/*********************                                                        */
2
/*! \file ascription_type.cpp
3
 ** \verbatim
4
 ** Top contributors (to current version):
5
 **   Andrew Reynolds
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 representing a type ascription
13
 **/
14
15
#include "expr/ascription_type.h"
16
17
#include <iostream>
18
19
#include "expr/type_node.h"
20
21
namespace CVC4 {
22
23
464
AscriptionType::AscriptionType(TypeNode t) : d_type(new TypeNode(t)) {}
24
25
98
AscriptionType::AscriptionType(const AscriptionType& at)
26
98
    : d_type(new TypeNode(at.getType()))
27
{
28
98
}
29
30
AscriptionType& AscriptionType::operator=(const AscriptionType& at)
31
{
32
  (*d_type) = at.getType();
33
  return *this;
34
}
35
36
562
AscriptionType::~AscriptionType() {}
37
2200
TypeNode AscriptionType::getType() const { return *d_type.get(); }
38
562
bool AscriptionType::operator==(const AscriptionType& other) const
39
{
40
562
  return getType() == other.getType();
41
}
42
bool AscriptionType::operator!=(const AscriptionType& other) const
43
{
44
  return getType() != other.getType();
45
}
46
47
856
size_t AscriptionTypeHashFunction::operator()(const AscriptionType& at) const
48
{
49
856
  return TypeNodeHashFunction()(at.getType());
50
}
51
52
std::ostream& operator<<(std::ostream& out, AscriptionType at)
53
{
54
  out << at.getType();
55
  return out;
56
}
57
58
26676
}  // namespace CVC4