PER models of subtyping, recursive types and higher-order polymorphism

We relate standard techniques for solving recursive domain equations to previous models with types interpreted as partial equivalence relations (per's) over a Dm lambda model. This motivates a particular choice of type functions, which leads to an extension of, such models to higher-order polymorphism. The resulting models provide natural interpretations for function spaces, records, recursively defined types, higher-order type functions, and bounded polymor-phic types Y-X <: Y. A where the bound may be of a higher kind. In particular, we may combine recursion and polymorphism in a way that allows the bound Y in VX <: Y. A to be recursive y defined. The model may also be used to interpret so-called " F-bounded polymorphism. " Together, these features allolv us to represent several forms of type and type functions that seem to arise naturally in typed object-oriented programming. 1 Introduction In type systems aimed towards object-oriented programming , several typing ideas naturally arise. The most basic are subtyping, the fact that values of one type may be treated as values of another, polymor-phism, and recursively defined types. the Powell Foundation. t s~lpported in part by an NSF PYI Award, matching funds from Digital Equipment Corporation, the Powell Foundation, and Xerox Corporation NSF grant CCR-881 4921 and the Wal-lace F. and Lucille M. Davis Faculty Scholarship. Pennksion to copy without fee all or part of this material is granted provided that tie copies are not made or distributed for direct commercial advantage, the ACM copyright notice and the title of tbe publication and its date appear, and notice is given that copying is by permission of tbe Association for Computing Machinery. To copy otherwise , or to republish, requires a fee sad/or specific permission. the existing, implemented type systems for object-oriented languages have notable errors (see, [CO089]), it is important to prove the soundness of these type systems. The primary technique for doing so is by constructing a selmantic model. A class of semantic models for languages with subtyp-ing, polymorphism and recursion are developed in [Cop85, Ama91, Car89, AP90]. These models all interpret types as partial equivalence relations (per's) over suitable Dm structures obtained by the so-called " inverse limit') construction. The main contributions of this paper are to provide a general framework for understanding type recursion in these models and to extend per models to higher-order type functions and additional forms of polymorphism. Since the use of per's over …

[1]  Luca Cardelli,et al.  A Semantics of Multiple Inheritance , 1984, Information and Computation.

[2]  Luca Cardelli,et al.  Operations on Records , 1989, Mathematical Foundations of Programming Semantics.

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

[4]  Thierry Coquand,et al.  Inheritance and explicit coercion , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

[5]  Jerzy Tiuryn,et al.  Computational consequences and partial solutions of a generalized unification problem , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

[6]  Martín Abadi,et al.  A PER model of polymorphism and recursive types , 1990, [1990] Proceedings. Fifth Annual IEEE Symposium on Logic in Computer Science.

[7]  Thierry Coquand,et al.  Inheritance as Implicit Coercion , 1991, Inf. Comput..

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

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

[10]  John C. Mitchell,et al.  F-bounded quantification for object-oriented programming , 1989 .

[11]  William R. Cook,et al.  A Proposal for Making Eiffel Type-Safe , 1989, Comput. J..

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

[13]  Felice Cardone,et al.  Relational Semantics for Recursive Types and Bounded Quantification , 1989, ICALP.

[14]  Jan van Leeuwen,et al.  Handbook of Theoretical Computer Science, Vol. B: Formal Models and Semantics , 1994 .

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

[16]  William R. Cook,et al.  Inheritance is not subtyping , 1989, POPL '90.

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

[18]  Luca Cardelli,et al.  A semantic basis for quest , 1990, Journal of Functional Programming.

[19]  Val Tannen,et al.  Computing with coercions , 1990, LISP and Functional Programming.

[20]  John C. Mitchell,et al.  Type Systems for Programming Languages , 1991, Handbook of Theoretical Computer Science, Volume B: Formal Models and Sematics.

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

[22]  Kim B. Bruce,et al.  A modest model of records, inheritance and bounded quantification , 1988, [1988] Proceedings. Third Annual Information Symposium on Logic in Computer Science.

[23]  Gordon D. Plotkin,et al.  The category-theoretic solution of recursive domain equations , 1977, 18th Annual Symposium on Foundations of Computer Science (sfcs 1977).

[24]  John C. Mitchell Toward a typed foundation for method specialization and inheritance , 1989, POPL '90.

[25]  Alan Mycroft,et al.  Polymorphic Type Schemes and Recursive Definitions , 1984, Symposium on Programming.

[26]  Carl A. Gunter,et al.  Semantic Domains , 1991, Handbook of Theoretical Computer Science, Volume B: Formal Models and Sematics.

[27]  Kim B. Bruce,et al.  A Modest Model of Records, Inheritance and Bounded Quantification , 1990, Inf. Comput..

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