Given

mult = \x -> \y -> x*y

I am trying to reduce

(mult (1+2)) (2+3)

with each of the strategies:

  • normal-order
  • applicative-order
  • call-by-name
  • call-by-value

my attempt:

for both applicative and by-value I get the same (because no intermediate lambda expression contains anything reducible, hence applicative does not do reduction under lambda either)

(mult (1+2)) (2+3)
(mult 3) (2+3)
(\y -> 3*y) (2+3)
(\y -> 3*y) 5
3*5
15

With normal and by-name: I am supposed to substitute "(2+3)" into the body of "(mult (1+2))". But that does not have a body, unless I do a reduction. But then it is not normal-order, nor call-by-name, since it is not the outermost I reduce. Hence it seems to me that these evaluation strategies "get stuck". But I am probably misunderstanding smth. That why I am curious about the correct solutions.

Related posts

Recent Viewed