Implement replace() for expressions
For return types of functions returning arrays, the general way to solve that is to write a function replace(expr_t *e, Vec<Variable_t*> &vars, Vec<expr_t*> &replacements)
which will go into e
and replace all occurrences of Var
to the variables in vars
with the corresponding expression in replacements
.
We have to decide if replace()
will make a copy of e
and return a new one, or if it will modify in-place.