Abstract
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.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
Reynolds, J.C.: Types, abstraction and parametric polymorphism. In: IFIP Congress, pp. 513–523 (1983)
Wadler, P.: Theorems for free! In: Functional Programming Languages and Computer Architecture (FPCA), pp. 347–359 (1989)
Morris Jr., J.H.: Types are not sets. In: POPL (1973)
Flatt, M.: PLT MzScheme: Language manual. Technical Report TR97-280, Rice University (1997), http://www.plt-scheme.org/software/mzscheme/
Sumii, E., Pierce, B.: A bisimulation for dynamic sealing. In: POPL (2004)
Matthews, J., Findler, R.B.: Operational semantics for multi-language programs. In: POPL (2007), Extended version: University of Chicago Technical Report TR-2007-8, under review
Ahmed, A.: Step-indexed syntactic logical relations for recursive and quantified types. In: ESOP. pp. 69–83 (2006), Extended version: Harvard University Technical Report TR-01-06, http://ttic.uchicago.edu/~amal/papers/lr-recquant-techrpt.pdf
Findler, R.B., Felleisen, M.: Contracts for higher-order functions. In: ICFP (2002)
Matthews, J., Ahmed, A.: Parametric polymorphism through run-time sealing, or, theorems for low, low prices! (extended version). Technical Report TR-2008-01, University of Chicago (2008)
Findler, R.B., Blume, M.: Contracts as pairs of projections. In: FLOPS (2006)
Pierce, B., Sumii, E.: Relating cryptography and polymorphism. Unpublished manuscript (2000)
Sumii, E., Pierce, B.: Logical relations for encryption. Journal of Computer Security (JSC) 11(4), 521–554 (2003)
Zdancewic, S., Grossman, D., Morrisett, G.: Principals in programming languages. In: ICFP (1999)
Grossman, D., Morrisett, G., Zdancewic, S.: Syntactic type abstraction. ACM Transactions on Programming Languages and Systems 22, 1037–1080 (2000)
Rossberg, A.: Generativity and dynamic opacity for abstract types. In: Miller, D. (ed.) PADL, Uppsala, Sweden, ACM Press, New York (2003), Extended version: http://www.ps.uni-sb.de/Papers/generativity-extended.html
Rossberg, A.: Typed Open Programming – A higher-order, typed approach to dynamic modularity and distribution. Phd thesis, Universität des Saarlandes, Saarbrücken, Germany. Preliminary version (2007)
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 2008 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Matthews, J., Ahmed, A. (2008). Parametric Polymorphism through Run-Time Sealing or, Theorems for Low, Low Prices!. In: Drossopoulou, S. (eds) Programming Languages and Systems. ESOP 2008. Lecture Notes in Computer Science, vol 4960. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-78739-6_2
Download citation
DOI: https://doi.org/10.1007/978-3-540-78739-6_2
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-78738-9
Online ISBN: 978-3-540-78739-6
eBook Packages: Computer ScienceComputer Science (R0)