论文标题

ML家庭语言的自动差异:通过逻辑关系正确性

Automatic Differentiation for ML-family languages: correctness via logical relations

论文作者

Nunes, Fernando Lucatelli, Vákár, Matthijs

论文摘要

我们为具有术语和类型递归的语言提供了一种简单,直接和可重复使用的逻辑关系技术,并部分定义了可区分的功能。我们通过确定自动分化(AD)正确性的情况来证明这一点:即,我们为ML家庭中现实的功能语言提供了双数字样式AD代码转换的正确性证明。我们还展示了该代码转换如何为我们提供正确的前向模式和反向模式AD。 起点是将功能性编程语言解释为合适的自由生成的分类结构。在这种情况下,通过句法分类结构的通用属性,双数AD代码转换和基本的$ω$ -CPO语义作为结构保留函数。然后,通过新颖的逻辑关系论证来证明证据。 我们大部分贡献的关键是一种强大的术语递归和递归类型的逻辑关系技术。它为我们提供了基于代表语义的简单方法的语义正确性证明,仅利用$ω$ -CPOS的非常基本的混凝土模型。

We give a simple, direct and reusable logical relations technique for languages with term and type recursion and partially defined differentiable functions. We demonstrate it by working out the case of Automatic Differentiation (AD) correctness: namely, we present a correctness proof of a dual numbers style AD code transformation for realistic functional languages in the ML-family. We also show how this code transformation provides us with correct forward- and reverse-mode AD. The starting point is to interpret a functional programming language as a suitable freely generated categorical structure. In this setting, by the universal property of the syntactic categorical structure, the dual numbers AD code transformation and the basic $ω$-cpo semantics arise as structure preserving functors. The proof follows, then, by a novel logical relations argument. The key to much of our contribution is a powerful monadic logical relations technique for term recursion and recursive types. It provides us with a semantic correctness proof based on a simple approach for denotational semantics, making use only of the very basic concrete model of $ω$-cpos.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源