Type Inference with Recursive Types: Syntax and Semantics

Abstract In this paper we study type inference systems for λ-calculus with a recursion operator over types. The main syntactical properties, notably the existence of principal type schemes, are proved to hold when recursive types are viewed as finite notations for infinite (regular) type expressions representing their infinite unfoldings. Exploiting the approximation structure of a model for the untyped language of terms, types are interpreted as limits of sequences of their approximations. We show that the interpretation is essentially unique and that two types have equal interpretation if and only if their infinite unfoldings are identical. Finally, a completeness theorem is proved to hold w.r.t. the specific model we consider for a natural (infinitary) extension of the type inference system.

[1]  Roberto M. Amadio,et al.  Recursion over Realizability Structures , 1991, Inf. Comput..

[2]  Luís Damas Type assignment in programming languages , 1984 .

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

[4]  Mario Coppo,et al.  Type inference and logical relations , 1986, LICS.

[5]  Bruno Courcelle,et al.  The Solutions of Two Star-Height Problems for Regular Trees , 1984, Theor. Comput. Sci..

[6]  B. Courcelle Fundamental properties of infinite trees , 1983 .

[7]  N. P. Mendler Firstand Second-Order Lambda Calculi with Recursive Types , 1986 .

[8]  Gordon D. Plotkin,et al.  An Ideal Model for Recursive Polymorphic Types , 1986, Inf. Control..

[9]  J. Roger Hindley,et al.  Introduction to combinators and λ-calculus , 1986, Acta Applicandae Mathematicae.

[10]  Peter D. Mosses,et al.  Denotational semantics , 1995, LICS 1995.

[11]  Peter D. Mosses,et al.  On Proving Limiting Completeness , 1987, SIAM J. Comput..

[12]  John Mitchell,et al.  Type Inference and Type Containment , 1984, Semantics of Data Types.

[13]  E. Engeler Algebras and combinators , 1981 .

[14]  Dana S. Scott,et al.  Some Domain Theory and Denotational Semantics in Coq , 2009, TPHOLs.

[15]  J. Roger Hindley,et al.  The Completeness Theorem for Typing lambda-Terms , 1983, Theor. Comput. Sci..

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

[17]  Giuseppe Longo,et al.  Set-theoretical models of λ-calculus: theories, expansions, isomorphisms , 1983, Ann. Pure Appl. Log..

[18]  Bruno Courcelle,et al.  The solution of two star height problems for regular trees , 1984, Automata on Infinite Words.

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

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

[21]  Mariangiola Dezani-Ciancaglini,et al.  A filter lambda model and the completeness of type assignment , 1983, Journal of Symbolic Logic.

[22]  James H. Morris,et al.  Lambda-calculus models of programming languages. , 1969 .

[23]  Mario Coppo,et al.  Completeness of Type Assignment in Continuous Lambda Models , 1984, Theor. Comput. Sci..

[24]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

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

[26]  Bruno Courcelle,et al.  Fundamental Properties of Infinite Trees , 1983, Theor. Comput. Sci..

[27]  R. Hindley The Principal Type-Scheme of an Object in Combinatory Logic , 1969 .

[28]  H. B. Curry Modified basic functionality in combinatory logic , 1969 .

[29]  N. P. Mendler,et al.  Recursive Types and Type Constraints in Second-Order Lambda Calculus , 1987, LICS.

[30]  Mario Coppo,et al.  A Completeness Theorem for Recursively Defined Types , 1985, ICALP.

[31]  Christopher P. Wadsworth,et al.  The Relation Between Computational and Denotational Properties for Scott's Dinfty-Models of the Lambda-Calculus , 1976, SIAM J. Comput..