The essence of ML

Standard ML is a useful programming language with polymorphic expressions and a flexible module facility. One notable feature of the expression language is an algorithm which allows type information to be omitted. We study the implicitly-typed expression language by giving a “syntactically isomorphic” explicitly-typed, polymorphic function calculus. Unlike the Girard-Reynolds polymorphic calculus, for example, the types of our ML calculus may be built-up by induction on type levels (universes). For this reason, the pure ML calculus has straightforward set-theoretic, recursion-theoretic and domain-theoretic semantics, and operational properties such as the termination of all recursion-free programs may be proved relatively simply. The signatures, structures, and functors of the module language are easily incorporated into the typed ML calculus, providing a unified framework for studying the major features of the language (including the novel “sharing constraints” on functor parameters). We show that, in a precise sense, the language becomes inconsistent if restrictions imposed by type levels are relaxed. More specifically, we prove that the important programming features of ML cannot be added to any impredicative language, such as the Girard-Reynolds calculus, without implicitly assuming a type of all types.

[1]  Daniel Leivant,et al.  Polymorphic type inference , 1983, POPL '83.

[2]  Luca Cardelli,et al.  A Semantics of Multiple Inheritance , 1984, Inf. Comput..

[3]  David B. MacQueen Modules for standard ML , 1984, LFP '84.

[4]  John C. Mitchell A type-inference approach to reduction properties and semantics of polymorphic expressions (summary) , 1986, LFP '86.

[5]  J. Lambek,et al.  Introduction to higher order categorical logic , 1986 .

[6]  Marvin H. Solomon,et al.  Type definitions with parameters , 1978, POPL.

[7]  David B. MacQueen Using dependent types to express modular structure , 1986, POPL '86.

[8]  John C. Mitchell,et al.  Representation independence and data abstraction , 1986, POPL '86.

[9]  P. Martin-Löf An Intuitionistic Theory of Types: Predicative Part , 1975 .

[10]  de Ng Dick Bruijn,et al.  A survey of the project Automath , 1980 .

[11]  Gordon D. Plotkin,et al.  Call-by-Name, Call-by-Value and the lambda-Calculus , 1975, Theor. Comput. Sci..

[12]  Kim B. Bruce,et al.  The Semantics of Second Order Polymorphic Lambda Calculus , 1984, Semantics of Data Types.

[13]  Per Martin-Löf,et al.  Constructive mathematics and computer programming , 1984 .

[14]  John C. Mitchell,et al.  The Semantics of Second-Order Lambda Calculus , 1990, Inf. Comput..

[15]  John C. Mitchell,et al.  Abstract types have existential types , 1985, POPL.

[16]  A. Troelstra Metamathematical investigation of intuitionistic arithmetic and analysis , 1973 .

[17]  Michael J. C. Gordon,et al.  The denotational description of programming languages - an introduction , 1979 .

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

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

[20]  G.D. Plotkin,et al.  LCF Considered as a Programming Language , 1977, Theor. Comput. Sci..

[21]  Michael J. C. Gordon,et al.  The Denotational Description of Programming Languages , 1979, Springer New York.

[22]  Douglas J. Howe,et al.  Impredicative Strong Existential Equivalent to Type:Type , 1986 .

[23]  Ketan Mulmuley A Semantic Characterization of Full Abstraction for Typed Lambda Calculi , 1984, FOCS.

[24]  Robin Milner,et al.  A Type Discipline for Program Modules , 1987, TAPSOFT, Vol.2.

[25]  Henk Barendregt,et al.  The Lambda Calculus: Its Syntax and Semantics , 1985 .

[26]  P. Martin-Löf Constructive mathematics and computer programming , 1984 .

[27]  Nancy Jean Mccracken,et al.  An investigation of a programming language with a polymorphic type structure. , 1979 .

[28]  Albert R. Meyer,et al.  "Type" is not a type , 1986, POPL '86.

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

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

[31]  Robin Milner,et al.  Fully Abstract Models of Typed lambda-Calculi , 1977, Theor. Comput. Sci..

[32]  Robert Cartwright,et al.  Types as intervals , 1985, POPL.

[33]  John C. Reynolds,et al.  Polymorphism is not Set-Theoretic , 1984, Semantics of Data Types.

[34]  William A. Howard,et al.  The formulae-as-types notion of construction , 1969 .

[35]  Richard Statman,et al.  Logical Relations and the Typed lambda-Calculus , 1985, Inf. Control..

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

[37]  Douglas J. Howe The Computational Behaviour of Girard's Paradox , 1987, LICS.

[38]  Kim B. Bruce,et al.  The Finitary Projection Model for Second Order Lambda Calculus and Solutions to Higher Order Domain Equations , 1986, LICS.

[39]  S. Maclane,et al.  Categories for the Working Mathematician , 1971 .

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

[41]  John C. Reynolds,et al.  Types, Abstraction and Parametric Polymorphism , 1983, IFIP Congress.

[42]  Mitchell Wand,et al.  A types-as-sets semantics for milner-style polymorphism , 1984, POPL.

[43]  Andre Scedrov,et al.  Some Semantic Aspects of Polymorphic Lambda Calculus , 1987, LICS.

[44]  A. Pitts INTRODUCTION TO HIGHER ORDER CATEGORICAL LOGIC (Cambridge Studies in Advanced Mathematics 7) , 1987 .

[45]  Thierry Coquand,et al.  An Analysis of Girard's Paradox , 1986, LICS.

[46]  John C. Mitchell,et al.  Second-Order Logical Relations (Extended Abstract) , 1985, Logic of Programs.

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

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