Syntactic logical relations for System F with recursive types and call-by-name semantics
Tex Aston Felix Schönlank
Abstract:
We consider the second-order typed lambda calculus with full, or impredicative, polymorphism—i.e. System F—and contravariant iso-recursive types. (This language also appears under
the names λ∀μ and F^μ.) We equip it with call-by-name operational semantics.
Appel and McAllester devised a logical relations-based model for this language—minus the polymorphism—under call-by-value semantics. Their goal was to obtain a relation that was sound w.r.t. contextual equivalence. The problem of type recursion was addressed by introducing a step index.
Ahmed expanded upon Appel-McAllester’s work on these step-indexed logical relations by adding universally and existentially quantified types. They also adapted the model and proved its transitivity, soundness, and completeness.
We in turn adapt part of Ahmed’s work to our language: we leave out the existential types and transpose the definitions and theorems from Ahmed’s call-by-value to our call-by-name semantics. Transitivity of our semantic model remains an open problem and no attempt is made to obtain completeness. The key contribution of this thesis, then, is an analogue of Ahmed’s soundness proof. We show that our semantic model for a call-by-name language is sound w.r.t. contextual equivalence. This yields the following proof technique in our language: in order to prove that two terms or programs e, e' are contextually equivalent, one need only show that they are related in the semantics.
The use of this proof technique is further discussed. Free theorems in the style of Wadler are investigated. The obvious theorems turn out not to hold because of non-termination, a product of contravariant recursive types. We find that we can manually adjust the statements for non-termination such that they do hold, but find no general means of making these adjustments.