CHAD for Expressive Total Languages

10/01/2021
by   Fernando Lucatelli Nunes, et al.
0

We show how to apply forward and reverse mode Combinatory Homomorphic Automatic Differentiation (CHAD) to total functional programming languages with expressive type systems featuring the combination of - tuple types; - sum types; - inductive types; - coinductive types; - function types. We achieve this by analysing the categorical semantics of such types in Σ-types (Grothendieck constructions) of suitable categories. Using a novel categorical logical relations technique for such expressive type systems, we give a correctness proof of CHAD in this setting by showing that it computes the usual mathematical derivative of the function that the original program implements. The result is a principled, purely functional and provably correct method for performing forward and reverse mode automatic differentiation (AD) on total functional programming languages with expressive type systems.

READ FULL TEXT
research
03/29/2021

CHAD: Combinatory Homomorphic Automatic Differentiation

We introduce Combinatory Homomorphic Automatic Differentiation (CHAD), a...
research
10/16/2022

Logical Relations for Partial Features and Automatic Differentiation Correctness

We present a simple technique for semantic, open logical relations argum...
research
10/14/2022

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

We give a simple, direct and reusable logical relations technique for la...
research
07/10/2020

Reverse AD at Higher Types: Pure, Principled and Denotationally Correct

We show how to define source-code transformations for forward- and rever...
research
08/25/2020

Differentiating a Tensor Language

How does one compile derivatives of tensor programs, such that the resul...
research
12/19/2022

Denotationally Correct, Purely Functional, Efficient Reverse-mode Automatic Differentiation

Reverse-mode differentiation is used for optimization, but it introduces...
research
01/19/2020

Semantics for first-order affine inductive data types via slice categories

Affine type systems are substructural type systems where copying of info...

Please sign up or login with your details

Forgot password? Click here to reset