I'm working on some problems where I'm supposed to reduce lamda terms to normal form. I'm not sure if I'm doing it right so if someone could let me know, that would be awesome.
$$(\lambda x.\lambda y.x*2+y*3)\; 5 \;4 $$
$$\rightarrow(\lambda y.5*2+y*3) \; 4 $$
$$\rightarrow(5*2+4*3) $$
$$\rightarrow 22$$
And secondly, how does that equation differ from $\lambda x.(\lambda y.x*2+y*3) \; 5$? They just moved the parenthesis over $1\ldots$ does that mean the $λx$ would just stay in the answer? as in:
$$\lambda x.(\lambda y.x*2+y*3) 5$$
$$\rightarrow\lambda x.(x*2+5*3)$$
And would I solve it to be:
$$\rightarrow \lambda x.(x*2+15)$$
Thanks in advance,
Sean
(\x y -> x*2 + y*3) 5 4or try ruby by typing inlambda{|x| lambda{|y| x*2 + y*3}}[5][4]. – dtldarek Oct 14 '13 at 18:59