{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,8,18]],"date-time":"2026-08-18T15:01:41Z","timestamp":1787065301477,"version":"build-2736575974"},"reference-count":35,"publisher":"Association for Computing Machinery (ACM)","issue":"OOPSLA2","license":[{"start":{"date-parts":[[2024,10,8]],"date-time":"2024-10-08T00:00:00Z","timestamp":1728345600000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"DOI":"10.13039\/501100000266","name":"Engineering and Physical Sciences Research Council","doi-asserted-by":"publisher","award":["EP\/Y003535\/1"],"award-info":[{"award-number":["EP\/Y003535\/1"]}],"id":[{"id":"10.13039\/501100000266","id-type":"DOI","asserted-by":"publisher"}]}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2024,10,8]]},"abstract":"<jats:p>\n                    The design of online learning algorithms typically aims to optimise the incurred loss or\n                    <jats:italic toggle=\"yes\">cost<\/jats:italic>\n                    , e.g., the number of classification mistakes made by the algorithm. The goal of this paper is to build a type-theoretic framework to prove that a certain algorithm achieves its stated bound on the cost.\n                  <\/jats:p>\n                  <jats:p>\n                    Online learning algorithms often rely on randomness, their loss functions are often defined as expectations, precise bounds are often non-polynomial (e.g., logarithmic) and proofs of optimality often rely on potentialbased arguments. Accordingly, we present p\u03bb-amor, a type-theoretic graded modal framework for analysing (expected) costs of higher-order\n                    <jats:italic toggle=\"yes\">probabilistic<\/jats:italic>\n                    programs with recursion. p\u03bb-amor is an effect-based framework which uses graded modal types to represent potentials, cost and probability at the type level. It extends prior work ( \u03bb-amor) on cost analysis for\n                    <jats:italic toggle=\"yes\">deterministic<\/jats:italic>\n                    programs. We prove p\u03bb-amor sound relative to a Kripke step-indexed model which relates potentials with probabilistic coupling. We use p\u03bb-amor to prove cost bounds of several examples from the online machine learning literature. Finally, we describe an extension of p\u03bb-amor with a graded comonad and describe the relationship between the different modalities.\n                  <\/jats:p>","DOI":"10.1145\/3689725","type":"journal-article","created":{"date-parts":[[2024,10,8]],"date-time":"2024-10-08T03:23:04Z","timestamp":1728357784000},"page":"389-414","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":4,"title":["A Modal Type Theory of Expected Cost in Higher-Order Probabilistic Programs"],"prefix":"10.1145","volume":"8","author":[{"ORCID":"https:\/\/orcid.org\/0000-0001-7701-8311","authenticated-orcid":false,"given":"Vineet","family":"Rajani","sequence":"first","affiliation":[{"name":"University of Kent, Canterbury, United Kingdom"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-3853-1777","authenticated-orcid":false,"given":"Gilles","family":"Barthe","sequence":"additional","affiliation":[{"name":"MPI-SP, Bochum, Germany"},{"name":"IMDEA Software Institute, Madrid, Spain"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-0888-3093","authenticated-orcid":false,"given":"Deepak","family":"Garg","sequence":"additional","affiliation":[{"name":"Max Planck Institute for Software Systems, Saarbrucken, Germany"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2024,10,8]]},"reference":[{"key":"e_1_3_1_2_1","doi-asserted-by":"publisher","DOI":"10.1145\/3571195"},{"key":"e_1_3_1_3_1","doi-asserted-by":"publisher","DOI":"10.5555\/1037736"},{"key":"e_1_3_1_4_1","unstructured":"Sanjeev Arora. 2013. Lectures on Advanced Algorithm Design. https:\/\/www.cs.princeton.edu\/courses\/archive\/fall13\/cos521\/."},{"issue":"6","key":"e_1_3_1_5_1","article-title":"The Multiplicative Weights Update Method: a Meta-Algorithm and Applications","volume":"8","author":"Arora Sanjeev","year":"2012","unstructured":"Sanjeev Arora, Elad Hazan, and Satyen Kale. 2012. The Multiplicative Weights Update Method: a Meta-Algorithm and Applications. Theory of Computing 8, 6 (2012).","journal-title":"Theory of Computing"},{"key":"e_1_3_1_6_1","doi-asserted-by":"publisher","DOI":"10.1137\/S0097539701398375"},{"key":"e_1_3_1_7_1","doi-asserted-by":"publisher","DOI":"10.1145\/3473592"},{"key":"e_1_3_1_8_1","doi-asserted-by":"crossref","unstructured":"Martin Avanzini Ugo Dal Lago and Alexis Ghyselen. 2019. Type-Based Complexity Analysis of Probabilistic Functional Programs. In Annual ACM\/IEEE Symposium on Logic in Computer Science (LICS).","DOI":"10.1109\/LICS.2019.8785725"},{"key":"e_1_3_1_9_1","doi-asserted-by":"publisher","DOI":"10.1016\/j.scico.2019.102338"},{"key":"e_1_3_1_10_1","doi-asserted-by":"publisher","DOI":"10.1145\/3428240"},{"key":"e_1_3_1_11_1","article-title":"Potential-Function Proofs for Gradient Methods","volume":"15","author":"Bansal Nikhil","year":"2019","unstructured":"Nikhil Bansal and Anupam Gupta. 2019. Potential-Function Proofs for Gradient Methods. Theory Comput. 15 (2019).","journal-title":"Theory Comput."},{"key":"e_1_3_1_12_1","doi-asserted-by":"publisher","DOI":"10.1145\/3571260"},{"key":"e_1_3_1_13_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-540-32033-3_24"},{"key":"e_1_3_1_14_1","doi-asserted-by":"publisher","DOI":"10.1017\/CBO9780511546921"},{"key":"e_1_3_1_15_1","first-page":"511","article-title":"Probabilistic Program Analysis using Martingales","volume":"8044","author":"Chakarov Aleksandar","year":"2013","unstructured":"Aleksandar Chakarov and Sriram Sankaranarayanan. 2013. Probabilistic Program Analysis using Martingales. In Computer- Aided Verification (CAV), Vol. 8044. 511\u2013526.","journal-title":"Computer- Aided Verification (CAV)"},{"key":"e_1_3_1_16_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-319-63387-9_6"},{"issue":"4","key":"e_1_3_1_17_1","article-title":"Linear Dependent Types and Relative Completeness","volume":"8","author":"Dal Lago Ugo","year":"2011","unstructured":"Ugo Dal Lago and Marco Gaboardi. 2011. Linear Dependent Types and Relative Completeness. Logical Methods in Computer Science 8, 4 (2011).","journal-title":"Logical Methods in Computer Science"},{"key":"e_1_3_1_18_1","doi-asserted-by":"crossref","unstructured":"Ugo Dal Lago and Barbara Petit. 2012. Linear Dependent Types in a Call-by-value Scenario. Science of Computer Programming 84 (2012).","DOI":"10.1016\/j.scico.2013.07.010"},{"key":"e_1_3_1_19_1","doi-asserted-by":"crossref","unstructured":"Nils Anders Danielsson. 2008. Lightweight Semiformal Time Complexity Analysis for Purely Functional Data Structures. In Proceedings of the ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages.","DOI":"10.1145\/1328438.1328457"},{"key":"e_1_3_1_20_1","doi-asserted-by":"crossref","unstructured":"Marco Gaboardi Shin-ya Katsumata Dominic Orchard Flavien Breuvart and Tarmo Uustalu. 2016. Combining Effects and Coeffects via Grading. In Proceedings of the ACM SIGPLAN International Conference on Functional Programming (ICFP).","DOI":"10.1145\/2951913.2951939"},{"key":"e_1_3_1_21_1","doi-asserted-by":"publisher","DOI":"10.1016\/0304-3975(92)90386-T"},{"key":"e_1_3_1_22_1","first-page":"364","article-title":"Weakest Precondition Reasoning for Expected Run-Times of Probabilistic Programs","volume":"9632","author":"Kaminski Benjamin Lucien","year":"2016","unstructured":"Benjamin Lucien Kaminski, Joost-Pieter Katoen, Christoph Matheja, and Federico Olmedo. 2016. Weakest Precondition Reasoning for Expected Run-Times of Probabilistic Programs. In Proceedings of the European Symposium on Programming, (ESOP), Vol. 9632. Springer, 364\u2013389.","journal-title":"Proceedings of the European Symposium on Programming, (ESOP)"},{"key":"e_1_3_1_23_1","volume-title":"Abstraction, Refinement and Proof for Probabilistic Systems","author":"McIver Annabelle","year":"2005","unstructured":"Annabelle McIver and Carroll Morgan. 2005. Abstraction, Refinement and Proof for Probabilistic Systems. Springer New York, NY."},{"key":"e_1_3_1_24_1","doi-asserted-by":"publisher","DOI":"10.5555\/237842"},{"key":"e_1_3_1_25_1","unstructured":"Van Chan Ngo Quentin Carbonneaux and Jan Hoffmann. 2018. Bounded Expectations: Resource Analysis for Probabilistic Programs. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI)."},{"key":"e_1_3_1_26_1","unstructured":"Chris Okasaki. 1996. Purely Functional Data Structures. Ph. D. Dissertation. Carnegie Mellon University."},{"key":"e_1_3_1_27_1","doi-asserted-by":"publisher","DOI":"10.1145\/3341714"},{"key":"e_1_3_1_28_1","doi-asserted-by":"crossref","unstructured":"Tomas Petricek Dominic A. Orchard and Alan Mycroft. 2013. Coeffects: Unified Static Analysis of Context-Dependence. In Automata Languages and Programming - International Colloquium.","DOI":"10.1007\/978-3-642-39212-2_35"},{"key":"e_1_3_1_29_1","doi-asserted-by":"publisher","unstructured":"Vineet Rajani Gilles Barthe and Deepak Garg. 2024. A modal type-theory of expected cost in higher-order probabilistic programs (Technical appendix). https:\/\/doi.org\/10.5281\/zenodo.13450390 10.5281\/zenodo.13450390","DOI":"10.5281\/zenodo.13450390"},{"key":"e_1_3_1_30_1","doi-asserted-by":"publisher","DOI":"10.1145\/3434308"},{"key":"e_1_3_1_31_1","doi-asserted-by":"publisher","DOI":"10.1214\/aoms\/1177729586"},{"key":"e_1_3_1_32_1","doi-asserted-by":"publisher","DOI":"10.1137\/0606031"},{"key":"e_1_3_1_33_1","volume-title":"Optimal transport: Old and New","author":"Villani Cedric","year":"2008","unstructured":"Cedric Villani. 2008. Optimal transport: Old and New. Springer Berlin, Heidelberg."},{"key":"e_1_3_1_34_1","doi-asserted-by":"publisher","DOI":"10.1145\/3236782"},{"key":"e_1_3_1_35_1","doi-asserted-by":"crossref","unstructured":"Di Wang Jan Hoffmann and Thomas W. Reps. 2021. Central moment analysis for cost accumulators in probabilistic programs. In Proceedings of the ACM SIGPLAN International Conference on Programming Language Design and Implementation (PLDI). 559\u2013573.","DOI":"10.1145\/3453483.3454062"},{"key":"e_1_3_1_36_1","doi-asserted-by":"publisher","DOI":"10.1145\/3408992"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3689725","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3689725","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,2,4]],"date-time":"2026-02-04T09:03:06Z","timestamp":1770195786000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3689725"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2024,10,8]]},"references-count":35,"journal-issue":{"issue":"OOPSLA2","published-print":{"date-parts":[[2024,10,8]]}},"alternative-id":["10.1145\/3689725"],"URL":"https:\/\/doi.org\/10.1145\/3689725","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2024,10,8]]},"assertion":[{"value":"2024-04-05","order":0,"name":"received","label":"Received","group":{"name":"publication_history","label":"Publication History"}},{"value":"2024-08-18","order":2,"name":"accepted","label":"Accepted","group":{"name":"publication_history","label":"Publication History"}},{"value":"2024-10-08","order":3,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}