Go to the documentation of this file.
36 std::unordered_set<irep_idt> &bindings);
42 std::unordered_set<irep_idt> &bindings)
46 if(src.
id() == ID_forall || src.
id() == ID_exists || src.
id() == ID_lambda)
49 std::unordered_set<irep_idt> new_bindings{bindings};
50 for(
const auto &v : binding_expr.variables())
51 new_bindings.insert(v.get_identifier());
53 if(!
find_symbols(kind, binding_expr.where(), op, new_bindings))
56 return find_symbols(kind, binding_expr.type(), op, bindings);
58 else if(src.
id() == ID_let)
61 std::unordered_set<irep_idt> new_bindings{bindings};
62 for(
const auto &v : let_expr.variables())
63 new_bindings.insert(v.get_identifier());
65 if(!
find_symbols(kind, let_expr.where(), op, new_bindings))
68 if(!
find_symbols(kind, let_expr.op1(), op, new_bindings))
71 return find_symbols(kind, let_expr.type(), op, bindings);
84 if(src.
id() == ID_symbol)
100 const irept &c_sizeof_type=src.
find(ID_C_c_sizeof_type);
105 kind,
static_cast<const typet &
>(c_sizeof_type), op, bindings))
110 const irept &va_arg_type=src.
find(ID_C_va_arg_type);
126 std::unordered_set<irep_idt> &bindings)
147 const irep_idt &typedef_name = src.
get(ID_C_typedef);
153 if(src.
id()==ID_struct ||
158 for(
const auto &c : struct_union_type.
components())
164 else if(src.
id()==ID_code)
176 else if(src.
id()==ID_array)
186 if(src.
id() == ID_c_enum_tag)
191 else if(src.
id() == ID_struct_tag)
196 else if(src.
id() == ID_union_tag)
211 std::unordered_set<irep_idt> bindings;
220 std::unordered_set<irep_idt> bindings;
235 bool include_bound_symbols)
const union_tag_typet & to_union_tag_type(const typet &type)
Cast a typet to a union_tag_typet.
const irep_idt & get_identifier() const
const componentst & components() const
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
static bool find_symbols(symbol_kindt, const typet &, std::function< bool(const symbol_exprt &)>, std::unordered_set< irep_idt > &bindings)
void find_type_and_expr_symbols(const exprt &src, find_symbols_sett &dest)
Find identifiers of the sub expressions with id ID_symbol, considering both free and bound variables,...
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a typet to a struct_union_typet.
The type of an expression, extends irept.
const irept & find(const irep_idt &name) const
Base type for structs and unions.
void find_non_pointer_type_symbols(const exprt &src, find_symbols_sett &dest)
Collect type tags contained in src when the expression of such a type is not a pointer,...
const type_with_subtypet & to_type_with_subtype(const typet &type)
const type_with_subtypest & to_type_with_subtypes(const typet &type)
Base class for all expressions.
Expression to hold a symbol (variable)
symbol_kindt
Kinds of symbols to be considered by find_symbols.
const irep_idt & get(const irep_idt &name) const
typet & type()
Return the type of the expression.
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
@ F_EXPR_FREE
Symbol expressions, but excluding bound variables.
const c_enum_tag_typet & to_c_enum_tag_type(const typet &type)
Cast a typet to a c_enum_tag_typet.
#define forall_operands(it, expr)
const irep_idt & get_identifier() const
const let_exprt & to_let_expr(const exprt &expr)
Cast an exprt to a let_exprt.
void find_type_symbols(const exprt &src, find_symbols_sett &dest)
Collect all type tags contained in src and add them to dest.
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const irep_idt & id() const
const struct_tag_typet & to_struct_tag_type(const typet &type)
Cast a typet to a struct_tag_typet.
const parameterst & parameters() const
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...
const array_typet & to_array_type(const typet &type)
Cast a typet to an array_typet.
const typet & return_type() const
There are a large number of kinds of tree structured or tree-like data in CPROVER.
@ F_TYPE_NON_PTR
Struct, union, or enum tag symbols when the expression using them is not a pointer.
const binding_exprt & to_binding_expr(const exprt &expr)
Cast an exprt to a binding_exprt.
@ F_EXPR
Symbol expressions.
@ F_TYPE
Struct, union, or enum tag symbols.