CHAD for expressive total languages

被引:5
作者
Nunes, Fernando Lucatelli [1 ]
Vakar, Matthijs [1 ]
机构
[1] Univ Utrecht, Dept Informat & Comp Sci, Utrecht, Netherlands
关键词
Automatic differentiation; Software correctness; Programming languages; Scientific computing; Program transformations; Type systems; Dependently typed languages; Artin gluing; Comma categories; Logical relations; Initial algebra semantics; Creation of initial algebras; Coalgebras; Grothendieck construction; Exponentiability; Fibered categories; Polynomial functors; Linear types; Variant types; Inductive types; Coinductive types; Cartesian closed categories; Denotational semantics; Extensive indexed categories; Extensive categories; (Co)monadicity; Free cocompletion under coproducts;
D O I
10.1017/S096012952300018X
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
We show how to apply forward and reversemode Combinatory Homomorphic Automatic Differentiation (CHAD) (Vakar (2021). ESOP, 607-634; Vakar 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 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.
引用
收藏
页码:311 / 426
页数:116
相关论文
共 68 条
  • [1] A Simple Differentiable Programming Language
    Abadi, Martin
    Plotkin, Gordon D.
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2020, 4 (POPL):
  • [2] Ad?mek J., 1994, LOCALLY PRESENTABLE, V189
  • [3] LEAST FIXED-POINT OF A FUNCTOR
    ADAMEK, J
    KOUBEK, V
    [J]. JOURNAL OF COMPUTER AND SYSTEM SCIENCES, 1979, 19 (02) : 163 - 178
  • [4] Adamek J., 2010, INITIAL ALGEBRAS TER
  • [5] How nice are free completions of categories?
    Adamek, Jiri
    Rosicky, Jiri
    [J]. TOPOLOGY AND ITS APPLICATIONS, 2020, 273
  • [6] Dependent Types and Fibred Computational Effects
    Ahman, Danel
    Ghani, Neil
    Plotkin, Gordon D.
    [J]. FOUNDATIONS OF SOFTWARE SCIENCE AND COMPUTATION STRUCTURES (FOSSACS 2016), 2016, 9634 : 36 - 54
  • [7] Altenkirch T, 2010, LECT NOTES COMPUT SC, V6158, P11, DOI 10.1007/978-3-642-13962-8_2
  • [8] [Anonymous], 2005, Toposes, Triples and Theories
  • [9] [Anonymous], 2018, SOME PRINCIPLES DIFF
  • [10] TERMINAL COALGEBRAS IN WELL-FOUNDED SET-THEORY
    BARR, M
    [J]. THEORETICAL COMPUTER SCIENCE, 1993, 114 (02) : 299 - 315