16 #include <unordered_set>
19 const std::unordered_set<symbol_exprt, irep_hash> &bound_symbols,
23 if(src.
id() == ID_symbol)
26 auto b_it = bound_symbols.find(symbol_expr);
27 if(b_it == bound_symbols.end())
31 src.
id() == ID_forall || src.
id() == ID_exists || src.
id() == ID_lambda)
36 auto new_bound_symbols = bound_symbols;
38 for(
const auto &s : binding_expr.variables())
39 new_bound_symbols.insert(s);
43 else if(src.
id() == ID_let)
48 for(
const auto &v : let_expr.values())
51 auto new_bound_symbols = bound_symbols;
53 for(
const auto &s : let_expr.variables())
54 new_bound_symbols.insert(s);
69 std::unordered_set<symbol_exprt, irep_hash>
free_symbols, bound_symbols;
Base class for all expressions.
const irep_idt & id() const
Expression to hold a symbol (variable)
static void free_symbols_rec(const std::unordered_set< symbol_exprt, irep_hash > &bound_symbols, const exprt &src, const std::function< void(const symbol_exprt &)> &f)
void free_symbols(const exprt &expr, const std::function< void(const symbol_exprt &)> &f)
API to expression classes.
const let_exprt & to_let_expr(const exprt &expr)
Cast an exprt to a let_exprt.
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const binding_exprt & to_binding_expr(const exprt &expr)
Cast an exprt to a binding_exprt.