{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,9,30]],"date-time":"2026-09-30T03:23:08Z","timestamp":1790738588283,"version":"4.1.0"},"reference-count":52,"publisher":"Association for Computing Machinery (ACM)","issue":"ICFP","license":[{"start":{"date-parts":[[2021,8,19]],"date-time":"2021-08-19T00:00:00Z","timestamp":1629331200000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"DOI":"10.13039\/100000001","name":"NSF","doi-asserted-by":"publisher","award":["1801369, 1845514, 1812876, 2007784"],"award-info":[{"award-number":["1801369, 1845514, 1812876, 2007784"]}],"id":[{"id":"10.13039\/100000001","id-type":"DOI","asserted-by":"publisher"}]},{"DOI":"10.13039\/100000185","name":"Defense Advanced Research Projects Agency","doi-asserted-by":"publisher","award":["FA8750-18-C-0092"],"award-info":[{"award-number":["FA8750-18-C-0092"]}],"id":[{"id":"10.13039\/100000185","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":[[2021,8,22]]},"abstract":"<jats:p>We present a novel method for working with the physicist's method of amortized resource analysis, which we call the quantum physicist's method. These principles allow for more precise analyses of resources that are not monotonically consumed, like stack. This method takes its name from its two major features, worldviews and resource tunneling, which behave analogously to quantum superposition and quantum tunneling. We use the quantum physicist's method to extend the Automatic Amortized Resource Analysis (AARA) type system, enabling the derivation of resource bounds based on tree depth. In doing so, we also introduce remainder contexts, which aid bookkeeping in linear type systems. We then evaluate this new type system's performance by bounding stack use of functions in the Set module of OCaml's standard library. Compared to state-of-the-art implementations of AARA, our new system derives tighter bounds with only moderate overhead.<\/jats:p>","DOI":"10.1145\/3473581","type":"journal-article","created":{"date-parts":[[2021,8,19]],"date-time":"2021-08-19T10:44:29Z","timestamp":1629369869000},"page":"1-29","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":7,"title":["Automatic amortized resource analysis with the Quantum physicist\u2019s method"],"prefix":"10.1145","volume":"5","author":[{"given":"David M.","family":"Kahn","sequence":"first","affiliation":[{"name":"Carnegie Mellon University, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Jan","family":"Hoffmann","sequence":"additional","affiliation":[{"name":"Carnegie Mellon University, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2021,8,19]]},"reference":[{"key":"e_1_2_2_1_1","volume-title":"https:\/\/projects.coin-or.org\/Clp Accessed","author":"COIN-OR","year":"2020","unstructured":"[n.d.]. COIN-OR CLP. https:\/\/projects.coin-or.org\/Clp Accessed : 2020 . [n.d.]. COIN-OR CLP. https:\/\/projects.coin-or.org\/Clp Accessed: 2020."},{"key":"e_1_2_2_2_1","volume-title":"https:\/\/github.com\/lucasaiu\/ocaml\/blob\/master\/stdlib\/set.ml Accessed","year":"2020","unstructured":"[n.d.]. OCaml\/stdlib\/set.ml. https:\/\/github.com\/lucasaiu\/ocaml\/blob\/master\/stdlib\/set.ml Accessed : 2020 . [n.d.]. OCaml\/stdlib\/set.ml. https:\/\/github.com\/lucasaiu\/ocaml\/blob\/master\/stdlib\/set.ml Accessed: 2020."},{"key":"e_1_2_2_3_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-540-71316-6_12"},{"key":"e_1_2_2_4_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-662-46681-0_6"},{"key":"e_1_2_2_5_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-11957-6_6"},{"key":"e_1_2_2_6_1","doi-asserted-by":"publisher","DOI":"10.1145\/2784731.2784753"},{"key":"e_1_2_2_7_1","volume-title":"Int. Conf. on Rewriting Techniques and Applications (RTA\u201913)","author":"Avanzini M.","unstructured":"M. Avanzini and G. Moser . 2013. A Combination Framework for Complexity . In Int. Conf. on Rewriting Techniques and Applications (RTA\u201913) . M. Avanzini and G. Moser. 2013. A Combination Framework for Complexity. In Int. Conf. on Rewriting Techniques and Applications (RTA\u201913)."},{"key":"e_1_2_2_8_1","doi-asserted-by":"publisher","DOI":"10.1147\/rd.176.0525"},{"key":"e_1_2_2_9_1","doi-asserted-by":"publisher","DOI":"10.1145\/3385412.3386007"},{"key":"e_1_2_2_10_1","volume-title":"ABC: Algebraic Bound Computation for Loops. In Logic for Prog., AI., and Reasoning (LPAR\u201910).","author":"Blanc R.","year":"2010","unstructured":"R. Blanc , T. A. Henzinger , T. Hottelier , and L. Kov\u00e1cs . 2010 . ABC: Algebraic Bound Computation for Loops. In Logic for Prog., AI., and Reasoning (LPAR\u201910). R. Blanc, T. A. Henzinger, T. Hottelier, and L. Kov\u00e1cs. 2010. ABC: Algebraic Bound Computation for Loops. In Logic for Prog., AI., and Reasoning (LPAR\u201910)."},{"key":"e_1_2_2_11_1","unstructured":"Brian Campbell. 2008. Type-based amortized stack memory prediction.  Brian Campbell. 2008. Type-based amortized stack memory prediction."},{"key":"e_1_2_2_12_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-00590-9_14"},{"key":"e_1_2_2_13_1","volume-title":"Compositional Certified Resource Bounds. In 36th Conference on Programming Language Design and Implementation (PLDI\u201915)","author":"Carbonneaux Quentin","year":"2015","unstructured":"Quentin Carbonneaux , Jan Hoffmann , and Zhong Shao . 2015 . Compositional Certified Resource Bounds. In 36th Conference on Programming Language Design and Implementation (PLDI\u201915) . Artifact submitted and approved. Quentin Carbonneaux, Jan Hoffmann, and Zhong Shao. 2015. Compositional Certified Resource Bounds. In 36th Conference on Programming Language Design and Implementation (PLDI\u201915). Artifact submitted and approved."},{"key":"e_1_2_2_14_1","doi-asserted-by":"publisher","DOI":"10.1007\/3-540-60983-0_5"},{"key":"e_1_2_2_15_1","doi-asserted-by":"crossref","first-page":"1","DOI":"10.1145\/3339984","article-title":"Non-polynomial worst-case analysis of recursive programs","volume":"41","author":"Chatterjee Krishnendu","year":"2019","unstructured":"Krishnendu Chatterjee , Hongfei Fu , and Amir Kafshdar Goharshady . 2019 . Non-polynomial worst-case analysis of recursive programs . ACM Transactions on Programming Languages and Systems (TOPLAS) , 41 , 4 (2019), 1 \u2013 52 . Krishnendu Chatterjee, Hongfei Fu, and Amir Kafshdar Goharshady. 2019. Non-polynomial worst-case analysis of recursive programs. ACM Transactions on Programming Languages and Systems (TOPLAS), 41, 4 (2019), 1\u201352.","journal-title":"ACM Transactions on Programming Languages and Systems (TOPLAS)"},{"key":"e_1_2_2_16_1","doi-asserted-by":"crossref","unstructured":"K. Crary and S. Weirich. 2000. Resource Bound Certification. In Princ. of Prog. Lang. (POPL\u201900).  K. Crary and S. Weirich. 2000. Resource Bound Certification. In Princ. of Prog. Lang. (POPL\u201900).","DOI":"10.1145\/325694.325716"},{"key":"e_1_2_2_17_1","doi-asserted-by":"publisher","DOI":"10.1145\/3408979"},{"key":"e_1_2_2_18_1","doi-asserted-by":"publisher","DOI":"10.1109\/LICS.2011.22"},{"key":"e_1_2_2_19_1","doi-asserted-by":"publisher","DOI":"10.1145\/2480359.2429090"},{"key":"e_1_2_2_20_1","doi-asserted-by":"publisher","DOI":"10.1145\/582153.582176"},{"key":"e_1_2_2_21_1","doi-asserted-by":"crossref","unstructured":"N. A. Danielsson. 2008. Lightweight Semiformal Time Complexity Analysis for Purely Functional Data Structures. In Princ. of Prog. Lang. (POPL\u201908).  N. A. Danielsson. 2008. Lightweight Semiformal Time Complexity Analysis for Purely Functional Data Structures. In Princ. of Prog. Lang. (POPL\u201908).","DOI":"10.1145\/1328438.1328457"},{"key":"e_1_2_2_22_1","doi-asserted-by":"publisher","DOI":"10.1145\/2784731.2784749"},{"key":"e_1_2_2_23_1","volume-title":"Resource-Aware Session Types for Digital Contracts. In 2021 IEEE 34th Computer Security Foundations Symposium (CSF). 111\u2013126","author":"Das Ankush","unstructured":"Ankush Das , Stephanie Balzer , Jan Hoffmann , Frank Pfenning , and Ishani Santurkar . [n.d.]. Resource-Aware Session Types for Digital Contracts. In 2021 IEEE 34th Computer Security Foundations Symposium (CSF). 111\u2013126 . Ankush Das, Stephanie Balzer, Jan Hoffmann, Frank Pfenning, and Ishani Santurkar. [n.d.]. Resource-Aware Session Types for Digital Contracts. In 2021 IEEE 34th Computer Security Foundations Symposium (CSF). 111\u2013126."},{"key":"e_1_2_2_24_1","unstructured":"Ankush Das Stephanie Balzer Jan Hoffmann Frank Pfenning and Ishani Santurkar. 2019. Resource-aware session types for digital contracts. arXiv preprint arXiv:1902.06056.  Ankush Das Stephanie Balzer Jan Hoffmann Frank Pfenning and Ishani Santurkar. 2019. Resource-aware session types for digital contracts. arXiv preprint arXiv:1902.06056."},{"key":"e_1_2_2_25_1","volume-title":"Reviews of modern physics, 29, 3","author":"Hugh Everett III.","year":"1957","unstructured":"Hugh Everett III. 1957. \" Relative state\" formulation of quantum mechanics. Reviews of modern physics, 29, 3 ( 1957 ), 454. Hugh Everett III. 1957. \" Relative state\" formulation of quantum mechanics. Reviews of modern physics, 29, 3 (1957), 454."},{"key":"e_1_2_2_26_1","volume-title":"Introduction to quantum mechanics","author":"Griffiths David J","unstructured":"David J Griffiths and Darrell F Schroeter . 2018. Introduction to quantum mechanics . Cambridge University Press . David J Griffiths and Darrell F Schroeter. 2018. Introduction to quantum mechanics. Cambridge University Press."},{"key":"e_1_2_2_27_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-319-89884-1_19"},{"key":"e_1_2_2_28_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-02658-4_7"},{"key":"e_1_2_2_29_1","doi-asserted-by":"publisher","DOI":"10.1145\/1594834.1480898"},{"key":"e_1_2_2_30_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-540-71070-7_32"},{"key":"e_1_2_2_31_1","volume-title":"Logic programming in a fragment of intuitionistic linear logic. Information and computation, 110, 2","author":"Hodas Joshua S","year":"1994","unstructured":"Joshua S Hodas and Dale Miller . 1994. Logic programming in a fragment of intuitionistic linear logic. Information and computation, 110, 2 ( 1994 ), 327\u2013365. Joshua S Hodas and Dale Miller. 1994. Logic programming in a fragment of intuitionistic linear logic. Information and computation, 110, 2 (1994), 327\u2013365."},{"key":"e_1_2_2_32_1","doi-asserted-by":"publisher","DOI":"10.1145\/2362389.2362393"},{"key":"e_1_2_2_33_1","doi-asserted-by":"publisher","DOI":"10.1145\/3009837.3009842"},{"key":"e_1_2_2_34_1","doi-asserted-by":"publisher","DOI":"10.1145\/640128.604148"},{"key":"e_1_2_2_35_1","doi-asserted-by":"publisher","DOI":"10.1007\/11693024_3"},{"key":"e_1_2_2_36_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-37036-6_32"},{"key":"e_1_2_2_37_1","volume-title":"Static Determination of Quantitative Resource Usage for Higher-Order Programs. In 37th Symposium on Principles of Programming Languages (POPL\u201910)","author":"Jost Steffen","year":"2010","unstructured":"Steffen Jost , Kevin Hammond , Hans-Wolfgang Loidl , and Martin Hofmann . 2010 . Static Determination of Quantitative Resource Usage for Higher-Order Programs. In 37th Symposium on Principles of Programming Languages (POPL\u201910) . 223\u2013236. Steffen Jost, Kevin Hammond, Hans-Wolfgang Loidl, and Martin Hofmann. 2010. Static Determination of Quantitative Resource Usage for Higher-Order Programs. In 37th Symposium on Principles of Programming Languages (POPL\u201910). 223\u2013236."},{"key":"e_1_2_2_38_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-05089-3_23"},{"key":"e_1_2_2_39_1","volume-title":"Exponential Automatic Amortized Resource Analysis. In International Conference on Foundations of Software Science and Computation Structures. 359\u2013380","author":"Kahn David M","year":"2020","unstructured":"David M Kahn and Jan Hoffmann . 2020 . Exponential Automatic Amortized Resource Analysis. In International Conference on Foundations of Software Science and Computation Structures. 359\u2013380 . David M Kahn and Jan Hoffmann. 2020. Exponential Automatic Amortized Resource Analysis. In International Conference on Foundations of Software Science and Computation Structures. 359\u2013380."},{"key":"e_1_2_2_40_1","doi-asserted-by":"crossref","unstructured":"G. A. Kavvos E. Morehouse D. R. Licata and N. Danner. 2020. Recurrence Extraction for Functional Programs through Call-by-Push-Value. In Princ. of Prog. Lang. (POPL\u201920).  G. A. Kavvos E. Morehouse D. R. Licata and N. Danner. 2020. Recurrence Extraction for Functional Programs through Call-by-Push-Value. In Princ. of Prog. Lang. (POPL\u201920).","DOI":"10.1145\/3371083"},{"key":"e_1_2_2_41_1","doi-asserted-by":"publisher","DOI":"10.1145\/3140587.3062373"},{"key":"e_1_2_2_42_1","volume-title":"Proceedings of the ACM on Programming Languages, 2, POPL","author":"Kincaid Zachary","year":"2017","unstructured":"Zachary Kincaid , John Cyphert , Jason Breck , and Thomas Reps . 2017 . Non-linear reasoning for invariant synthesis . Proceedings of the ACM on Programming Languages, 2, POPL (2017), 1\u201333. Zachary Kincaid, John Cyphert, Jason Breck, and Thomas Reps. 2017. Non-linear reasoning for invariant synthesis. Proceedings of the ACM on Programming Languages, 2, POPL (2017), 1\u201333."},{"key":"e_1_2_2_43_1","doi-asserted-by":"crossref","unstructured":"Pedro Lopez-Garcia Luthfi Darmawan Maximiliano Klemen Umer Liqat Francisco Bueno and Manuel V Hermenegildo. 2018. Interval-based resource usage verification by translation into Horn clauses and an application to energy consumption. arXiv preprint arXiv:1803.04451.  Pedro Lopez-Garcia Luthfi Darmawan Maximiliano Klemen Umer Liqat Francisco Bueno and Manuel V Hermenegildo. 2018. Interval-based resource usage verification by translation into Horn clauses and an application to energy consumption. arXiv preprint arXiv:1803.04451.","DOI":"10.1017\/S1471068418000042"},{"key":"e_1_2_2_44_1","volume-title":"Time Credits and Time Receipts in Iris","author":"M\u00e9vel Glen","unstructured":"Glen M\u00e9vel , Jacques-Henri Jourdan , and Fran\u00e7ois Pottier . 2019. Time Credits and Time Receipts in Iris . In Programming Languages and Systems, Lu\u00eds Caires (Ed.). Springer International Publishing , Cham . 3\u201329. isbn:978-3-030-17184-1 Glen M\u00e9vel, Jacques-Henri Jourdan, and Fran\u00e7ois Pottier. 2019. Time Credits and Time Receipts in Iris. In Programming Languages and Systems, Lu\u00eds Caires (Ed.). Springer International Publishing, Cham. 3\u201329. isbn:978-3-030-17184-1"},{"key":"e_1_2_2_45_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-319-66167-4_8"},{"key":"e_1_2_2_46_1","volume-title":"Bounded Expectations: Resource Analysis for Probabilistic Programs. In 39th Conference on Programming Language Design and Implementation (PLDI\u201918)","author":"Ngo Van Chan","year":"2018","unstructured":"Van Chan Ngo , Quentin Carbonneaux , and Jan Hoffmann . 2018 . Bounded Expectations: Resource Analysis for Probabilistic Programs. In 39th Conference on Programming Language Design and Implementation (PLDI\u201918) . Van Chan Ngo, Quentin Carbonneaux, and Jan Hoffmann. 2018. Bounded Expectations: Resource Analysis for Probabilistic Programs. In 39th Conference on Programming Language Design and Implementation (PLDI\u201918)."},{"key":"e_1_2_2_47_1","doi-asserted-by":"publisher","DOI":"10.1007\/s10817-018-9459-3"},{"key":"e_1_2_2_48_1","doi-asserted-by":"publisher","DOI":"10.1007\/s10817-013-9277-6"},{"key":"e_1_2_2_49_1","doi-asserted-by":"crossref","unstructured":"I. Radicek G. Barthe M. Gaboardi D. Garg and F. Zuleger. 2018. Monadic Refinements for Relational Cost Analysis. In Princ. of Prog. Lang. (POPL\u201918).  I. Radicek G. Barthe M. Gaboardi D. Garg and F. Zuleger. 2018. Monadic Refinements for Relational Cost Analysis. In Princ. of Prog. Lang. (POPL\u201918).","DOI":"10.1145\/3158124"},{"key":"e_1_2_2_50_1","series-title":"SIAM J. Algebraic Discrete Methods, 6","volume-title":"Amortized Computational Complexity","author":"Tarjan R. E.","year":"1985","unstructured":"R. E. Tarjan . 1985. Amortized Computational Complexity . SIAM J. Algebraic Discrete Methods, 6 ( 1985 ), August. R. E. Tarjan. 1985. Amortized Computational Complexity. SIAM J. Algebraic Discrete Methods, 6 (1985), August."},{"key":"e_1_2_2_52_1","volume-title":"Proceedings of the ACM on Programming Languages, 4, ICFP","author":"Wang Di","year":"2020","unstructured":"Di Wang , David M Kahn , and Jan Hoffmann . 2020 . Raising expectations: automating expected cost analysis with types . Proceedings of the ACM on Programming Languages, 4, ICFP (2020), 1\u201331. Di Wang, David M Kahn, and Jan Hoffmann. 2020. Raising expectations: automating expected cost analysis with types. Proceedings of the ACM on Programming Languages, 4, ICFP (2020), 1\u201331."},{"key":"e_1_2_2_53_1","doi-asserted-by":"publisher","DOI":"10.1145\/3133903"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3473581","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3473581","content-type":"application\/pdf","content-version":"vor","intended-application":"syndication"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3473581","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,6,17]],"date-time":"2025-06-17T21:28:16Z","timestamp":1750195696000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3473581"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2021,8,19]]},"references-count":52,"journal-issue":{"issue":"ICFP","published-print":{"date-parts":[[2021,8,22]]}},"alternative-id":["10.1145\/3473581"],"URL":"https:\/\/doi.org\/10.1145\/3473581","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2021,8,19]]},"assertion":[{"value":"2021-08-19","order":2,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}