Práce v lambda kalkulu
Church encoding
T
λ
xy
.
x
F
λ
xy
.
y
NOT
λ
x
.
x
FT
AND
λ
xy
.
xy
F
OR
λ
xy
.
x
T
y
XOR
λ
xy
.
x
(
NOT
y
)
y
EQ
λ
xy
.
xy
(
NOT
y
)
0, 1, 2, 3, …
λ
fx
.
x
λ
fx
.
fx
λ
fx
.
f
(
fx
)
λ
fx
.
f
(
f
(
fx
))
λ
fx
.
fⁿx
succ
λ
nfx
.
f
(
nfx
)
add
λ
mnfx
.
mf
(
nfx
)
mult
λ
mnf
.
m
(
nf
)
mⁿ
λ
mn
.
nm
iszero
λ
m
.
m
(λ
v
.
FALSE
)
TRUE
if then else
λ
ctf
.
ctf
tuple
λ
fse
.
efs
first
λ
p
.
p
(λ
ab
.
a
)
1)
second
λ
p
.
p
(λ
ab
.
b
)
2)
1)
TRUE
2)
FALSE