Hostname: page-component-77f85d65b8-8v9h9 Total loading time: 0 Render date: 2026-03-29T04:23:10.388Z Has data issue: false hasContentIssue false

Non-parametric parametricity

Published online by Cambridge University Press:  07 September 2011

GEORG NEIS
Affiliation:
Max Planck Institute for Software Systems (MPI-SWS), Campus E1.4, 66123 Saarbrücken, Germany (e-mails: neis@mpi-sws.org, dreyer@mpi-sws.org, rossberg@mpi-sws.org)
DEREK DREYER
Affiliation:
Max Planck Institute for Software Systems (MPI-SWS), Campus E1.4, 66123 Saarbrücken, Germany (e-mails: neis@mpi-sws.org, dreyer@mpi-sws.org, rossberg@mpi-sws.org)
ANDREAS ROSSBERG
Affiliation:
Max Planck Institute for Software Systems (MPI-SWS), Campus E1.4, 66123 Saarbrücken, Germany (e-mails: neis@mpi-sws.org, dreyer@mpi-sws.org, rossberg@mpi-sws.org)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

Type abstraction and intensional type analysis are features seemingly at odds—type abstraction is intended to guarantee parametricity and representation independence, while type analysis is inherently non-parametric. Recently, however, several researchers have proposed and implemented “dynamic type generation” as a way to reconcile these features. The idea is that, when one defines an abstract type, one should also be able to generate at runtime a fresh type name, which may be used as a dynamic representative of the abstract type for purposes of type analysis. The question remains: in a language with non-parametric polymorphism, does dynamic type generation provide us with the same kinds of abstraction guarantees that we get from parametric polymorphism?

Our goal is to provide a rigorous answer to this question. We define a step-indexed Kripke logical relation for a language with both non-parametric polymorphism (in the form of type-safe cast) and dynamic type generation. Our logical relation enables us to establish parametricity and representation independence results, even in a non-parametric setting, by attaching arbitrary relational interpretations to dynamically generated type names. In addition, we explore how programs that are provably equivalent in a more traditional parametric logical relation may be “wrapped” systematically to produce terms that are related by our non-parametric relation, and vice versa. This leads us to develop a “polarized” variant of our logical relation, which enables us to distinguish formally between positive and negative notions of parametricity.

Information

Type
Articles
Copyright
Copyright © Cambridge University Press 2011
Submit a response

Discussions

No Discussions have been published for this article.