CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cpp_template_args.h
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: C++ Language Type Checking
4
5Author: Daniel Kroening, kroening@cs.cmu.edu
6
7\*******************************************************************/
8
11
12#ifndef CPROVER_CPP_CPP_TEMPLATE_ARGS_H
13#define CPROVER_CPP_CPP_TEMPLATE_ARGS_H
14
15#include <util/expr.h>
16#include <util/invariant.h>
17
18// A data structures for template arguments, i.e.,
19// a sequence of types/expressions of the form <E1, T2, ...>.
20// Not to be confused with the template parameters!
21
23{
24public:
28
30
32 {
33 return (argumentst &)(add(ID_arguments).get_sub());
34 }
35
36 const argumentst &arguments() const
37 {
38 return (const argumentst &)(find(ID_arguments).get_sub());
39 }
40};
41
42// the non-yet typechecked variant
43
47
49 irept &irep)
50{
52 return static_cast<cpp_template_args_non_tct &>(irep);
53}
54
56 const irept &irep)
57{
59 return static_cast<const cpp_template_args_non_tct &>(irep);
60}
61
62// the already typechecked variant
63
65{
66public:
67 bool has_unassigned() const
68 {
70 for(argumentst::const_iterator
71 it=_arguments.begin();
72 it!=_arguments.end();
73 it++)
74 if(it->id()==ID_unassigned ||
75 it->type().id()==ID_unassigned)
76 return true;
77
78 return false;
79 }
80};
81
83{
85 return static_cast<cpp_template_args_tct &>(irep);
86}
87
89{
91 return static_cast<const cpp_template_args_tct &>(irep);
92}
93
94#endif // CPROVER_CPP_CPP_TEMPLATE_ARGS_H
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
const argumentst & arguments() const
exprt::operandst argumentst
std::vector< exprt > operandst
Definition expr.h:58
There are a large number of kinds of tree structured or tree-like data in CPROVER.
Definition irep.h:364
const irept & find(const irep_idt &name) const
Definition irep.cpp:93
subt & get_sub()
Definition irep.h:448
const irep_idt & id() const
Definition irep.h:388
irept & add(const irep_idt &name)
Definition irep.cpp:103
cpp_template_args_non_tct & to_cpp_template_args_non_tc(irept &irep)
cpp_template_args_tct & to_cpp_template_args_tc(irept &irep)
#define PRECONDITION(CONDITION)
Definition invariant.h:463