Divergence of F< Type Checking

Abstract System F⩽ is an extension of second-order typed lambda calculus, where a subtype hierarchy among types is defined, and bounded second-order lambda abstraction is allowed. This language is a basis for much of the current research on integration of typed functional languages with subtypes and inheritance. An algorithm to perform type checking for F⩽ expressions has been known since the language Fun was defined. The algorithm has been proved complete, by the author and Curien, which means that it is a semi-decision procedure for the type-checking problem. In this paper we show that this algorithm is not a decision procedure, by exhibiting a term which makes it diverge. This result was the basis of Pierce's proof of undecidability of typing for F⩽. We study the behavior of the algorithm to show that our diverging judgement is in some sense contained in any judgement which makes the algorithm diverge. On the basis of this result, and of other results in the paper, we claim that the chances that the algorithm will loop while type-checking a “real program” are negligible. Hence, the undecidability of F⩽ type-checking should not be considered as a reason to prevent the adoption of F⩽ as a basis for defining programming languages of practical interest. Finally, we show the undecidability of an important subsystem of F⩽.

[1]  Luca Cardelli,et al.  Operations on records , 1989, Mathematical Structures in Computer Science.

[2]  John C. Reynolds,et al.  Towards a theory of type structure , 1974, Symposium on Programming.

[3]  Giorgio Ghelli,et al.  Coherence of Subsumption, Minimum Typing and Type-Checking in F<= , 1992, Math. Struct. Comput. Sci..

[4]  Philip Wadler,et al.  A Syntax for Linear Logic , 1993, MFPS.

[5]  Luca Cardelli,et al.  A Semantic Basis for Quest , 1991, J. Funct. Program..

[6]  J. Y. Girard,et al.  Interpretation fonctionelle et elimination des coupures dans l'aritmetique d'ordre superieur , 1972 .

[7]  Kim B. Bruce The Equivalence of Two Semantic Definitions for Inheritance in Object-Oriented Languages , 1991, MFPS.

[8]  William R. Cook,et al.  A denotational semantics of inheritance , 1989 .

[9]  John C. Mitchell,et al.  F-bounded polymorphism for object-oriented programming , 1989, FPCA.

[10]  Giorgio Ghelli,et al.  Decidability and Confluence of \beta\eta\hboxtop_\le Reduction in F_\le , 1994, Inf. Comput..

[11]  Kim B. Bruce,et al.  A Modest Model of Records, Inheritance and Bounded Quantification , 1990, Inf. Comput..

[12]  Kim B. Bruce,et al.  A modest model of records, inheritance and bounded quantification , 1988, [1988] Proceedings. Third Annual Information Symposium on Logic in Computer Science.

[13]  Giuseppe Castagna,et al.  Decidable bounded quantification , 1994, POPL '94.

[14]  Luca Cardelli,et al.  A semantic basis for quest , 1990, Journal of Functional Programming.

[15]  John C. Mitchell,et al.  An extension of standard ML modules with subtyping and inheritance , 1991, POPL '91.

[16]  John C. Mitchell,et al.  F-bounded quantification for object-oriented programming , 1989 .

[17]  Modelling features of object-oriented languages in , 2022 .

[18]  John C. Mitchell,et al.  Theoretical aspects of object-oriented programming: types, semantics, and language design , 1994, Choice Reviews Online.

[19]  Giorgio Ghelli,et al.  Modelling Features of Object-Oriented Languages in Second Order Functional Languages with Subtypes , 1990, REX Workshop.

[20]  Luca Cardelli,et al.  An Extension of System F with Subtyping , 1991, TACS.

[21]  Kim B. Bruce Safe type checking in a statically-typed object-oriented programming language , 1993, POPL '93.

[22]  Luca Cardelli,et al.  An Extension of System F with Subtyping , 1994, Inf. Comput..

[23]  Luca Cardelli,et al.  On understanding types, data abstraction, and polymorphism , 1985, CSUR.

[24]  Scott Danforth,et al.  Type theories and object-oriented programmimg , 1988, CSUR.

[25]  Giorgio Ghelli,et al.  Coherence of Subsumption , 1990, CAAP.

[26]  John C. Mitchell Toward a typed foundation for method specialization and inheritance , 1989, POPL '90.

[27]  Benjamin C. Pierce,et al.  Object-oriented programming without recursive types , 1993, POPL '93.

[28]  Benjamin C. Pierce,et al.  Bounded quantification is undecidable , 1992, POPL '92.

[29]  Martin Hofmann,et al.  A unifying type-theoretic framework for objects , 1994, Journal of Functional Programming.

[30]  Giorgio Ghelli Recursive Types Are not Conservative over F , 1993, TLCA.