CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
find_symbols.h
Go to the documentation of this file.
1/*******************************************************************\
2
3Module:
4
5Author: Daniel Kroening, kroening@kroening.com
6
7\*******************************************************************/
8
9
10#ifndef CPROVER_UTIL_FIND_SYMBOLS_H
11#define CPROVER_UTIL_FIND_SYMBOLS_H
12
13#include "irep.h"
14
15#include <set>
16#include <unordered_set>
17
18class exprt;
19class symbol_exprt; // IWYU pragma: keep
20class typet;
21
22typedef std::unordered_set<irep_idt> find_symbols_sett;
23
28 const exprt &src,
29 const irep_idt &identifier,
31
34void find_symbols(const exprt &src, find_symbols_sett &dest);
35
38void find_symbols(
39 const exprt &src,
40 std::set<symbol_exprt> &dest);
41
44inline std::set<symbol_exprt> find_symbols(const exprt &src)
45{
46 std::set<symbol_exprt> syms;
47 find_symbols(src, syms);
48 return syms;
49}
50
54{
55 find_symbols_sett identifiers;
56 find_symbols(src, identifiers);
57 return identifiers;
58}
59
62 const typet &src,
63 find_symbols_sett &dest);
64
67 const exprt &src,
68 find_symbols_sett &dest);
69
73 const typet &src,
74 find_symbols_sett &dest);
75
79 const exprt &src,
80 find_symbols_sett &dest);
81
86 const typet &src,
88 const std::vector<irep_idt> &subs_to_find = {});
89
94 const exprt &src,
96 const std::vector<irep_idt> &subs_to_find = {});
97
98#endif // CPROVER_UTIL_FIND_SYMBOLS_H
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition dstring.h:38
Base class for all expressions.
Definition expr.h:56
Expression to hold a symbol (variable)
Definition std_expr.h:131
The type of an expression, extends irept.
Definition type.h:29
find_symbols_sett find_symbol_identifiers(const exprt &src)
Find identifiers of the sub expressions with id ID_symbol, considering both free and bound variables.
void find_type_and_expr_symbols(const typet &src, find_symbols_sett &dest, const std::vector< irep_idt > &subs_to_find={})
Find identifiers with id ID_symbol of the sub expressions and the subs with ID in subs_to_find consid...
void find_non_pointer_type_symbols(const typet &src, find_symbols_sett &dest)
Collect type tags contained in src when the expression of such a type is not a pointer,...
std::unordered_set< irep_idt > find_symbols_sett
bool has_symbol_expr(const exprt &src, const irep_idt &identifier, bool include_bound_symbols)
Returns true if one of the symbol expressions in src has identifier identifier; if include_bound_symb...
void find_symbols(const exprt &src, find_symbols_sett &dest)
Add to the set dest the sub-expressions of src with id ID_symbol, for both free and bound variables.
void find_type_symbols(const typet &src, find_symbols_sett &dest)
Collect all type tags contained in src and add them to dest.