CHAD for Expressive Total Languages

Publication date

2021-10-01

Authors

Vákár, MatthijsORCID 0000-0003-4603-0523ISNI 0000000464978681
Nunes, Fernando LucatelliISNI 0000000506808059

Editors

Advisors

Supervisors

Document Type

/dk/atira/pure/researchoutput/researchoutputtypes/workingpaper/preprint
Open Access logo

License

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.

Keywords

Automatic differentiation, Program correctness, Denotational semantics, Variant types, Inductive types, Coinductive types, Extensive indexed categories, Artin glueing, Logical relations

Citation

Vákár, M & Lucatelli Nunes, F 2021 'CHAD for Expressive Total Languages' arXiv, pp. 1-97. https://doi.org/10.48550/arXiv.2110.00446