计算机科学 > 程序设计语言
[提交于 2019年8月21日]
标题:Free Theorems Simply, via Dinaturality
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要: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.
提交历史
来自:Janis Voigtländer[v1] 2019年8月21日 星期三 10:16:16 UTC