Correspondence polymorphism for object-oriented languages

  • Authors:
  • Ran Rinat;Menachem Magidor;Scott F. Smith

  • Affiliations:
  • Institute of Computer Science, Hebrew University, Israel;Institute of Mathematics, Hebrew University, Israel;Department of Computer Science, The Johns Hopkins University

  • Venue:
  • Proceedings of the 14th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
  • Year:
  • 1999

Quantified Score

Hi-index 0.00

Visualization

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.