0

Lambda Calculus Question:

TRUE = lambda x y . x
FALSE = lambda x y . y
1 = lambda s z . s z
2 = lambda s z . s (s z) ...

BoolAnd = lambda x y . x y FALSE
BoolOr = lambda x y. x TRUE y
BoolNot = lambda x . x FALSE TRUE 

If I want to know the result of BoolNot 1:
BoolNot 1
(lambda x . x FALSE TRUE)(lambda s z . s (s z))
(lambda s z . s z) FALSE TRUE
(lambda x y . y) (lambda x y . x)

Here needs x and y 2 parameters, but only have 1 here, How can I continue this calculus?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Andy
  • 13
  • 4

2 Answers2

1

λ x y. E is "shorthand" for λx. (λy. E).

Thus,

(λ x y. y) (λ x y. x)

==> (λx. (λy. y)) (λ x y. x)

==> λy. y

That is, the identity function.

molbdnilo
  • 64,751
  • 3
  • 43
  • 82
0

Think that you apply one argument at the time and at each step you have a function taking one less. It doesn't make sense to do (not 1) but the result is the identity function since true becomes the variable not used and thus it will take another argument y and evaluate to y

Sylwester
  • 47,942
  • 4
  • 47
  • 79