Correspondence polymorphism for object-oriented languages
Abstract
In this paper we propose a new form of polymorphism for object-oriented languages, called correspondence polymorphism. It lies in a different dimension than either parametric or subtype polymorphism. In correspondence polymorphism, some methods are declared to correspond to other methods, via a correspondence relation. With this relation, it is possible to reuse non-generic code in various type contexts—not necessarily subtyping or matching contexts—without having to plan ahead for this reuse. Correspondence polymorphism has advantages over other expressive object type systems in that programmer-declared types still may be simple, first-order types that are easily understood. We define a simple language LCP that reflects these new ideas, illustrating its behavior with multiple examples. We present formal type rules and an operational semantics for LCP, and establish soundness of the type system with respect to reduction.
References
[1]
A. Abadi and L. Cardelli. A theory of objects. Springer-Verlag, 1996.
[2]
A. Aiken and E. L. Wimmers. Type inclusion constraints and type inference. In Proceedings of the International Conference on Functional Programming Languages and Computer Architecture, pages 31-41, 1993.
[3]
R. Amadio and L. Cardelli. Subtyping recursive types. In Conference Record of the Eighteenth Annual A CM Symposium on Principles of Programming Languages, 1991.
[4]
K. Bruce. Safe type checking in a staticallytyped object-oriented programming language. In Conference Record of the Twentieth Annual A CM Symposium on Principles of Programming Languages, pages 285-298, 1993.
[5]
K. Bruce. Typing in object-oriented languages: achieving expressiveness and safety. Technical report, Williams College, 1996.
[6]
Kim Bruce, Luca Cardelli, Giuseppe Castagna, The Hopkins Objects Group (Jonathan Eifrig, Scott Smith, and Valery Trifonov), Gary T. Leavens, and Benjamin Pierce. On binary methods. Theory and Practice of Object Systems, 1(3):217-238, 1995.
[7]
Kim B. Bruce, Angela Schuett, and Robert van Gent. PolyTOIL: A type-safe polymorphic object-oriented language. In ECOOP '95, 1995.
[8]
Kim B. Bruce and Joseph C. Vanderwaart. Semantic-driven language design: type-safe virtual types in object-oriented languages. In Proceedings o} MFPS 99, Electronic Notes in Theoretical Computer Science, to appear.
[9]
Giuseppe Castagna. Covariance and contravariance: conflict without a cause. A CM Transactions on Programming Languages and Systems, 17(3), 1995.
[10]
J. Eifrig, S. Smith, V. Trifonov, and A. Zwarico. An interpretation of typed OOP in a language with state. Lisp and Symbolic Computation, 8(4):357-397, 1995.
[11]
Jonathan Eifrig, Scott Smith, and Valery Trifonov. Sound polymorphic type inference for objects. In OOPSLA '95, pages 169-184, 1995.
[12]
Jonathan Eifrig, Scott Smith, Valery Trifonov, and Amy Zwarico. Application of OOP type theory: State, decidability, integration. In OOPSLA '94, pages 16-30, 1994.
[13]
O. Madsen and B. Moller-Pedersen. Virtual classes: a powerful mechanism in objectoriented programming. In OOPSLA '89 conference proceedings, A CM SIGPLAN Notices, 24(10), 1998.
[14]
B. Meyer. Eiffel, the Language. Prentice Hall, 1992.
[15]
B. Meyer. Object-Oriented Software Construction, 2nd edition. Prentice Hall, 1997.
[16]
J. Palsberg and M. Schwartzbach. Object- Oriented Type Systems. Wiley, 1994.
[17]
R. Rinat and M. Magidor. Metaphoric polymorphism: taking code reuse one step further. In LNCS Vol. 1098: ECOOP '96 conference proceedings. Springer-Verlag, 1996.
[18]
Kresten Krab Thorup. Genericity in java with virtual types. In LNCS Vol. 1241: ECOOP '97 conference proceedings. Springer-Verlag, 1997.
Index Terms
- Correspondence polymorphism for object-oriented languages
Recommendations
Correspondence polymorphism for object-oriented languages
OOPSLA '99: Proceedings of the 14th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applicationsIn this paper we propose a new form of polymorphism for object-oriented languages, called correspondence polymorphism. It lies in a different dimension than either parametric or subtype polymorphism. In correspondence polymorphism, some methods are ...
Comments
Information & Contributors
Information
Published In
![cover image ACM SIGPLAN Notices](/cms/asset/2c52c467-cb9b-4f9e-b5c3-b5eeccf9063f/3393934.cover.jpg)
Oct. 1999
460 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/320385
- Chairman:
- Brent Hailpern,
- Editors:
- A. Michael Berman,
- Linda M. Northrop
- October 1999462 pagesISBN:1581132387DOI:10.1145/320384
- Chairmen:
- Brent Hailpern,
- Linda M. Northrop,
- Editor:
- A. Michael Berman
Copyright © 1999 ACM.
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]
Publisher
Association for Computing Machinery
New York, NY, United States
Publication History
Published: 01 October 1999
Published in SIGPLAN Volume 34, Issue 10
Check for updates
Qualifiers
- Article
Contributors
Other Metrics
Bibliometrics & Citations
Bibliometrics
Article Metrics
- 0Total Citations
- 520Total Downloads
- Downloads (Last 12 months)33
- Downloads (Last 6 weeks)6
Reflects downloads up to 10 Aug 2024
Other Metrics
Citations
View Options
Get Access
Login options
Check if you have access through your login credentials or your institution to get full access on this article.
Sign in