18 const auto &values = expr.
values();
22 "let must have the type of the 'where' operand");
25 for(
auto &binding :
make_range(variables).zip(values))
28 binding.first.type() == binding.second.type(),
29 "let value must have the type of the let symbol");
37 std::vector<bvt> converted_values;
38 converted_values.reserve(variables.size());
40 for(
auto &value : values)
43 converted_values.emplace_back();
52 for(
const auto &binding :
make_range(fresh_variables).zip(converted_values))
54 const auto &identifier = binding.first.get_identifier();
57 if(binding.first.is_boolean())
59 DATA_INVARIANT(binding.second.size() == 1,
"boolean values have one bit");
60 symbols[identifier] = binding.second[0];
69 for(
const auto &pair :
make_range(variables).zip(fresh_variables))
70 replace_symbol.
insert(pair.first, pair.second);
74 replace_symbol(where_renamed);
80 for(
const auto &entry : fresh_variables)
82 const auto &type = entry.type();
83 if(type.id() == ID_bool)
84 symbols.erase(entry.get_identifier());
void erase_literals(const irep_idt &identifier, const typet &type)
void set_literals(const irep_idt &identifier, const typet &type, const bvt &literals)
virtual std::optional< std::size_t > get_width_opt(const typet &type) const
virtual const bvt & convert_bv(const exprt &expr, const std::optional< std::size_t > expected_width={})
Convert expression to vector of literalts, using an internal cache to speed up conversion if availabl...
virtual bvt convert_let(const let_exprt &)
binding_exprt::variablest fresh_binding(const binding_exprt &)
create new, unique variables for the given binding
Base class for all expressions.
typet & type()
Return the type of the expression.
exprt & where()
convenience accessor for binding().where()
binding_exprt::variablest & variables()
convenience accessor for binding().variables()
binding_exprt & binding()
Replace a symbol expression by a given expression.
void insert(const class symbol_exprt &old_expr, const exprt &new_expr)
Sets old_expr to be replaced by new_expr if we don't already have a replacement; otherwise does nothi...
std::vector< literalt > bvt
Ranges: pair of begin and end iterators, which can be initialized from containers,...
ranget< iteratort > make_range(iteratort begin, iteratort end)
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
API to expression classes.