A simple proof technique for certain parametricity results

Many properties of parametric, polymorphic functions can be determined simply by inspection of their types. Such results are usually proven using Reynolds's parametricity theorem. However, Reynolds's theorem can be difficult to show in some settings, particularly ones involving computational effects. I present an alternative technique for proving some parametricity results. This technique is considerably simpler and easily generalizes to effectful settings. It works by instantiating polymorphic functions with singleton types that fully specify the behavior of the functions. Using this technique, I show that callers' stacks are protected from corruption during function calls in Typed Assembly Language programs.

[1]  Luca Cardelli,et al.  An Extension of System F with Subtyping , 1991, TACS.

[2]  John C. Reynolds,et al.  Types, Abstractions, and Parametric Polymorphism, Part 2 , 1991, MFPS.

[3]  Peter W. O'Hearn,et al.  Parametricity and local variables , 1995, JACM.

[4]  David Walker,et al.  Stack-based typed assembly language , 1998, Journal of Functional Programming.

[5]  Christopher Strachey,et al.  Fundamental Concepts in Programming Languages , 2000, High. Order Symb. Comput..

[6]  QingMing Ma,et al.  Parametricity as subtyping , 1992, POPL '92.

[7]  David Walker,et al.  From System F to Typed Assembly Language (Extended Version) , 1997 .

[8]  Joyce L. Vedral,et al.  Functional Programming Languages and Computer Architecture , 1989, Lecture Notes in Computer Science.

[9]  Andrew Kennedy,et al.  Relational parametricity and units of measure , 1997, POPL '97.

[10]  Matthias Felleisen,et al.  A Syntactic Approach to Type Soundness , 1994, Inf. Comput..

[11]  Martín Abadi,et al.  A Logic for Parametric Polymorphism , 1993, TLCA.

[12]  Martín Abadi,et al.  Subtyping and parametricity , 1994, Proceedings Ninth Annual IEEE Symposium on Logic in Computer Science.

[13]  John C. Reynolds,et al.  Types, Abstraction and Parametric Polymorphism , 1983, IFIP Congress.

[14]  Philip Wadler,et al.  Theorems for free! , 1989, FPCA.