We show how to extend System F's parametricity guarantee to a Matthews-Findler-style multi-language system that combines System F with an untyped language by use of dynamic sealing. While the use of sealing for this purpose has been suggested before, it has never been proven to preserve parametricity. In this paper we prove that it does using step-indexed logical relations. Using this result we show a scheme for implementing parametric higher-order contracts in an untyped setting which corresponds to a translation given by Sumii and Pierce. These contracts satisfy rich enough guarantees that we can extract analogues to Wadler's free theorems that rely on run-time enforcement of dynamic seals. © 2008 Springer-Verlag Berlin Heidelberg.
CITATION STYLE
Matthews, J., & Ahmed, A. (2008). Parametric polymorphism through run-time sealing or, theorems for low, low prices! In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) (Vol. 4960 LNCS, pp. 16–31). https://doi.org/10.1007/978-3-540-78739-6_2
Mendeley helps you to discover research relevant for your work.