Free Theorems Simply, via Dinaturality

08/21/2019
by   Janis Voigtländer, et al.
0

Free theorems are a popular tool in reasoning about parametrically polymorphic code. They are also of instructive use in teaching. Their derivation, though, can be tedious, as it involves unfolding a lot of definitions, then hoping to be able to simplify the resulting logical formula to something nice and short. Even in a mechanised generator it is not easy to get the right heuristics in place to achieve good outcomes. Dinaturality is a categorical abstraction that captures many instances of free theorems. Arguably, its origins are more conceptually involved to explain, though, and generating useful statements from it also has its pitfalls. We present a simple approach for obtaining dinaturality-related free theorems from the standard formulation of relational parametricity in a rather direct way. It is conceptually appealing and easy to control and implement, as the provided Haskell code shows.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/10/2020

Dynamic IFC Theorems for Free!

We show that noninterference and transparency, the key soundness theorem...
research
06/24/2021

Consistent ultrafinitist logic

Ultrafinitism postulates that we can only compute on relatively short ob...
research
01/23/2021

Calculating a backtracking algorithm: an exercise in monadic program derivation

Equational reasoning is among the most important tools that functional p...
research
07/15/2020

Preservation Theorems Through the Lens of Topology

In this paper, we introduce a family of topological spaces that captures...
research
04/20/2023

A categorical account of composition methods in logic

We present a categorical theory of the composition methods in finite mod...
research
03/31/2023

Teaching Gödel's incompleteness theorems

The basic notions of logic-predicate logic, Peano arithmetic, incomplete...
research
07/12/2018

Gradual Parametricity, Revisited (with Appendix)

Bringing the benefits of gradual typing to a language with parametric po...

Please sign up or login with your details

Forgot password? Click here to reset