captureavoiding
Capture-avoiding substitution is the operation of replacing free occurrences of a variable x with a term t inside a lambda-term M, while ensuring that no free variables in t become inadvertently bound by a surrounding lambda abstraction in M. The goal is to preserve the term’s meaning by respecting the binding structure of the term.
Without capture-avoidance, substitution can cause variable capture, where a free variable in t becomes bound by
Example: Let M be lambda y. x and we substitute t for x, with t containing y.
Capture-avoiding substitution is foundational in the theory and implementation of lambda calculus, type systems, and functional