19 using valuest = std::map<irep_idt, exprt>;
22 std::vector<exprt> new_constraints;
23 new_constraints.reserve(constraints.size());
26 for(
auto &expr : constraints)
28 bool retain_constraint =
true;
32 if(substitution_result.has_value())
33 expr = std::move(substitution_result.value());
35 if(expr.id() == ID_equal)
38 if(equal_expr.lhs().id() == ID_symbol)
43 values.insert({symbol_expr.get_identifier(), equal_expr.rhs()});
44 if(insert_result.second)
47 retain_constraint =
false;
53 new_constraints.push_back(std::move(expr));
56 constraints = std::move(new_constraints);
59 for(
auto &expr : constraints)
61 if(expr.id() == ID_equal &&
to_equal_expr(expr).lhs().
id() == ID_symbol)
69 if(substitution_result.has_value())
70 expr = std::move(substitution_result.value());
void equality_propagation(std::vector< exprt > &constraints)
API to expression classes.
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const equal_exprt & to_equal_expr(const exprt &expr)
Cast an exprt to an equal_exprt.
std::optional< exprt > substitute_symbols(const std::map< irep_idt, exprt > &substitutions, exprt src)
Substitute free occurrences of the variables given by their identifiers in the keys of the map in the...