
(λx.(y x) z) beta reduces to (y z) which is exactly the application of y to z, namely (y z). The motivation behind eta reduction is that the effect of an application of either of the eta expressions is the same. Any abstraction with the formįor example, λx.(y x) can be eta reduced to y. practical: With a little syntax sugar, lambda calculus becomes a practical programming language. Spare a thought for students struggling to make Turing machines do simple tasks.
ALPHA REDUCTION IN LAMBDA CALCULUS HOW TO
It is just mentioned here for completeness. simple: Here’s how to multiply two numbers in lambda calculus: m.

This is a third reduction rule, which we will not need at all. Eta reduction (extensional equality of functions) If you can see this, your browser does not understand IFRAME.

The reason for this is that the only time we need alpha conversion at all is to push through a beta reduction when there is capture of variable, but our implementation of beta reduction does the alpha rewrite automatically (leaving you to concentrate on more important matters)! In our implementation of reduction, we haven't made available the rewriting of a subformula by alpha conversion. So try to spot that sequence for it flags possible beta reductions. The expression, or sub-expression, which gets reduced is known as a redex (i.e. So, within the grammar we are using, an expression can be beta-reduced iff it starts with the two characters '(λ'. HINT: Beta-reduction is always used on an application, that is, on an expression of the form ( ) and, in turn, the left expression has to be a lambda abstraction i.e.

This rule can be used on sub-expressions of an expression. Beta reduction (the effect of function application):. Sometimes this is called alpha congruence.Īlpha conversion is not going to be a lot of interest to us- we need it only for ensuring that beta-reductions can take place, and more of that shortly. Normally we regard expressions with rewritten bound variables as same. λw.(w y) with the underlined pieces being re-written (question: can it be converted to λy.λy.(y y ) ? if not, why not?) The rule can also be applied to subexpressions- λy. In the simplest cases alpha conversion allows you to change, for example, λy.y into λx.x or λz.z. If you're just looking for better intuition as to how lambda calculus works, most computer science departments have slides laying around.9/13/19 Alpha conversion (Rewrite of bound variables):.

It wouldn't change the outcome of our application as shown: (\j.j)y //y gets bound to all occurrences of j to the right of the periodĪs to learning resources: the wikipedia page is pretty detailed, but notation heavy and would probably require a few good rereads. They state that you can change the name of any lambda term and its bound variables without changing the meaning of the expression.įor example using the identity function from above we could just as easily written the lambda term as (\j.j). This is the identity function.Īlpha "reductions" are usually called alpha equivalences or alpha rewrite rules. Where y is bound to all occurrences of x in the lambda expression. (\x.x)y //y gets bound to all occurences of x to the right of the period The bound variables are the variables that match the variable left of the (.), so in this case x. Then you would substitute all the bound variables to the right of the (.) in your lambda term. It is applied through substitution as shown: Beta reduction is just the primary application rule used for computation within the lambda calculus.
