Skip to main navigation Skip to search Skip to main content

CHAD for expressive total languages

Research output: Contribution to journalArticleAcademicpeer-review

Abstract

We show how to apply forward and reverse mode Combinatory Homomorphic Automatic Differentiation (CHAD) (Vákár (2021). ESOP, 607–634; Vákár and Smeding (2022). ACM Transactions on Programming Languages and Systems 44 (3) 20:1–20:49.) 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 analyzing 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.
Original languageEnglish
Article numberPII S096012952300018X
Pages (from-to)311–426
Number of pages116
JournalMathematical Structures in Computer Science
Volume33
Issue number4-5
DOIs
Publication statusPublished - Apr 2023

Bibliographical note

Funding Information:
This project has received funding from the European Union’s Horizon 2020 research and innovation program under the Marie Skłodowska-Curie grant agreement No. 895827 and from the Nederlandse Organisatie voor Wetenschappelijk Onderzoek under NWO Veni grant number VI.Veni.202.124. This research was also supported through the program “Oberwolfach Leibniz Fellows” by the Mathematisches Forschungsinstitut Oberwolfach in 2022 and partially supported by the CMUC, Centre for Mathematics of the University of Coimbra – UIDB/00324/2020, funded by the Portuguese Government through FCT/MCTES.

Publisher Copyright:
© The Author(s), 2023. Published by Cambridge University Press.

Keywords

  • (Co)monadicity
  • Artin gluing
  • Automatic differentiation
  • Cartesian closed categories
  • Coalgebras
  • Coinductive types
  • Comma categories
  • Creation of initial algebras
  • Denotational semantics
  • Dependently typed languages
  • Exponentiability
  • Extensive categories
  • Extensive indexed categories
  • Fibered categories
  • Free cocompletion under coproducts
  • Grothendieck construction
  • Inductive types
  • Initial algebra semantics
  • Linear types
  • Logical relations
  • Polynomial functors
  • Program transformations
  • Programming languages
  • Scientific computing
  • Software correctness
  • Type systems
  • Variant types

Fingerprint

Dive into the research topics of 'CHAD for expressive total languages'. Together they form a unique fingerprint.

Cite this