A General Framework for Relational Parametricity

04/30/2018
by   Kristina Sojakova, et al.
0

Reynolds' original theory of relational parametricity was intended to capture the idea that polymorphically typed System F programs preserve all relations between inputs. But as Reynolds himself later showed, his theory can only be formalized in a meta-theory with an impredicative universe, such as the Calculus of Inductive Constructions. Abstracting from Reynolds' ideas, Dunphy and Reddy developed their well-known framework for parametricity that uses parametric limits in reflexive graph categories and aims to subsume a variety of parametric models. As we observe, however, their theory is not sufficiently general to subsume the very model that inspired parametricity, namely Reynolds' original model, expressed inside type theory. To correct this, we develop an abstract framework for relational parametricity that generalizes the notion of a reflexive graph categories and delivers Reynolds' model as a direct instance in a natural way. This framework is uniform with respect to a choice of meta-theory, which allows us to obtain the well-known PER model of Longo and Moggi as a direct instance in a natural way as well. In addition, we offer two novel relationally parametric models of System F: i) a categorical version of Reynolds' model, where types are functorial on isomorphisms and all polymorphic functions respect the functorial action, and ii) a proof-relevant categorical version of Reynolds' model (after Orsanigo), where, additionally, witnesses of relatedness are themselves suitably related. We show that, unlike previously existing frameworks for parametricity, ours recognizes both of these new models in a natural way. Our framework is thus descriptive, in that it accounts for well-known models, as well as prescriptive, in that it identifies abstract properties that good models of relational parametricity should satisfy and suggests new constructions of such models.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
01/02/2019

Parametric Cubical Type Theory

We exhibit a computational type theory which combines the higher-dimensi...
research
09/18/2023

Fixpoint constructions in focused orthogonality models of linear logic

Orthogonality is a notion based on the duality between programs and thei...
research
05/02/2023

Allegories of Symbolic Manipulations

Moving from the mathematical theory of (abstract) syntax, we develop a g...
research
05/22/2020

Internal Parametricity for Cubical Type Theory

We define a computational type theory combining the contentful equality ...
research
03/06/2023

Fixpoint operators for 2-categorical structures

Fixpoint operators are tools to reason on recursive programs and data ty...
research
09/17/2023

Formalizing two-level type theory with cofibrant exo-nat

This study provides some results about two-level type-theoretic notions ...
research
04/12/2021

A meta-theory for big-step semantics

It is well-known that big-step semantics is not able to distinguish stuc...

Please sign up or login with your details

Forgot password? Click here to reset