0
$\begingroup$

Could you explain what should I do about

λx.λy.x

part? Thanks.

$\endgroup$
8
  • $\begingroup$ Are the numbers encoded in the standard way in $\lambda$-calculus ? If yes, $\lambda x.\lambda y.x$ is $0$. $\endgroup$
    – Denis
    May 30, 2013 at 10:35
  • $\begingroup$ also it seems that you got your parenthesis wrong, since y appears later, it is probably in the scope of the first $\lambda y$. $\endgroup$
    – Denis
    May 30, 2013 at 10:38
  • $\begingroup$ I'm guessing the plus binds tighter, so $\lambda x.\lambda y.x$ is not an individual part. $\endgroup$
    – Samuel
    May 30, 2013 at 10:38
  • $\begingroup$ @dkuper paranthesis should be true. $\endgroup$
    – jason
    May 30, 2013 at 10:39
  • $\begingroup$ if the parenthesis are true, then you have a $y$ floating in your formula, so it does not evaluate to a number. Or as @Samuel says, the + binds tighter, but it is not not standard so parenthesis should be put to avoid ambiguity. $\endgroup$
    – Denis
    May 30, 2013 at 10:44

1 Answer 1

1
$\begingroup$

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}$$

$\endgroup$
2
  • $\begingroup$ I followed these steps : (λx.λy.(x+(λx.x+1)(x+y))) ((λz.(z−4)) 5) 10 = (λx.λy.(x+(λx.x+1)(x+y))) 1 10 =(λx.λy.(13)) = 13 is that true? $\endgroup$
    – jason
    May 30, 2013 at 10:57
  • $\begingroup$ the $13$ is good, but the intermediate steps are weird. In particular the last one is not correct. I put the correct steps in the answer. $\endgroup$
    – Denis
    May 30, 2013 at 10:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .