Skip to main content

substitute

Function substitute 

Source
pub fn substitute(var: &str, replacement: &TLExpr, body: TLExpr) -> TLExpr
Expand description

Substitute all free occurrences of var with replacement in body.

This is capture-avoiding: when a binder that re-introduces var is encountered, substitution stops for the sub-tree guarded by that binder.

Variable occurrences are zero-argument predicates with name == var and Term::Var(var) inside predicate arguments.