Realizability and Compositional Compiler Correctness for a Polymorphic Language
We construct operationally-based realizability relations between phrases in a language with both universal and existential types and programs for a variant SECD machine. The relations, defined using parametricity, biorthogonality and step-indexing, give extensional and compositional specifications of when low-level code and values realize typed source-level terms. We prove full functional correctness of a compiler in terms of these relations and show how they also justify both source-level transformations and the linking of compiled code with hand-optimized code fragments that exploit non-parametric and non-functional low-level operations whilst being extensionally well behaved. The definitions and results have been fully formalized in Coq.