Type inference with bounded quantification

In this thesis we study some of the problems which occur when type inference is used in a type system with subtyping. An underlying poset of atomic types is used as a basis for our subtyping systems. We argue that the class of Helly posets is of significant interest, as it includes lattices and trees, and is closed under type formation not only with structural constructors such as function space and list, but also records, tagged variants, Abadi-Cardelli object constructors, >, and ⊥. We develop a general theory relating consistency, solvability, and solution of sets of constraints between regular types built over Helly posets with these constructors, and introduce semantic notions of simplification and entailment for sets of constraints over Helly posets of base types. We extend Helly posets with inequalities of the form a 6 τ , where τ is not necessarily atomic, and show how this enables us to deal with bounded quantification. Using bounded quantification we define a subtyping system which combines structural subtype polymorphism and predicative parametric polymorphism, and use this to extend with subtyping the type system of Laufer and Odersky for ML with type annotations. We define a complete algorithm which infers minimal types for our extension, using factorisations, solutions of subtyping problems analogous to principal unifiers for unification problems. We give some examples of typings computed by a prototype implementation.

[1]  Fritz Henglein,et al.  Breaking Through the n3 Barrier: Faster Object Type Inference , 1999, Theory Pract. Object Syst..

[2]  Franois Pottier,et al.  Type Inference and Simplification for Recursively Constrained Types , 1995 .

[3]  Pavel Curtis Constrained qualification in polymorphic type analysis , 1990 .

[4]  Jakob Rehof Minimal typings in atomic subtyping , 1997, POPL '97.

[5]  B. Pierce Programming with intersection types and bounded polymorphism , 1992 .

[6]  Scott F. Smith,et al.  Sound polymorphic type inference for objects , 1995, OOPSLA.

[7]  Martin Odersky,et al.  Type Inference with Constrained Types , 1999, Theory Pract. Object Syst..

[8]  A. J. Kfoury,et al.  A Direct Algorithm for Type Inference in the Rank 2 Fragment of the Second-Order -Calculus , 1993 .

[9]  Martín Abadi,et al.  On subtyping and matching , 1995, TOPL.

[10]  Prateek Mishra,et al.  Polymorphic Subtype Inference: Closing the Theory-Practice Gap , 1989, TAPSOFT, Vol.2.

[11]  Robin Milner,et al.  Principal type-schemes for functional programs , 1982, POPL '82.

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

[13]  Fritz Henglein,et al.  Coinductive Axiomatization of Recursive Type Equality and Subtyping , 1998, Fundam. Informaticae.

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

[15]  Scott F. Smith,et al.  Subtyping Constrained Types , 1996, SAS.

[16]  Luca Cardelli,et al.  Subtyping recursive types , 1991, POPL '91.

[17]  Mariangiola Dezani-Ciancaglini,et al.  An extension of the basic functionality theory for the λ-calculus , 1980, Notre Dame J. Formal Log..

[18]  Fritz Henglein,et al.  The complexity of subtype entailment for simple types , 1997, Proceedings of Twelfth Annual IEEE Symposium on Logic in Computer Science.

[19]  Dale Miller,et al.  Unification Under a Mixed Prefix , 1992, J. Symb. Comput..

[20]  J. Tiuryn Subtyping over a lattice , 1997 .

[21]  M PaulHudakEt,et al.  Report on the programming language haskell: a non-strict , 1992 .

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

[23]  Scott F. Smith,et al.  Type inference for recursively constrained types and its application to OOP , 1995, MFPS.

[24]  Jens Palsberg,et al.  Optimal Representations of Polymorphic Types with Subtyping , 1999, High. Order Symb. Comput..

[25]  Giuseppe Castagna,et al.  Corrigendum: decidable bounded quantification , 1995, POPL '95.

[26]  Jens Palsberg,et al.  Efficient inference of partial types , 1992, Proceedings., 33rd Annual Symposium on Foundations of Computer Science.

[27]  Alain Quilliot An Application of the Helly Property to the Partially Ordered Sets , 1983, J. Comb. Theory, Ser. A.

[28]  John C. Mitchell,et al.  Polymorphic Type Inference and Containment , 1988, Inf. Comput..

[29]  Marcin Benke Efficient Type Reconstruction in the Presence of Inheritance , 1993, MFCS.

[30]  Trevor Jim What are principal typings and what are they good for? , 1996, POPL '96.

[31]  Jerzy Tiuryn Subtype inequalities , 1992, [1992] Proceedings of the Seventh Annual IEEE Symposium on Logic in Computer Science.

[32]  Jerzy Tiuryn,et al.  The subtyping problem for second-order types is undecidable , 1996, Proceedings 11th Annual IEEE Symposium on Logic in Computer Science.

[33]  John C. Mitchell,et al.  Lower bounds on type inference with subtypes , 1995, POPL '95.

[34]  Martín Abadi,et al.  A Theory of Objects , 1996, Monographs in Computer Science.

[35]  Peter Nevermann,et al.  Holes in ordered sets , 1985, Graphs Comb..

[36]  Robin Milner,et al.  Definition of standard ML , 1990 .

[37]  Jerzy Tiuryn,et al.  Satisfiability of Inequalities in a Poset , 1996, Fundam. Informaticae.

[38]  Jens Palsberg,et al.  Constrained types and their expressiveness , 1996, TOPL.

[39]  Satish R. Thatte,et al.  Type Inference with Partial Types , 1988, Theor. Comput. Sci..

[40]  Geoffrey Smith Polymorphic Type Inference with Overloading and Subtyping , 1993, TAPSOFT.

[41]  T. Jim,et al.  Type inference in systems of recursive types with subtyping , 1997 .

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

[43]  Martin Odersky,et al.  Putting type annotations to work , 1996, POPL '96.

[44]  Benjamin C. Pierce,et al.  Simple type-theoretic foundations for object-oriented programming , 1994, Journal of Functional Programming.

[45]  Jens Palsberg,et al.  Efficient recursive subtyping , 1992, POPL '93.

[46]  John C. Reynolds,et al.  Using category theory to design implicit conversions and generic operators , 1980, Semantics-Directed Compiler Generation.