What is the result of (λx.λy.x + ( λx.x+1) (x+y)) ( λz.z-4 5) 10?

1k Views Asked by At

Could you explain what should I do about

λx.λy.x

part? Thanks.

1

There are 1 best solutions below

2
On BEST ANSWER

The parentheses are pretty bad, here is my guess on what the expression should be in order to evaluate to a number in the end:

$(\lambda x.\lambda y.(x + ( \lambda x.x+1) (x+y)))~( (\lambda z.(z-4))~5)~10$

Then you just have to reduce everything. Here is a step-by-step reduction:

$$\begin{array}{l} (\lambda x.\lambda y.(x + ( \lambda x.x+1) (x+y)))~( (\lambda z.(z-4))~5)~10\\ \to (\lambda x.\lambda y.(x + (x+y+1)))~(5-4)~10\\ \to (\lambda x.\lambda y.(2x+y+1))~1~10\\ \to (\lambda y.(2*1+y+1))~10\\ \to (2*1+10+1)\\ \to 13 \end{array}$$