Correspondence polymorphism for object-oriented languages

Citation
R. Rinat et al., Correspondence polymorphism for object-oriented languages, ACM SIGPL N, 34(10), 1999, pp. 167-186
Citations number
18
Categorie Soggetti
Computer Science & Engineering
Journal title
ACM SIGPLAN NOTICES
ISSN journal
15232867 → ACNP
Volume
34
Issue
10
Year of publication
1999
Pages
167 - 186
Database
ISI
SICI code
1523-2867(199910)34:10<167:CPFOL>2.0.ZU;2-G
Abstract
In this paper we propose a new form of polymorphism for object-oriented lan guages, called correspondence polymorphism It lies in a different dimension than either parametric or subtype polymorphism. In correspondence polymorp hism, some methods are declared to correspond to other methods, via a corre spondence relation. With this relation, it is possible to reuse non-generic code in various type contexts-not necessarily subtyping or matching contex ts-without having to plan ahead for this reuse. Correspondence polymorphism has advantages over other expressive object type systems in that programme r-declared types still may be simple, first-order types that are easily und erstood. We define a simple language LCP that reflects these new ideas, ill ustrating 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.