GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/expr/ascription_type.cpp Lines: 11 19 57.9 %
Date: 2021-09-29 Branches: 7 20 35.0 %

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