Published online by Cambridge University Press: 29 May 2025
In this chapter we show that the encodings of the previous chapter can be extended to encodings of typed λ-calculi. To do this we have to define translations on types to match those on terms. We analyse the case of the simply-typed λ-calculus in detail, and discuss subtyping and recursive types. For studies of other type systems, see the notes at the end of the Part.
16.1 Typed λ-calculus
In a core simplv-typed λ-calculus, types are built from basic types, such as integers and booleans, using the function type constructor. The syntax of terms is that of the untyped λ-calculus plus basic constants. Each constant has a unique predefined type. We use only constants of basic types: this is sufficient to have a non-empty set of (closed) well-typed terms. This simplv-typed λ-calculus is presented in Table 16.1. We write Λ{c} for the set of terms of the calculus. As usual, function type associates to the right, so T → S → U should be read T → (S → U). Basic types are ranged over by t, basic constants by c. The reduction relation and the reduction strategies are defined as for the untyped calculus; the only difference is that the set of values for a reduction strategy normally contains the constants. We call the typed versions of λV and λN simply-typed call-by-value (λV→) and simply-typed call-by-name (λN→), respectively.
We add the same basic constants and basic types to HOπ and π-calculus and repeat the diagram of Figure 15.1, this time for λV→ and λN→. We show how to extend the encodings of λV and λN (from Sections 15.3 and 15.4), and their correctness results, to take account of types. The encodings in Sections 15.5-15.7 can be extended similarly.
Lemma 16.1.1 In the simplv-typed λ-calculus, for every Γ and M there is at most one T such that Γ M : T .
16.2 The interpretation of typed call-by-value
We begin with the left part of Figure 15.1, which concerns λV We follow a schema similar to that of Section 15.3, pointing out the main additions.
To save this book to your Kindle, first ensure no-reply@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
Find out more about the Kindle Personal Document Service.
To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.
To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.