A polymorphic record calculus and its compilation
- 30 November 1995
- journal article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Programming Languages and Systems
- Vol. 17 (6) , 844-895
- https://doi.org/10.1145/218570.218572
Abstract
Compilation method for a calculus with those labeled data structures. We define a second-order, polymorphic record calculus as an extension of Girard-Reynolds polymorphic lambda calculus. We then develop an ML-style type inference algorithm for a predicative subset of the second-order record calculus. The soundness of the type system and the completeness of the type inference algorithm are shown. These results extend Milner's type inference algorithm, Damas and Milner's account of ML's let polymorphism, and Harper and Mitchell's analysis on XML. To establish an ecient compilation method for the polymorphic record calculus, we first define an implementation calculus, where records are repre- sented as vectors whose elements are accessed by direct indexing, and variants are represented as values tagged with a natural number indicating the position in the vector of functions in a switch statement. We then develop an algorithm to translate the polymorphic record calculus into the implementation calculus using type information obtained by the type inference algorithm. The correctness of the compilation algorithm is proved; that is, the compilation algorithm is shown to preserve both typing and the operational behavior of a program. Based on these results, Standard ML has been extended with labeled records, and its compiler has been implemented.Keywords
This publication has 21 references indexed in Scilit:
- A theory of type polymorphism in programmingPublished by Elsevier ,2003
- Polymorphism and type inference in database programmingACM Transactions on Database Systems, 1996
- Tag-free garbage collection using explicit type parametersACM SIGPLAN Lisp Pointers, 1994
- On the type structure of standard MLACM Transactions on Programming Languages and Systems, 1993
- Complete sets of transformations for general E-unificationTheoretical Computer Science, 1989
- An object addressing mechanism for statically typed languages with multiple inheritanceACM SIGPLAN Notices, 1989
- Extensional models for polymorphismTheoretical Computer Science, 1988
- On understanding types, data abstraction, and polymorphismACM Computing Surveys, 1985
- Fundamental properties of infinite treesTheoretical Computer Science, 1983
- Extendible hashing—a fast access method for dynamic filesACM Transactions on Database Systems, 1979