-1

How is ((f f) (g g)) reduced in both applicative order reduction and normal order reduction? do both reduce the statement in the same way?

Ahmed
  • 120
  • 6

1 Answers1

0

Assume "reduce" means "Beta-Reduct".
I'm not going to be rigorous and introduice formals definitions, because of this is not the question. Before, i need to clarify some terms :

  • A beta-contraction (writes ~> here) means a single step of the evaluation.
    For example (λx.λy.xy)(a)(b) ~> (λy.ay)(b) forall terms a, b
  • A beta-reduction (writes => here) means a complete evaluation.
    For example (λx.λy.xy)(a)(b) => ab forall atoms a, b
  • A term is in a beta-normal form if it's no contain redexes.
    For example λx.x is a beta-normal form, but (λx.x)y has a beta-normal form (y) iff y has a beta-normal form. An other important point : A term A has a unique beta-normal form regardless wich strategy we apply to reduce A.
  • Two terms are beta-equals (writes == here) if their beta-normal forms are alpha-equivalent For example (λx.λy.xy)(a)(b) == (λy.ay)(b)

In the case of the AOR strategy, to reduce a term A, we beta-contract the rightmost innermost redex until we get a beta-normal form.
More visually :

>> (λx.x)((λy.y)((λz.z)a))
~> (λx.x)((λy.y)a)
~> (λx.x)a
~> a

In the case of the NOR strategy, to reduce a term A, we beta-contract the leftmost outermost redex until we get a beta-normal form More visually :

>> (λx.x)((λy.y)((λz.z)a))
~> (λy.y)((λz.z)a)
~> (λz.z)a
~> a

So, in your case, with f f => A, g g => B
AOR :

>> (f f)(g g)
~> (f f)B
~> AB

NOR :

>> (f f)(g g)
~> A(g g)
~> AB

It's not very rigorous, but the idea is clear. And, of course, (f f)(g g) == (f f)(g g)

Simon
  • 1
  • 1