in sending with name using λ (counting), how does the process happen?

98 Views Asked by At

Sometimes expressions has two states. the result of analyses might be two different things but at the end, there might be the same answer(result) for them.(the way we get to the answer is different,but the result is the same)

for example:

P->Q = M

P->T = M

in lambda we have two solutions.

1.sending with name. (in ALGOL it have over load)

2.sending with value

Example:

Q: (λy.(yy) (λx.(xx)a))

1.sending with name

(λx.(xx)a λx.(xx)a)

((aa)(aa))

2.sending with value

(λy.(yy) aa)

((aa)(aa))

now here is the question, in sending with name that used λ (counting), how does the process happen? How this sending (transmittal) happen? How does it work?

1

There are 1 best solutions below

1
On

These I know as call-by-name and call-by-value. For a more extensive description see this article on lambda calculus, or this more general article.

In call by value, we evaluate the argument first, so given

(λy.(yy) (λx.(xx)a))

we evaluate (λx.(xx)a) = aa to get (λy.(yy) (aa)) and thence to ((aa)(aa)).

In call by name, we delay the evaluation of (λx.(xx)a) and get

(λx.(xx)a)(λx.(xx)a)

by replacing y in the first function with (λx.(xx)a), then finally we evaluate each of the remaining functions to get ((aa)(aa))