1 /********************* */
2 /*! \file ascription_type.h
4 ** Top contributors (to current version):
5 ** Morgan Deters, Tim King
6 ** This file is part of the CVC4 project.
7 ** Copyright (c) 2009-2019 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
14 ** A class representing a parameter for the type ascription operator.
17 #include "cvc4_public.h"
19 #ifndef CVC4__ASCRIPTION_TYPE_H
20 #define CVC4__ASCRIPTION_TYPE_H
22 #include "expr/type.h"
27 * A class used to parameterize a type ascription. For example,
28 * "nil :: list<nat>" is an expression of kind APPLY_TYPE_ASCRIPTION.
29 * The parameter is an ASCRIPTION_TYPE-kinded expression with an
30 * AscriptionType payload. (Essentially, all of this is a way to
31 * coerce a Type into the expression tree.)
33 class CVC4_PUBLIC AscriptionType
{
37 AscriptionType(Type t
) : d_type(t
) {}
38 Type
getType() const { return d_type
; }
39 bool operator==(const AscriptionType
& other
) const
41 return d_type
== other
.d_type
;
43 bool operator!=(const AscriptionType
& other
) const
45 return d_type
!= other
.d_type
;
47 };/* class AscriptionType */
50 * A hash function for type ascription operators.
52 struct CVC4_PUBLIC AscriptionTypeHashFunction
{
53 inline size_t operator()(const AscriptionType
& at
) const {
54 return TypeHashFunction()(at
.getType());
56 };/* struct AscriptionTypeHashFunction */
58 /** An output routine for AscriptionTypes */
59 inline std::ostream
& operator<<(std::ostream
& out
, AscriptionType at
) {
66 #endif /* CVC4__ASCRIPTION_TYPE_H */