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?
-
do you mean `(λf.f f) (λg.g g)` or `(f f) (g g)`? – Mulan Mar 02 '21 at 03:37
-
f should be an abstract lambda function like `(λf.f)`, so this example would be `(λf.f)(λf.f) ((λg.g) (λg.g))` – Ahmed Mar 02 '21 at 03:45
1 Answers
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 abeta-normal form
, but(λx.x)y
has abeta-normal form
(y
) iffy
has abeta-normal form
. An other important point : A termA
has a uniquebeta-normal form
regardless wich strategy we apply to reduce A. - Two terms are
beta-equals
(writes==
here) if theirbeta-normal forms
arealpha-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)

- 1
- 1