In the simply typed lambda calculus, types are generated from atomic types by the arrow constructor . A typed lambda term is a lambda term equipped with a derivation of a judgement , where the context assigns types to its free variables. The basic typing rules areThe Implicational Curry-Howard correspondence reads atomic types as propositions and as logical implication. A typed variable is an assumption, abstraction is the implication introduction rule discharging that assumption, and application is the implication elimination rule. Consequently a typed lambda term is a proof in implicational Intuitionistic propositional logic, and a natural deduction proof recursively supplies such a term. For example, expresses implication reflexivity. Products, sums, and the empty type extend the correspondence to conjunction, disjunction, and falsity; pure arrow types give precisely the implicational fragment. Beta reduction removes an introduction followed immediately by its elimination, matching proof simplification.
A Church numeral iswhere means repetitions of application. At base type , it has type . The following Church numeral arithmetic terms use left-associated application:Their concise conclusions areFor successor, the initial adds one application. For addition, the inner supplies applications and supplies more. For multiplication, the repeated operation applies times, and repetitions give . For exponentiation, iterates the operation on : each iteration replaces a function by its -fold iterate, yielding . Zero iterations give , so this encoding takes , including . The explicit outer abstractions make the result the standard Church numeral even at exponent zero, without needing eta equivalence.
Successor, addition, and multiplication operate on the same . The displayed exponentiation term has type : its exponent iterates an operation on functions. Thus the numeral syntax admits several type instances; one should not force every occurrence into one fixed monomorphic Church type.
The Y combinator is the fixed-point combinatorFor , beta reduction gives . Since , we obtain . This allows a recursive program body to receive a representation of itself.
Here the computation is in the untyped lambda calculus. The self-application would require a simple type satisfying , impossible for finite simple types. Accordingly is not a typed lambda term of the simply typed system. The Strong normalization theorem for simply typed lambda calculus also rules out a universal divergent fixed-point operator there.
To obtain a lambda representation of partial computable functions, encode machine configurations as finite data using Church numerals, Church pairs, and Church Booleans. Initial configuration, one transition, the halting test, and output extraction are primitive recursive functions, represented by lambda terms through the initial functions, composition, and lambda definition of primitive recursion by pair iteration. If these representations are , , , and , defineUse normal-order beta reduction so the Church Boolean halting test selects one branch without evaluating the unused recursive branch. A halting computation follows finitely many transitions and returns the Church numeral of the output. A nonhalting computation forces successive tests forever and has no head normal form; by normal-order normalization theorem, it cannot be beta equivalent to a Church numeral. Thus every partial computable function is represented, with divergence preserved; every total computable function is the halting special case. This explains the role of in computational universality while keeping the typed proof interpretation precise.
Articles by others on the same topic
There are currently no matching articles.