| | |
Summary: Subtyping and Parametricity
Gordon Plotkin \Lambda Mart'in Abadi y Luca Cardelli y
Abstract
In this paper we study the interaction of subtyping
and parametricity. We describe a logic for a program
ming language with parametric polymorphism and sub
typing. The logic supports the formal definition and
use of relational parametricity. We give two models
for it, and compare it with other formal systems for the
same language. In particular, we examine the ``Penn
interpretation'' of subtyping as implicit coercion.
Without subtyping, parametricity yields, for exam
ple, an encoding of abstract types and of initial alge
bras, with the corresponding proof principles of simu
lation and induction. With subtyping, we obtain par
tially abstract types and certain initial ordersorted al
gebras, and may derive proof principles for them.
1 Introduction
A function is polymorphic if it works on inputs
of several types. We may distinguish various no
|