Lambda Calculus
Each lambda term is built with the CFG:
v
is some variable (evaluates to ) - Defines a function that takes in variable
and outputs (in Scala, { v => e }
) - Two expressions next to each other (
e(e)
, function call)
You may also include the production
β-Reductions
calling a function is just putting the parameter in its body and "running" its body.
The
It's common for the brackets around the argument to be omitted:
we have a function that takes some parameter
To make functions that take multiple params, we can curry them:
which is the same as:
Example
Variable Capture and α-Reductions
Consider the function:
if you just blindly replace the
which is very bad, since this changes the meaning.
We can use ALPHA RENAMING (NO WAY) to fix this:
now our substitution is ok (yay):
George does not support alpha-renaming.
Formally:
obviously