Calculating $(\lambda x.(x+y))1$

47 Views Asked by At

$(\lambda x.(x+y))1$ returns(I think): $(1+y)$. Is $(1+y)$ another lambda function so I'd write:

$\lambda y.(1+y)$

or is it just $(1+y)$ and if so what does that mean?

1

There are 1 best solutions below

2
On BEST ANSWER

$1+y$ is not the same as $\lambda y.(1+y)$. In the first, the variable $y$ is free and in the second it's bound. (Or: one contains three symbols, the other contains six.) The term $1+y$ is the only answer; it's just a term with a free variable.

Lambda-calculus is usually considered to be about certain sequences of symbols called terms. There's a notion of "reduction" of terms, where a term with a certain form, $(\lambda p.E) q$, can be "reduced" to a different term $E[p:=q]$. With this view, $1+y$ is simply an irreducible term, because it doesn't have the right form.

Some formulations of lambda-calculus may include additional ways to reduce terms. For example, one can include rules that allow a term like $2 + 4$ to reduce to the term $6$. One sometimes agrees to include the rule that the term $\lambda x.(f x)$ reduces to $f$. If the question intends for there to be additional reduction rules of this sort, it will say so.