The λ-calculus itself can be built on just three of them — S, K and I. In combinatory logic they are taken as primitives:
And I is not even needed as a primitive — it is expressible through S and K:
Let us substitute and prove the formula — expand on an arbitrary argument using the definitions (1.28):
For any we get — exactly what does, so .
Any λ-term is translated into combinators mechanically. A term is built in three ways — a variable, an application and an abstraction; variables and applications already exist in combinatory logic, but abstraction has to be eliminated. This is done by bracket abstraction — the operation , “pull the variable out of the term ”. Its result is a combinator term in which no longer occurs but which, if given back, reduces to again. It is defined by the shape of the body :
- : the body is itself; returning the argument unchanged is exactly what does.
- when : the body does not depend on , so the given argument is simply discarded.
- : in an application may hide in both and , so the argument must be handed to both — which is exactly what does.
If the body is itself an abstraction , the inner variable is removed first and the outer one after: ; thus nested are stripped from the inside out until only variables and applications remain.
Take . The body is an application , so we unwind it with the application rule, reducing everything to , , :
There are no variables in the result — only , , and the free : .