cprover
Loading...
Searching...
No Matches
cpp_template_type.h
Go to the documentation of this file.
1/*******************************************************************\
2
3Module:
4
5Author: Daniel Kroening, kroening@cs.cmu.edu
6
7\*******************************************************************/
8
9
10#ifndef CPROVER_CPP_CPP_TEMPLATE_TYPE_H
11#define CPROVER_CPP_CPP_TEMPLATE_TYPE_H
12
13#include <util/invariant.h>
14#include <util/type.h>
15
17
19{
20public:
24
25 typedef std::vector<template_parametert> template_parameterst;
26
31
36
37 using typet::subtype;
38};
39
41{
42 PRECONDITION(type.id() == ID_template);
43 return static_cast<template_typet &>(type);
44}
45
46inline const template_typet &to_template_type(const typet &type)
47{
48 PRECONDITION(type.id() == ID_template);
49 return static_cast<const template_typet &>(type);
50}
51
52inline const typet &template_subtype(const typet &type)
53{
54 if(type.id()==ID_template)
55 return to_type_with_subtype(type).subtype();
56
57 return type;
58}
59
61{
62 if(type.id()==ID_template)
63 return type.subtype();
64
65 return type;
66}
67
68#endif // CPROVER_CPP_CPP_TEMPLATE_TYPE_H
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:564
const irept & find(const irep_idt &name) const
Definition irep.cpp:106
subt & get_sub()
Definition irep.h:456
const irep_idt & id() const
Definition irep.h:396
irept & add(const irep_idt &name)
Definition irep.cpp:116
const template_parameterst & template_parameters() const
template_parameterst & template_parameters()
std::vector< template_parametert > template_parameterst
const typet & subtype() const
Definition type.h:156
The type of an expression, extends irept.
Definition type.h:29
const typet & subtype() const
Definition type.h:48
const typet & template_subtype(const typet &type)
template_typet & to_template_type(typet &type)
#define PRECONDITION(CONDITION)
Definition invariant.h:463
Defines typet, type_with_subtypet and type_with_subtypest.
const type_with_subtypet & to_type_with_subtype(const typet &type)
Definition type.h:177