Lambda Reduction
Lambda reduction is an umbrella term for all these transformations ā that is, alpha-, beta-, and eta-conversion. With these, we can step-by-step transform lambda expressions into simpler, equivalent forms.
Ī±- Conversion
This is essentially the renaming of variables. A lambda expression remains the same as long as we consistently rename the bound variables.
1šš„.š„+1 is the same as šš¦.š¦+1
Ī²- Reduction
Beta reduction is the actual execution of a function. That is applying a lambda expression to an argument.
1(šš„.š„+1) 5 ā 5 + 1 ā 6
Ī·- Conversion
Eta conversion describes that two functions are considered equal if they produce the same result for all arguments.
1šš„.š š„ is the same as š
f: is a function
x: does not occur freely in f
This means that a function which does nothing but call another function is identical to that function.
Examples
Alpha-Conversion (Renaming Variables)
Question:
Perform an alpha-conversion on the following lambda expression:
1šš„.š„Ā² + 2š„ + 1
Rename x
to another variable ā but ensure that the meaning remains the same.
Solution:
1šš„.š„Ā² + 2š„ + 1 ā šš¦.š¦Ā² + 2š¦ + 1
Following is valid, in the sence of an algebraic simplification, but its not an alpha conversion.
1š„Ā² + 2š„ + 1 = (š„ + 1)Ā²
2šš„.(š„ + 1)Ā²
Question:
Which of the following expressions is an alpha-variant of šš.š + 3
?
a) šš.š + 3
b) šš„.š„ + 3
c) šš.3 + š
Solution: a and b are valid alpha variants for šš.š + 3