CHAD for Expressive Total Languages
Abstract
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 $\Sigma$-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.
- Publication:
-
arXiv e-prints
- Pub Date:
- October 2021
- DOI:
- 10.48550/arXiv.2110.00446
- arXiv:
- arXiv:2110.00446
- Bibcode:
- 2021arXiv211000446L
- Keywords:
-
- Computer Science - Programming Languages;
- Computer Science - Logic in Computer Science;
- Mathematics - Category Theory;
- 18C50;
- 18D15;
- 18D30;
- 18C15;
- 18C20;
- 03B38;
- 03B70;
- F.3.2
- E-Print:
- Under review at MSCS