I'm working my way through Types and Programming Languages, and Pierce, for the call by value reduction strategy, gives the example of the term id (id (λz. id z))
. The inner redex id (λz. id z)
is reduced to λz. id z
first, giving id (λz. id z)
as the result of the first reduction, before the outer redex is reduced to the normal form λz. id z
.
But call by value order is defined as 'only outermost redexes are reduced', and 'a redex is reduced only when its right-hand side has already been reduced to a value'. In the example id (λz. id z)
appears on the right-hand side of the outermost redex, and is reduced. How is this squared with the rule that only outermost redexes are reduced?
Is the answer that 'outermost' and 'innermost' only refers to lambda abstractions? So for a term t
in λz. t
, t
can't be reduced, but in a redex s t
, t
is reduced to a value v
if this is possible, and then s v
is reduced?