Hostname: page-component-848d4c4894-wzw2p Total loading time: 0 Render date: 2024-04-30T11:35:18.240Z Has data issue: false hasContentIssue false

Coherence of subsumption, minimum typing and type-checking in F ≤

Published online by Cambridge University Press:  04 March 2009

Pierre-Louis Curien
Affiliation:
LIENS (CNRS), 45 rue d’Ulm, 75230 Paris Cedex 05
Giorgio Ghelli
Affiliation:
Dipartimento di Informatica, Università di Pisa, Corso Italia 40

Abstract

A subtyping relation ≤ between types is often accompanied by a typing rule, called subsumption: if a term a has type T and TU, then a has type U. In presence of subsumption, a well-typed term does not codify its proof of well typing. Since a semantic interpretation is most naturally defined by induction on the structure of typing proofs, a problem of coherence arises: different typing proofs of the same term must have related meanings. We propose a proof-theoretical, rewriting approach to this problem. We focus on F, a second-order lambda calculus with bounded quantification, which is rich enough to make the problem interesting. We define a normalizing rewriting system on proofs, which transforms different proofs of the same typing judgement into a unique normal proof, with the further property that all the normal proofs assigning different types to a given term in a given environment differ only by a final application of the subsumption rule. This rewriting system is not defined on the proofs themselves but on the terms of an auxiliary type system, in which the terms carry complete information about their typing proof. This technique gives us three different results:

— Any semantic interpretation is coherent if and only if our rewriting rules are satisfied as equations.

— We obtain a proof of the existence of a minimum type for each term in a given environment.

— From an analysis of the shape of normal form proofs, we obtain a deterministic typechecking algorithm, which is sound and complete by construction.

Type
Research Article
Copyright
Copyright © Cambridge University Press 1992

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

References

Amadio, R. (1989) Formal theories of inheritance for typed functional languages. Technical Report, Dipartimento di Informatica, Università di Pisa, Pisa, Italy.Google Scholar
Breazu, V., Coquand, T., Gunter, C. and Scedrov, A. (1989) Inheritance and explicit coercion. To appear in Information and Computation, preliminary version in Proc. LICS 89, Monterey, USA, 1989.Google Scholar
Bruce, K. B. and Longo, G. (1990) A modest model of records, inheritance and bounded quantification. Information & Computation 87(1/2) 196240.Google Scholar
Cardelli, L. and Longo, G. (1990) A semantic basis for Quest. SRC Research Report 55. Digital Equipment Corporation, Palo Alto, CA.Google Scholar
Cardelli, L., Martini, S., Mitchell, J. C. and Scedrov, A. (1991) An extension of system F with subtyping. Int. Conf. on Theoretical Aspects of Computer Software, Sendai, Japan, September 91 Springer Lecture Notes in Computer Science. 526.Google Scholar
Cardelli, L. and Wegner, P. (1985) On understanding types, data abstraction and polymorphism. ACM Computing Surveys 17(4).Google Scholar
Curien, P.-L. (1986) Categorical Combinators, Sequential Algorithms and Functional Programming Pitman.Google Scholar
Curien, P.-L. and Di Cosmo, R. (1991) Confluence in the typed λ-calculus extended with surjective pairing and a terminal type. Proc. ICALP 91, Springer Lecture Notes in Computer Science. 526.Google Scholar
Curien, P.-L. and Ghelli, G. (1991) Subtyping+extensionality: confluence of βη top in F . Int Conf. on Theoretical Aspects of Computer Software, Sendai, Japan, September 91, Springer Lecturte Notes in Computer Science. 526.Google Scholar
Ghelli, G. (1990) Proof theoretic studies about a minimal type system integrating inclusion and parametric polymorphism. PhD Thesis, TD-6/90. Università di Pisa, Italy.Google Scholar
Ghelli, G. (1991) On the decidability of type checking for Fun. Unpublished note. Dipartimento di Informatica, Università di Pisa, Pisa, Italy.Google Scholar
Lambek, J. and Scott, P. J. (1986) Introduction to Higher-Order Categorical Logic. Cambridge University Press.Google Scholar
Oles, F. J. (1982) A category theoretic approach to the semantics of programming languages. Syracuse University.Google Scholar
Pierce, B. (1991) Bounded quantification is undecidable, TR CMU-CS-91–161, Carnegie Mellar University.Google Scholar
Reynolds, J. (1991) The coherence of languages with intersection types. Int. Conf. on Theoretical Aspects of Computer Software, Sendai, Japan, September 91, Springer Lecture Notes in Computer Science. 526.Google Scholar