Type Inference with Constrained Types

In this paper we present a general framework HM(X) for Hindley/Milner style type systems with constraints, analogous to the CLP(X) framework in constrained logic programming. We show that the type system is sound with respect to a standard untyped compositional semantics. We present sufficient conditions on the constraint domain X so that the principal types property carries over to HM(X). The conditions turn out to be fairly simple and natural.

[1]  Stefan Kaes Type inference in the presence of overloading, subtyping and recursive types , 1992, LFP '92.

[2]  Fritz Henglein,et al.  Polymorphic Recursion and Subtype Qualifications: Polymorphic Binding-Time Analysis in Polynomial Time , 1995, SAS.

[3]  Geoffrey Smith Polymorphic Type Inference for Languages with Overloading and Subtyping , 1991 .

[4]  Mark P. Jones Simplifying and improving qualified types , 1995, FPCA '95.

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

[6]  Michael J. Maher,et al.  Unification Revisited , 1988, Foundations of Deductive Databases and Logic Programming..

[7]  Robin Milner,et al.  A Theory of Type Polymorphism in Programming , 1978, J. Comput. Syst. Sci..

[8]  Martin Sulzmann Designing Record Systems , 1997 .

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

[10]  John C. Reynolds,et al.  Three Approaches to Type Structure , 1985, TAPSOFT, Vol.1.

[11]  Gordon D. Plotkin,et al.  An ideal model for recursive polymorphic types , 1984, Inf. Control..

[12]  John C. Mitchell,et al.  Coercion and type inference , 1984, POPL.

[13]  J. Palsberg Eecient Inference of Object Types , 1995 .

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

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

[16]  Kim B. Bruce,et al.  PolyTOIL: A Type-Safe Polymorphic Object-Oriented Language , 1995, ECOOP.

[17]  Atsushi Ohori,et al.  A polymorphic record calculus and its compilation , 1995, TOPL.

[18]  Didier Rémy,et al.  Typing record concatenation for free , 1992, POPL '92.

[19]  Michael J. Maher,et al.  Constraint Logic Programming: A Survey , 1994, J. Log. Program..

[20]  François Pottier,et al.  Simplifying subtyping constraints , 1996, ICFP '96.

[21]  Tobias Nipkow,et al.  Type checking type classes , 1993, POPL '93.

[22]  Matthias Felleisen,et al.  A Syntactic Approach to Type Soundness , 1994, Inf. Comput..

[23]  Simon L. Peyton Jones,et al.  Type classes in Haskell , 1994, TOPL.

[24]  Mitchell Wand,et al.  Type inference for record concatenation and multiple inheritance , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

[25]  Paul Hudak,et al.  Parametric type classes , 1992, LFP '92.

[26]  Stephan Merz,et al.  Type checking higher-order polymorphic multi-methods , 1997, POPL '97.

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

[28]  J. A. Robinson,et al.  A Machine-Oriented Logic Based on the Resolution Principle , 1965, JACM.

[29]  Martin Odersky,et al.  A second look at overloading , 1995, FPCA '95.

[30]  Mitchell Wand,et al.  Type inference for record concatenation and multiple inheritance , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

[31]  Geoffrey Smith,et al.  Principal Type Schemes for Functional Programs with Overloading and Subtyping , 1994, Sci. Comput. Program..

[32]  J. Palsberg Efficient Inference of Object Types , 1996 .

[33]  Andrew Kennedy Type Inference and Equational Theories , 1996 .

[34]  Didier Rémy,et al.  Type checking records and variants in a natural extension of ML , 1989, POPL '89.

[35]  Alexander Aiken,et al.  Type inclusion constraints and type inference , 1993, FPCA '93.

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

[37]  Pierre Jouvelot,et al.  The type and effect discipline , 1992, [1992] Proceedings of the Seventh Annual IEEE Symposium on Logic in Computer Science.