DeepAI AI Chat
Log In Sign Up

CHAD for Expressive Total Languages

by   Fernando Lucatelli Nunes, et al.

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.


CHAD: Combinatory Homomorphic Automatic Differentiation

We introduce Combinatory Homomorphic Automatic Differentiation (CHAD), a...

Logical Relations for Partial Features and Automatic Differentiation Correctness

We present a simple technique for semantic, open logical relations argum...

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

We give a simple, direct and reusable logical relations technique for la...

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

We show how to define source-code transformations for forward- and rever...

Differentiating a Tensor Language

How does one compile derivatives of tensor programs, such that the resul...

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

Reverse-mode differentiation is used for optimization, but it introduces...

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

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