Abstract
Let S be some type system. A typing in S for a typable term M is the collection of all of the information other than M which appears in the final judgement of a proof derivation showing that M is typable. For example, suppose there is a derivation in S ending with the judgement A ⊢ M: τ meaning that M has result type τ when assuming the types of free variables are given by A. Then (A, τ) is a typing for M. A principal typing in S for a term M is a typing for M which somehow represents all other possible typings in S for M. It is important not to confuse this with a weaker notion in connection with the Hindley/Milner type system often called “principal types”. Previous definitions of principal typings for specific type systems have involved various syntactic operations on typings such as substitution of types for type variables, expansion, lifting, etc.
This paper presents a new general definition of principal typings which does not depend on the details of any particular type system. This paper shows that the new general definition correctly generalizes previous system-dependent definitions. This paper explains why the new definition is the right one. Furthermore, the new definition is used to prove that certain polymorphic type systems using ∀-quantifiers, namely System F and the Hindley/Milner system, do not have principal typings.
All proofs can be found in a longer version available at the author’s home page.
This work was partly supported by EC FP5 grant IST-2001-33477, EPSRC grants GR/L 36963 and GR/R 41545, NATO grant CRG 971607, NSF grants 9806745, 9988529, and 0113193, and Sun Microsystems grant EDUD-7826-990410-US.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
A. Banerjee. A modular, polyvariant, and type-based closure analysis. In Proc. 1997 Int’l Conf. Functional Programming. ACM Press, 1997.
M. Coppo, M. Dezani-Ciancaglini, B. Venneri. Principal type schemes and λ-calculus semantics. In J. P. Seldin, eds. To H. B. Curry: Essays on Combinatory Logic, Lambda Calculus, and Formalism. Academic Press, 1980 Hindley and Seldin [10].
M. Coppo, M. Dezani-Ciancaglini, B. Venneri. Functional characters of solvable terms. Z. Math. Logik Grundlag. Math., 27(1), 1981.
M. Coppo, P. Giannini. A complete type inference algorithm for simple intersection types. In 17th Colloq. Trees in Algebra and Programming, vol. 581 of LNCS. Springer-Verlag, 1992.
H. B. Curry, R. Feys. Combinatory Logic I. Studies in Logic and the Foundations of Mathematics. North-Holland, Amsterdam, 1958.
L. Damas, R. Milner. Principal type schemes for functional programs. In Conf. Rec. 9th Ann. ACM Symp. Princ. of Prog. Langs., 1982.
J.-Y. Girard. Interprétation Fonctionnelle et Elimination des Coupures de l’Arithmétique d’Ordre Supérieur. Thèse d’Etat, Université de Paris VII, 1972.
R. Harper, J. C. Mitchell. On the type structure of Standard ML. ACM Trans. on Prog. Langs. & Systs., 15(2), 1993.
J. R. Hindley. Basic Simple Type Theory, vol. 42 of Cambridge Tracts in Theoretical Computer Science. Cambridge University Press, 1997.
J. R. Hindley, J. P. Seldin, eds. To H. B. Curry: Essays on Combinatory Logic, Lambda Calculus, and Formalism. Academic Press, 1980.
B. Jacobs, I. Margaria, M. Zacchi. Filter models with polymorphic types. Theoret. Comput. Sci., 95, 1992.
T. Jensen. Inference of polymorphic and conditional strictness properties. In POPL’ 98[23].
T. Jim. What are principal typings and what are they good for? Tech. memo. MIT/LCS/TM-532, MIT, 1995.
T. Jim. What are principal typings and what are they good for? In Conf. Rec. POPL’ 96: 23rd ACM Symp. Princ. of Prog. Langs., 1996.
A. J. Kfoury, H. G. Mairson, F. A. Turbak, J. B. Wells. Relating typability and expressibility in finite-rank intersection type systems. In Proc. 1999 Int’l Conf. Functional Programming. ACM Press, 1999.
A. J. Kfoury, J. B. Wells. A direct algorithm for type inference in the rank-2 fragment of the second-order λ-calculus. In Proc. 1994 ACM Conf. LISP Funct. Program., 1994.
A. J. Kfoury, J. B. Wells. Principality and decidable type inference for finite-rank intersection types. In Conf. Rec. POPL’ 99: 26th ACM Symp. Princ. of Prog. Langs., 1999.
D. Leivant. Polymorphic type inference. In Conf. Rec. 10th Ann. ACM Symp. Princ. of Prog. Langs., 1983.
R. Milner. A theory of type polymorphism in programming. J. Comput. System Sci., 17, 1978.
R. Milner, M. Tofte, R. Harper, D. B. MacQueen. The Definition of Standard ML (Revised). MIT Press, 1997.
J. H. Morris. Lambda-calculus Models of Programming Languages. PhD thesis, Massachusetts Institute of Technology, Cambridge, Mass., U.S.A., 1968.
B. Pierce. Bounded quantification is undecidable. Inform. & Comput., 112, 1994.
Conf. Rec. POPL’ 98: 25th ACM Symp. Princ. of Prog. Langs., 1998.
G. Pottinger. A type assignment for the strongly normalizable λ-terms. In J. P. Seldin, eds. To H. B. Curry: Essays on Combinatory Logic, Lambda Calculus, and Formalism. Academic Press, 1980 Hindley and Seldin [10].
J. C. Reynolds. Towards a theory of type structure. In Colloque sur la Programmation, vol. 19 of LNCS, Paris, France, 1974. Springer-Verlag.
S. Ronchi Della Rocca. Principal type schemes and unification for intersection type discipline. Theoret. Comput. Sci., 59(1–2), 1988.
S. Ronchi Della Rocca, B. Venneri. Principal type schemes for an extended type theory. Theoret. Comput. Sci., 28(1–2), 1984.
A. Schubert. Second-order unification and type inference for Church-style polymorphism. In POPL’ 98[23].
P. Urzyczyn. Type reconstruction in Fω. Math. Structures Comput. Sci., 7(4), 1997.
S. J. van Bakel. Intersection Type Disciplines in Lambda Calculus and Applicative Term Rewriting Systems. PhD thesis, Catholic University of Nijmegen, 1993.
S. J. van Bakel. Intersection type assignment systems. Theoret. Comput. Sci., 151(2), 1995.
J. B. Wells. Typability and type checking in the second-order λ-calculus are equivalent and undecidable. In Proc. 9th Ann. IEEE Symp. Logic in Comput. Sci., 1994. Superseded by [34].
J. B. Wells. Typability is undecidable for F+eta. Tech. Rep. 96-022, Comp. Sci. Dept., Boston Univ., 1996.
J. B. Wells. Typability and type checking in System F are equivalent and undecidable. Ann. Pure Appl. Logic, 98(1–3), 1999. Supersedes [32].
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2002 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Wells, J.B. (2002). The Essence of Principal Typings. In: Widmayer, P., Eidenbenz, S., Triguero, F., Morales, R., Conejo, R., Hennessy, M. (eds) Automata, Languages and Programming. ICALP 2002. Lecture Notes in Computer Science, vol 2380. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45465-9_78
Download citation
DOI: https://doi.org/10.1007/3-540-45465-9_78
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-43864-9
Online ISBN: 978-3-540-45465-6
eBook Packages: Springer Book Archive