πxyz.xy(zx)
πx.πy.πz.xy(zx)
[x := zx]πy.πz.xy
πy.πz.zxxy
πxyz.xy(zxy)
πx.πy.πz.xy(zxy)
[x := zxy]πy.πz.xy
πy.πz.zxyxy
πxy.xy(zxy)
πx.πy.xy(zxy)
[x := zxy]πy.xy
πy.zxyy
(πabc.cba)zz(πwv.w)
(πa.πb.πc.cba)(z)z(πw.πv.w) # first z becomes argument
[a := z] (πb.πc.cba) z (πw.πv.w)
(πb.πc.cbz) (z) (πw.πv.w)
[b := z] (πc.cbz) (πw.πv.w)
(πc.czz) (πw.πv.w)
[c := (πw.πv.w)]czz
(πw.πv.w)(z)z
[w :=z ](πv.w) (z)
(πv.z)(z)
[v := z] z
z
(πx.πy.xyy)(πa.a)b
[x := (πa.a)]πy.xyyb
πy.(πa.a)yy(b)
[y := b](πa.a)yy
(πa.a)(b)b
[a := b] ab
bb
(πy.y)(πx.xx)(πz.zq)
[y := (πx.xx)]y(πz.zq)
(πx.xx)(πz.zq)
[x := (πz.zq)]xx
(πz.zq)(πz.zq)
[z := (πz.zq)]zq
(πz.zq)(q)
[z := q]zq
qq
(πz.z)(πa.aa)(πb.bc)
[z := (πa.aa)]z(πb.bc)
(πa.aa)(πb.bc)
[a := (πb.bc)]aa
(πb.bc)(πb.bc)
[b := (πb.bc)]bc
(πb.bc)(c)
[b := c]bc
cc
(πx.πy.xyy)(πy.y)y
[x := (πy.y)]πy.xyy(y)
(πy.(πy.y)yy)(y)
[y := y](πy.y)y(y)
(πy.y)(y)y)
[y := y] (y)(y)
yy
(πa.aa)(πb.ba)c
[a := (πb.ba)]aac
(πb.ba)(πb.ba)c
[b := (πb.ba)]bac
(πb.ba)a(c)
[b := a]bac
aac
(πxyz.xz(yz))(πx.z)(πx.a)
(πx.πy.πz.xz(yz))(πx.z)(πx.a) # rename z to z1 before substituting in next step for less confusion
[x := (πx.z)]πy.πz1.xz(yz1)(πx.a)
(πy.πz1.(πx.z)z1(yz1)(πx.a)
[y := (πx.a)]πz1.(πx.z)z1(yz1)
(πz1.(πx.z)z1((πx.a)z1) # d)
comment: "Canβt apply z1 to anything, evaluation strategy is normal order so leftmost outermost is the order of the day. Our leftmost, outermost lambda has no remaining arguments to be applied so we now examine the terms nested within to see if they are in normal form. (π₯.π§) gets applied to π§1, tosses the π§1 away and returns π§. π§ is now being applied to ((π₯.π)(π§1))" - didn't understand this explanation
(πz1.z((πx.a)z1)) # e)
comment: "Cannot reduce π§ further, itβs free and we know nothing, so we go inside yet another nesting and reduce ((π₯.π)(π§1)). π₯.π gets applied to π§1, but tosses it away and returns the free variable π. The π is now part of the body of that expression. All of our terms are in normal order now" - I understand [x := z1] but need to revisit the rest
(πz1.za)