{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,8,21]],"date-time":"2026-08-21T13:49:42Z","timestamp":1787320182686,"version":"build-2736575974"},"reference-count":69,"publisher":"Cambridge University Press (CUP)","issue":"4-5","license":[{"start":{"date-parts":[[2023,7,14]],"date-time":"2023-07-14T00:00:00Z","timestamp":1689292800000},"content-version":"unspecified","delay-in-days":104,"URL":"http:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"content-domain":{"domain":["cambridge.org"],"crossmark-restriction":true},"short-container-title":["Math. Struct. Comp. Sci."],"published-print":{"date-parts":[[2023,4]]},"abstract":"<jats:title>Abstract<\/jats:title>\n                  <jats:p>\n                    We show how to apply forward and reverse mode Combinatory Homomorphic Automatic Differentiation (CHAD) (V\u00e1k\u00e1r (2021).\n                    <jats:italic>ESOP<\/jats:italic>\n                    , 607\u2013634; V\u00e1k\u00e1r and Smeding (2022).\n                    <jats:italic>ACM Transactions on Programming Languages and Systems<\/jats:italic>\n                    <jats:bold>44<\/jats:bold>\n                    (3) 20:1\u201320:49.) to total functional programming languages with expressive type systems featuring the combination of\n                    <jats:list list-type=\"bullet\">\n                      <jats:list-item>\n                        <jats:label>\u2022<\/jats:label>\n                        <jats:p>tuple types;<\/jats:p>\n                      <\/jats:list-item>\n                      <jats:list-item>\n                        <jats:label>\u2022<\/jats:label>\n                        <jats:p>sum types;<\/jats:p>\n                      <\/jats:list-item>\n                      <jats:list-item>\n                        <jats:label>\u2022<\/jats:label>\n                        <jats:p>inductive types;<\/jats:p>\n                      <\/jats:list-item>\n                      <jats:list-item>\n                        <jats:label>\u2022<\/jats:label>\n                        <jats:p>coinductive types;<\/jats:p>\n                      <\/jats:list-item>\n                      <jats:list-item>\n                        <jats:label>\u2022<\/jats:label>\n                        <jats:p>function types.<\/jats:p>\n                      <\/jats:list-item>\n                    <\/jats:list>\n                  <\/jats:p>\n                  <jats:p>\n                    We achieve this by analyzing the categorical semantics of such types in\n                    <jats:inline-formula>\n                      <jats:alternatives>\n                        <jats:inline-graphic xmlns:xlink=\"http:\/\/www.w3.org\/1999\/xlink\" mime-subtype=\"png\" xlink:href=\"S096012952300018X_inline1.png\"\/>\n                        <jats:tex-math>$\\Sigma$<\/jats:tex-math>\n                      <\/jats:alternatives>\n                    <\/jats:inline-formula>\n                    -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.\n                  <\/jats:p>","DOI":"10.1017\/s096012952300018x","type":"journal-article","created":{"date-parts":[[2023,7,13]],"date-time":"2023-07-13T20:51:43Z","timestamp":1689281503000},"page":"311-426","update-policy":"https:\/\/doi.org\/10.1017\/policypage","source":"Crossref","is-referenced-by-count":8,"title":["CHAD for expressive total languages"],"prefix":"10.1017","volume":"33","author":[{"given":"Fernando","family":"Lucatelli Nunes","sequence":"first","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-4603-0523","authenticated-orcid":false,"given":"Matthijs","family":"V\u00e1k\u00e1r","sequence":"additional","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"56","published-online":{"date-parts":[[2023,7,14]]},"reference":[{"key":"S096012952300018X_ref28","first-page":"1","article-title":"Higher order automatic differentiation of higher order functions","volume":"18","author":"Huot","year":"2022","journal-title":"Logical Methods in Computer Science"},{"key":"S096012952300018X_ref1","doi-asserted-by":"crossref","unstructured":"Abadi, M. and Plotkin, G. D. (2020). A simple differentiable programming language. In: Proceedings of POPL 2020, ACM.","DOI":"10.1145\/3371106"},{"key":"S096012952300018X_ref2","doi-asserted-by":"publisher","DOI":"10.1016\/0022-0000(79)90026-6"},{"key":"S096012952300018X_ref5","doi-asserted-by":"publisher","DOI":"10.1016\/j.topol.2019.106972"},{"key":"S096012952300018X_ref51","volume-title":"Graduate Texts in Mathematics","volume":"5","author":"Mac Lane","year":"1971"},{"key":"S096012952300018X_ref65","doi-asserted-by":"publisher","DOI":"10.1145\/3527634"},{"key":"S096012952300018X_ref10","first-page":"1","article-title":"Toposes, triples and theories","volume":"2005","author":"Barr","year":"2005","journal-title":"Representation Theory Application Categories"},{"key":"S096012952300018X_ref66","unstructured":"Vytiniotis, D. , Belov, D. , Wei, R. , Plotkin, G. and Abadi, M. (2019). The differentiable curry. Program Transformations for ML Workshop at NeurIPS 2019. https:\/\/openreview.net\/forum?id=ryxuz9SzDB."},{"key":"S096012952300018X_ref67","doi-asserted-by":"crossref","first-page":"1","DOI":"10.1145\/3360615","article-title":"Demystifying differentiable programming: shift\/reset the penultimate backpropagator","volume":"3","author":"Wang","year":"2019","journal-title":"Proceedings of the ACM on Programming Languages"},{"key":"S096012952300018X_ref68","doi-asserted-by":"publisher","DOI":"10.1145\/355586.364791"},{"key":"S096012952300018X_ref6","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-662-49630-5_3"},{"key":"S096012952300018X_ref30","doi-asserted-by":"publisher","DOI":"10.1016\/S0168-0072(01)00075-6"},{"key":"S096012952300018X_ref49","unstructured":"Lucatelli Nunes, F. and V\u00e1k\u00e1r, M. (2022a). Automatic Differentiation for ML-family languages: correctness via logical relations. arXiv e-prints, arXiv:2210.07724."},{"key":"S096012952300018X_ref55","doi-asserted-by":"publisher","DOI":"10.1145\/3434309"},{"key":"S096012952300018X_ref57","doi-asserted-by":"publisher","DOI":"10.1145\/1330017.1330018"},{"key":"S096012952300018X_ref29","doi-asserted-by":"crossref","unstructured":"Huot, M. , Staton, S. and V\u00e1k\u00e1r, M. (2020). Correctness of automatic differentiation via diffeologies and categorical gluing. In: Proceedings of FoSSaCS.","DOI":"10.1007\/978-3-030-45231-5_17"},{"key":"S096012952300018X_ref14","doi-asserted-by":"crossref","unstructured":"Brunel, A. , Mazza, D. and Pagani, M. (2020). Backpropagation in the simply typed lambda-calculus with linear negation. In: Proceedings of POPL 2020.","DOI":"10.1145\/3371132"},{"key":"S096012952300018X_ref25","doi-asserted-by":"publisher","DOI":"10.1111\/j.1746-8361.1958.tb01464.x"},{"key":"S096012952300018X_ref42","unstructured":"Linnainmaa, S. (1970). The Representation of the Cumulative Rounding Error of an Algorithm as a Taylor Expansion of the Local Rounding Errors. Master\u2019s thesis (in Finnish), Univ. Helsinki, 6\u20137."},{"key":"S096012952300018X_ref48","doi-asserted-by":"publisher","DOI":"10.1007\/s10485-022-09694-w"},{"key":"S096012952300018X_ref21","volume-title":"Lecture Notes in Mathematics","volume":"145","author":"Dubuc","year":"1970"},{"key":"S096012952300018X_ref8","unstructured":"Alvarez-Picallo, M. , Ghica, D. R. , Sprunger, D. and Zanasi, F. (2023). Functorial string diagrams for reverse-mode automatic differentiation. In: Klin, B. and Pimentel, E. (eds.) 31st EACSL Annual Conference on Computer Science Logic, CSL 2023, February 13\u201316, 2023, Warsaw, Poland, LIPIcs, vol. 252, Schloss Dagstuhl - Leibniz-Zentrum f\u00fcr Informatik, 6:1\u20136:20."},{"key":"S096012952300018X_ref59","unstructured":"Plotkin, G. (2018). Some principles of differential programming languages. Invited talk, POPL."},{"key":"S096012952300018X_ref45","doi-asserted-by":"publisher","DOI":"10.29252\/CGASA.9.1.29"},{"key":"S096012952300018X_ref27","doi-asserted-by":"publisher","DOI":"10.1137\/1.9780898717761"},{"key":"S096012952300018X_ref31","doi-asserted-by":"publisher","DOI":"10.1090\/surv\/185"},{"key":"S096012952300018X_ref37","doi-asserted-by":"publisher","DOI":"10.1145\/3498710"},{"key":"S096012952300018X_ref53","unstructured":"Mak, C. and Ong, L. (2020). A differential-form pullback programming language for higher-order reverse-mode automatic differentiation. arxiv:2002.08241."},{"key":"S096012952300018X_ref19","doi-asserted-by":"publisher","DOI":"10.1007\/BF02025118"},{"key":"S096012952300018X_ref4","volume-title":"London Mathematical Society Lecture Note Ceries","volume":"189","author":"Ad\u00e1mek","year":"1994"},{"key":"S096012952300018X_ref16","unstructured":"Christensen, J. D. and Wu, E. (2014). Tangent spaces and tangent bundles for diffeological spaces. arXiv preprint arXiv:1411.5425."},{"key":"S096012952300018X_ref63","unstructured":"V\u00e1k\u00e1r, M. (2017). In Search of Effectful Dependent Types. Phd thesis, University of Oxford. arXiv preprint arXiv:1706.07997."},{"key":"S096012952300018X_ref33","volume-title":"Sketches of an Elephant: A Topos Theory Compendium","volume":"2","author":"Johnstone","year":"2002"},{"key":"S096012952300018X_ref56","doi-asserted-by":"publisher","DOI":"10.1145\/3209108.3209207"},{"key":"S096012952300018X_ref22","doi-asserted-by":"publisher","DOI":"10.1145\/3236765"},{"key":"S096012952300018X_ref44","unstructured":"Lucatelli Nunes, F. (2017). Pseudomonads and Descent. Phd thesis (Chapter 1). University of Coimbra. arXiv: 1802.01767."},{"key":"S096012952300018X_ref38","doi-asserted-by":"publisher","DOI":"10.1016\/j.jpaa.2011.07.012"},{"key":"S096012952300018X_ref35","first-page":"1","article-title":"Basic concepts of enriched category theory","volume":"2005","author":"Kelly","year":"2005","journal-title":"Representation Theory Application Categories"},{"key":"S096012952300018X_ref121","first-page":"153:1","article-title":"Automatic differentiation in machine learning: a survey","volume":"18","author":"Baydin","year":"2017","journal-title":"Journal of Machine Learning Research"},{"key":"S096012952300018X_ref23","doi-asserted-by":"publisher","DOI":"10.1109\/LICS.2019.8785665"},{"key":"S096012952300018X_ref13","volume-title":"Cambridge Studies in Advanced Mathematics","volume":"72","author":"Borceux","year":"2001"},{"key":"S096012952300018X_ref39","volume-title":"Introduction to Higher-Order Categorical Logic","volume":"7","author":"Lambek","year":"1988"},{"key":"S096012952300018X_ref24","volume-title":"Lecture Notes in Mathematics","volume":"221","author":"Gabriel","year":"1971"},{"key":"S096012952300018X_ref7","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-13962-8_2"},{"key":"S096012952300018X_ref20","doi-asserted-by":"publisher","DOI":"10.1007\/BFb0077118"},{"key":"S096012952300018X_ref26","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-99902-4_2"},{"key":"S096012952300018X_ref18","volume-title":"Categories for Types","author":"Crole","year":"1993"},{"key":"S096012952300018X_ref50","unstructured":"Lucatelli Nunes, F. and V\u00e1k\u00e1r, M. (2022b). Logical Relations for Partial Features and Automatic Differentiation Correctness. arXiv e-prints, arXiv:2210.08530."},{"key":"S096012952300018X_ref46","doi-asserted-by":"publisher","DOI":"10.1007\/s10485-018-9541-3"},{"key":"S096012952300018X_ref40","doi-asserted-by":"publisher","DOI":"10.1007\/978-1-4419-9982-5_1"},{"key":"S096012952300018X_ref43","first-page":"217","article-title":"On biadjoint triangles","volume":"31","author":"Lucatelli Nunes","year":"2016","journal-title":"Theory and Applications of Categories"},{"key":"S096012952300018X_ref41","unstructured":"Leinster, T. (2014). Basic Category Theory, vol. 143, Cambridge Studies in Advanced Mathematics, Cambridge, Cambridge University Press."},{"key":"S096012952300018X_ref47","first-page":"530","article-title":"Descent data and absolute Kan extensions","volume":"37","author":"Lucatelli Nunes","year":"2021","journal-title":"Theory and Applications of Categories"},{"key":"S096012952300018X_ref15","doi-asserted-by":"publisher","DOI":"10.1016\/0022-4049(93)90035-R"},{"key":"S096012952300018X_ref9","doi-asserted-by":"publisher","DOI":"10.1016\/0304-3975(93)90076-6"},{"key":"S096012952300018X_ref64","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-030-72019-3_22"},{"key":"S096012952300018X_ref12","unstructured":"Bird, G. (1984). Limits in 2-categories of locally-presentable categories. Sydney Category Seminar Report. Phd thesis, University of Sydney."},{"key":"S096012952300018X_ref32","volume-title":"Studies in Logic and the Foundations of Mathematics","volume":"141","author":"Jacobs","year":"1999"},{"key":"S096012952300018X_ref34","doi-asserted-by":"publisher","DOI":"10.1007\/BFb0063105"},{"key":"S096012952300018X_ref3","unstructured":"Adamek, J. , Milius, S. and Moss, L. (2010). Initial Algebras and Terminal Coalgebras: A Survey. https:\/\/web.archive.org\/web\/20150919161434\/https:\/\/www.tu-braunschweig.de\/Medien-DB\/iti\/survey_full.pdf."},{"key":"S096012952300018X_ref54","volume-title":"Contemporary Mathematics","volume":"104","author":"Makkai","year":"1989"},{"key":"S096012952300018X_ref11","doi-asserted-by":"crossref","unstructured":"Barthe, G. , Crubill\u00e9, R. , Lago, U. D. and Gavazzo, F. (2020). On the versatility of open logical relations - continuity, automatic differentiation, and a containment theorem. In : M\u00fcller, P. (ed.) Programming Languages and Systems - 29th European Symposium on Programming, ESOP 2020, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2020, Dublin, Ireland, April 25\u201330, 2020, Proceedings, Lecture Notes in Computer Science, vol. 12075, Springer, 56\u201383.","DOI":"10.1007\/978-3-030-44914-8_3"},{"key":"S096012952300018X_ref61","doi-asserted-by":"publisher","DOI":"10.2172\/5254402"},{"key":"S096012952300018X_ref62","doi-asserted-by":"publisher","DOI":"10.1007\/978-1-4419-7400-6_3"},{"key":"S096012952300018X_ref60","doi-asserted-by":"publisher","DOI":"10.1051\/ita:2002010"},{"key":"S096012952300018X_ref52","doi-asserted-by":"crossref","unstructured":"MacDonald, J. and Sobral, M. (2004). Aspects of monads. In: Categorical Foundations, Encyclopedia of Mathematics and its Applications, vol. 97, Cambridge, Cambridge University Press, 213\u2013268.","DOI":"10.1017\/CBO9781107340985.008"},{"key":"S096012952300018X_ref36","unstructured":"Kerjean, M. and P\u00e9drot, P.-M. (2021). $\\partial$ is for Dialectica: Typing Differentiable Programming. Working Paper or Preprint."},{"key":"S096012952300018X_ref58","unstructured":"Pitts, A. M. (1995). Categorical logic. Technical report, University of Cambridge, Computer Laboratory."},{"key":"S096012952300018X_ref17","unstructured":"Cockett, J. R. B. , Cruttwell, G. S. H. , Gallagher, J. , Lemay, J.-S. P. , MacAdam, B. , Plotkin, G. D. and Pronk, D. (2020). Reverse derivative categories. In: Proceedings of CSL 2020."}],"container-title":["Mathematical Structures in Computer Science"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.cambridge.org\/core\/services\/aop-cambridge-core\/content\/view\/S096012952300018X","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2023,9,10]],"date-time":"2023-09-10T22:06:54Z","timestamp":1694383614000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.cambridge.org\/core\/product\/identifier\/S096012952300018X\/type\/journal_article"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2023,4]]},"references-count":69,"journal-issue":{"issue":"4-5","published-print":{"date-parts":[[2023,4]]}},"alternative-id":["S096012952300018X"],"URL":"https:\/\/doi.org\/10.1017\/s096012952300018x","relation":{},"ISSN":["0960-1295","1469-8072"],"issn-type":[{"value":"0960-1295","type":"print"},{"value":"1469-8072","type":"electronic"}],"subject":[],"published":{"date-parts":[[2023,4]]},"assertion":[{"value":"\u00a9 The Author(s), 2023. Published by Cambridge University Press","name":"copyright","label":"Copyright","group":{"name":"copyright_and_licensing","label":"Copyright and Licensing"}},{"value":"This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (http:\/\/creativecommons.org\/licenses\/by\/4.0\/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited.","name":"license","label":"License","group":{"name":"copyright_and_licensing","label":"Copyright and Licensing"}},{"value":"This content has been made available to all.","name":"free","label":"Free to read"}]}}