1 /********************* */
2 /*! \file ascription_type.cpp
4 ** Top contributors (to current version):
5 ** Morgan Deters, Tim King, Mathias Preiner
6 ** This file is part of the CVC4 project.
7 ** Copyright (c) 2009-2020 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
12 ** \brief A class representing a type ascription
15 #include "expr/ascription_type.h"
19 #include "expr/type_node.h"
23 AscriptionType::AscriptionType(TypeNode t
) : d_type(new TypeNode(t
)) {}
25 AscriptionType::AscriptionType(const AscriptionType
& at
)
26 : d_type(new TypeNode(at
.getType()))
30 AscriptionType
& AscriptionType::operator=(const AscriptionType
& at
)
32 (*d_type
) = at
.getType();
36 AscriptionType::~AscriptionType() {}
37 TypeNode
AscriptionType::getType() const { return *d_type
.get(); }
38 bool AscriptionType::operator==(const AscriptionType
& other
) const
40 return getType() == other
.getType();
42 bool AscriptionType::operator!=(const AscriptionType
& other
) const
44 return getType() != other
.getType();
47 size_t AscriptionTypeHashFunction::operator()(const AscriptionType
& at
) const
49 return TypeNodeHashFunction()(at
.getType());
52 std::ostream
& operator<<(std::ostream
& out
, AscriptionType at
)