Thread View: fj.mail-lists.types
1 messages
1 total messages
Started by bcp
Tue, 04 Aug 1992 14:42
Coherence and polymorphic instantiation
Author: bcp
Date: Tue, 04 Aug 1992 14:42
Date: Tue, 04 Aug 1992 14:42
54 lines
2279 bytes
2279 bytes
Date: Mon, 03 Aug 92 14:26:36 +0100
In the course of experimenting with adding some polymorphic constants
to the second-order polymorphic lambda-calculus with subtyping (Fsub),
we were led to wonder what kind of equational properties should be
imposed to express compatibility between polymorphic instantiation and
subtyping.
To see the issue, consider the polymorphic type
T = All(A) F(A) -> G(A)
where both F and G are monotone type operators. If we have f:T,
X<X', and x:F(X), then f can be applied to x in two ways:
f [X] x
f [X'] x
We can now ask whether these two terms are equal elements of G(X') --
or more explicitly, whether
[G(X) < G(X')] (f [X] x)
= f [X'] ([F(X) < F(X')] x)
: G(X')
where [S<T] denotes the coercion from S to T.
This equation holds trivially in untyped models and also, it seems,
for definable polymorphic terms. It becomes interesting in typed
models, however, when polymorphic constants are added. For example,
if we add a base type Bool and a constant
if : All(A) Bool->A->A->A
then it seems natural to require that:
b : Bool X < X' x1, x2 : X
-----------------------------------------
(if [X] b x1 x2) = (if [X'] b x1 x2) : X'
More generally, we might require that *every* well-typed equation
whose type-erasure is a syntactic identity should hold in the typed
model. This is stronger than the usual coherence condition, which
only addresses differences in denotations arising from different ways
of reconstructing coercions in a single explicitly typed term.
We wonder whether this stronger sort of coherence property has ever
been considered in the literature, or whether there are reasonable
examples for which it would be undesirable. (It seems that such a
situation could only arise in a non-parametric model.)
Martin Hofmann
Benjamin Pierce
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads