Hostname: page-component-586b7cd67f-tf8b9 Total loading time: 0 Render date: 2024-11-25T04:33:12.087Z Has data issue: false hasContentIssue false

Proofs for free

Parametricity for dependent types

Published online by Cambridge University Press:  30 March 2012

JEAN-PHILIPPE BERNARDY
Affiliation:
Chalmers University of Technology & University of Gothenburg, Sweden (e-mail: [email protected], [email protected])
PATRIK JANSSON
Affiliation:
Chalmers University of Technology & University of Gothenburg, Sweden (e-mail: [email protected], [email protected])
ROSS PATERSON
Affiliation:
City University, London, UK (e-mail: [email protected])
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.

Reynolds' abstraction theorem (Reynolds, J. C. (1983) Types, abstraction and parametric polymorphism, Inf. Process.83(1), 513–523) shows how a typing judgement in System F can be translated into a relational statement (in second-order predicate logic) about inhabitants of the type. We obtain a similar result for pure type systems (PTSs): for any PTS used as a programming language, there is a PTS that can be used as a logic for parametricity. Types in the source PTS are translated to relations (expressed as types) in the target. Similarly, values of a given type are translated to proofs that the values satisfy the relational interpretation. We extend the result to inductive families. We also show that the assumption that every term satisfies the parametricity condition generated by its type is consistent with the generated logic.

Type
Articles
Copyright
Copyright © Cambridge University Press 2012

References

Abadi, M., Cardelli, L. & Curien, P. (1993) Formal parametric polymorphism. In Proceedings of POPL'93 (Charleston, SC). New York: ACM, pp. 157170.CrossRefGoogle Scholar
Barendregt., H. P. (1992) Lambda calculi with types. Handbook Log. Comput. Sci. 2, 117309.Google Scholar
Bernardy, J.-P. (2010) Lightweight free theorems: Agda library. Accessed March 13, 2012. Available at: http://wiki.portal.chalmers.se/agda/agda.php?n=Libraries.LightweightFreeTheoremsGoogle Scholar
Bernardy, J.-P., Jansson, P. & Paterson, R. (2010) Parametricity and dependent types. In Proceedings of ICFP 2010 (Baltimore, MD, September 27–29). New York: ACM, pp. 345356.Google Scholar
Bernardy, J.-P. & Lasson, M. (2011) Realizability and parametricity in pure type systems. In the Proceedings of FoSSaCS 2011 (Saarbruecken, Germany, March 26–April 3), Hofmann, M. (ed), LNCS, vol. 6604. Berlin, Germany: Springer-Verlag, pp. 108122.Google Scholar
Böhm, C. & Berarducci, A. (1985) Automatic synthesis of typed lambda-programs on term algebras. Theor. Comp. Sci. 39 (2–3), 135154.CrossRefGoogle Scholar
Böhme, S. (2007) Free Theorems for Sublanguages of Haskell. Master's thesis, Technische Universität Dresden, Netherlands.Google Scholar
Church, A. (1940) A formulation of the simple theory of types. J. Symb. Log. 5 (2), 5668.CrossRefGoogle Scholar
Coquand, T. (1986) An analysis of Girard's paradox. In Logic in Computer Science, Meyer, A. R. & Chandra, A. K. (eds), Piscataway, NJ: IEEE, pp. 227236.Google Scholar
Coquand, T. (1992) Pattern matching with dependent types. In the Proceedings of the Workshop on Types for Proofs and Programs (Torino, Italy), pp. 6679.Google Scholar
Dybjer, P. (1994) Inductive families. Form. Asp. Comput. 6 (4), 440465.CrossRefGoogle Scholar
Gibbons, J. & Paterson, R. (2009) Parametric data-type genericity. In the Proceedings of WGP 2009 (Edinburgh, UK, August 30) New York: ACM, pp. 8593.Google Scholar
Girard, J.-Y. (1972) Interprétation Fonctionnelle et Elimination Des Coupures de L'arithmétique D'ordre Supérieur, Thèeses d'état, Université de Paris, Paris, France.Google Scholar
Hofmann, M. & Streicher, T. (1996) The groupoid interpretation of type theory. In Venice Festschrift, Sambin, G. & Smith, J. (eds), Oxford, UK: Oxford University Press, pp. 83111.Google Scholar
Johann, P. & Voigtländer, J. (2006) The impact of seq on free theorems-based program transformations. Fundam. Inf. 69 (1–2), 63102.Google Scholar
Mairson, H. (1991) Outline of a proof theory of parametricity. In the Proceedings of FPCA 1991 (Cambridge, MA, August 26–30), LNCS, vol. 523. New York: Springer-Verlag, pp. 313327.Google Scholar
McBride, C. & McKinna, J. (2004) The view from the left. J. Funct. Program. 14 (01), 69111.CrossRefGoogle Scholar
Miquel, A. (2001) Le Calcul des Constructions Implicite: Syntaxe et Sémantique. Theèses de Doctorat, Université Paris, Paris, France.Google Scholar
Monnier, S. & Haguenauer, D. (2010) Singleton types here, singleton types there, singleton types everywhere. In the Proceedings of PLPV 2010 (Madrid, Spain, January 19). New York: ACM, pp. 18.Google Scholar
Morris, P. & Altenkirch, T. (2009) Indexed containers. In the Proceedings of the Twenty-Fourth IEEE Symposium on Logic in Computer Science. Piscataway, NJ: IEEE, pp. 277285.Google Scholar
Neis, G., Dreyer, D. & Rossberg, A. (2009) Non-parametric parametricity. In Proceedings of ICFP 2009 (Los Angeles, August). New York: ACM, pp. 135148.Google Scholar
Norell, U. (2007) Towards a Practical Programming Language Based on Dependent Type Theory. PhD thesis, Chalmers Tekniska Högskola, Gothenburg, Sweden.Google Scholar
Oury, N. & Swierstra, W. (2008) The power of Pi. In the Proceedings of ICFP 2008 (Victoria, BC, Canada, September 20–28). New York: ACM, pp. 3950.Google Scholar
Paulin-Mohring, C. (1993) Inductive definitions in the system Coq – rules and properties. In Typed Lambda Calculi and Applications, Bezem, M. & Groote, J. F. (eds), Berlin, Germany: Springer pp. 328345.CrossRefGoogle Scholar
Plotkin, G. & Abadi, M. (1993) A logic for parametric polymorphism. In the Proceedings of TLCA '93, (Utrecht, The Netherlands, March 16–18), LNCS, vol. 664. Berlin, Germany: Springer, pp. 361375.Google Scholar
Pouillard, N. (2011) Nameless, painless. In the Proceedings of the 16th ACM SIGPLAN International Conference on Functional Programming, ICFP '11 (Tokyo, Japan, September 19–21). New York: ACM, pp. 320332.Google Scholar
Reynolds, J. C. (1983) Types, abstraction and parametric polymorphism. Inf. Process. 83 (1), 513523.Google Scholar
The Coq Development Team. (2010) The Coq Proof Assistant. Reference manual. Available at: http://www.coq.inria.fr/docGoogle Scholar
Voigtländer, J. (2009) Free theorems involving type constructor classes: Funct. pearl. In the Proceedings of the 14th ACM SIGPLAN International Conference on Functional Programming (Edinburgh, UK, August 31–September 2). New York: ACM, pp. 173184.CrossRefGoogle Scholar
Vytiniotis, D. & Weirich, S. (2010) Parametricity, type equality, and higher-order polymorphism. J. Funct. Program. 20 (02), 175210.CrossRefGoogle Scholar
Wadler, P. (1989) Theorems for free! In the Proceedings of FPCA 1989 (London, UK, September 11–13). New York: ACM, pp. 347359.Google Scholar
Wadler, P. (2007) The Girard–Reynolds isomorphism. Theor. Comp. Sci. 375 (1–3), 201226.CrossRefGoogle Scholar
Wadler, P. & Blott, S. (1989) How to make ad-hoc polymorphism less ad hoc. In the Proceedings of POPL'89 (Austin, TX, January 11–13). New York: ACM, pp. 6076.Google Scholar
Submit a response

Discussions

No Discussions have been published for this article.