Book contents
- Frontmatter
- Contents
- Introduction
- 1 The type-free λ-calculus
- 2 Assigning types to terms
- 3 The principal-type algorithm
- 4 Type assignment with equality
- 5 A version using typed terms
- 6 The correspondence with implication
- 7 The converse principal-type algorithm
- 8 Counting a type's inhabitants
- 9 Technical details
- Answers to starred exercises
- Bibliography
- Table of principal types
- Index
8 - Counting a type's inhabitants
Published online by Cambridge University Press: 02 December 2009
- Frontmatter
- Contents
- Introduction
- 1 The type-free λ-calculus
- 2 Assigning types to terms
- 3 The principal-type algorithm
- 4 Type assignment with equality
- 5 A version using typed terms
- 6 The correspondence with implication
- 7 The converse principal-type algorithm
- 8 Counting a type's inhabitants
- 9 Technical details
- Answers to starred exercises
- Bibliography
- Table of principal types
- Index
Summary
Given a type τ, how many closed terms can receive type τ in TAλ? As stated this question is trivial, since if the answer is not zero it is always infinite; for example the type a→a can be assigned to all members of the sequence I, II, III, etc. But if we change the question to ask only for terms in normal form, the answer is often finite and interesting patterns show up which are still not completely understood.
The aim of this chapter is to describe an algorithm from Ben-Yelles 1979 that answers the “how many” question for normal forms. For each τ it will decide in a finite number of steps whether the number of closed β-normal forms that receive type τ is finite or infinite, will compute this number in the finite case, and will list all the relevant terms in both cases.
Ben-Yelles' algorithm can be used in particular to test whether the number of terms with type τ is zero or not, and as mentioned in 6B7.3 this gives a test for provability in Intuitionist implicational logic.
The first section below will describe the sets to be counted. The next will show some examples of the algorithm's strategy in action. Then in 8C–D the algorithm will be stated formally, and the rest of the chapter will be occupied by a proof that the algorithm does what it claims to do.
Inhabitants
This section gives precise definitions and notations for the sets to be counted.
- Type
- Chapter
- Information
- Basic Simple Type Theory , pp. 108 - 139Publisher: Cambridge University PressPrint publication year: 1997