Abstract
The main way of analysing the complexity of a program is that of extracting and solving a recurrence that expresses its running time in terms of the size of its input. We develop a method that automatically extracts such recurrences from the syntax of higher-order recursive functional programs. The resulting recurrences, which are programs in a call-by-name language with recursion, explicitly compute the running time in terms of the size of the input. In order to achieve this in a uniform way that covers both call-by-name and call-by-value evaluation strategies, we use Call-by-Push-Value (CBPV) as an intermediate language. Finally, we use domain theory to develop a denotational cost semantics for the resulting recurrences.
- Samson Abramsky. 1990. The Lazy Lambda Calculus. In Research Topics in Functional Programming. Addison Wesley, 65–117. https://www.cs.ox.ac.uk/files/293/lazy.pdfGoogle Scholar
Digital Library
- Samson Abramsky, Radha Jagadeesan, and Pasquale Malacaria. 1996. Full Abstraction for PCF. Information and Computation 163 (1996), 409–470.Google Scholar
Digital Library
- Samson Abramsky and Achim Jung. 1994. Domain Theory. In Handbook of Logic in Computer Science, Samson Abramsky, Dov M. Gabbay, and Thomas S. E. Maibaum (Eds.). Vol. 3. Oxford University Press, 1–168. https://www.cs.bham.ac.uk/ ~axj/pub/papers/handy1.pdfGoogle Scholar
- Elvira Albert, Puri Arenas, Samir Genaim, German Puebla, and Damiano Zanardini. 2012. Cost analysis of object-oriented bytecode programs. Theoretical Computer Science 413, 1 (2012), 142–159. Google Scholar
Digital Library
- Elvira Albert, Jesús Correas, Einar Broch Johnsen, Ka I. Pun, and Guillermo Román-Díez. 2018. Parallel Cost Analysis. ACM Transactions on Computational Logic 19, 4, Article 31 (Nov. 2018), 37 pages. Google Scholar
Digital Library
- Elvira Albert, Samir Genaim, and Abu Naser Masud. 2013. On the Inference of Resource Usage Upper and Lower Bounds. ACM Transactions on Computational Logic 14, 3 (2013), 22:1–22:35. Google Scholar
Digital Library
- Martin Avanzini and Ugo Dal Lago. 2017. Automating Sized-type Inference for Complexity Analysis. Proceedings of the ACM on Programming Languages 1, ICFP, Article 43 (2017), 29 pages. Google Scholar
Digital Library
- Martin Avanzini, Ugo Dal Lago, and Georg Moser. 2015. Analyzing the complexity of functional programs: higher-order meets first-order. In Proceedings of the 20th ACM SIGPLAN International Conference on Functional Programming, ICFP 2015, Kathleen Fisher and John Reppy (Eds.). 152–164. Google Scholar
Digital Library
- Ralph Benzinger. 2004. Automated higher-order complexity analysis. Theoretical Computer Science 318, 1-2 (2004), 79–103. Google Scholar
Digital Library
- Richard Bird. 2014. Thinking Functionally with Haskell. Cambridge University Press, Cambridge. Google Scholar
Cross Ref
- Guy Blelloch and John Greiner. 1995. Parallelism in Sequential Functional Languages. In Proceedings of the Seventh International Conference on Functional Programming Languages and Computer Architecture (FPCA ’95). ACM, New York, NY, USA, 226–237. Google Scholar
Digital Library
- Nils Anders Danielsson. 2008. Lightweight semiformal time complexity analysis for purely functional data structures. In Proceedings of the 35th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, George Necula and Philip Wadler (Eds.). 133–144. Google Scholar
Digital Library
- Norman Danner, Daniel R. Licata, and Ramyaa Ramyaa. 2015. Denotational cost semantics for functional languages with inductive types. In Proceedings of the 20th ACM SIGPLAN International Conference on Functional Programming - ICFP 2015. ACM Press, New York, New York, USA, 140–151. Google Scholar
Digital Library
- Norman Danner, Jennifer Paykin, and James S. Royer. 2013. A static cost analysis for a higher-order language. In Proceedings of the 7th workshop on Programming languages meets program verification - PLPV ’13. ACM Press, New York, New York, USA. Google Scholar
Digital Library
- Norman Danner and James S. Royer. 2007. Adventures in time and space. Logical Methods in Computer Science 3, 9 (2007), 1–53. Google Scholar
Cross Ref
- Conal Elliott and Paul Hudak. 1997. Functional reactive animation. In Proceedings of the second ACM SIGPLAN International Conference on Functional Programming - ICFP ’97. ACM Press, New York, New York, USA, 263–273. Google Scholar
Digital Library
- Martín Hötzel Escardó and Weng Kin Ho. 2009. Operational domain theory and topology of sequential programming languages. Information and Computation 207, 3 (2009), 411–437. Google Scholar
Digital Library
- Marcelo P. Fiore. 1996. Axiomatic Domain Theory in Categories of Partial Maps. Cambridge University Press, Cambridge. Google Scholar
Cross Ref
- Carl A. Gunter. 1992. Semantics of Programming Languages: Structures and Techniques. The MIT Press.Google Scholar
Digital Library
- Jan Hoffmann, Ankush Das, and Shu-Chun Weng. 2017. Towards Automatic Resource Bound Analysis for OCaml. In Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages (POPL 2017). ACM, New York, NY, USA, 359–373. Google Scholar
Digital Library
- Richard M. Karp. 1994. Probabilistic recurrence relations. Journal of the Association for Computing Machinery 41, 6 (1994), 1136–1150. Google Scholar
Digital Library
- Theodore Seok Kim. 2016. Cost Semantics for Plotkin’s PCF. Master’s Thesis. Wesleyan University. https://wesscholar. wesleyan.edu/etd_mas_theses/130/Google Scholar
- 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, Article 54 (Dec. 2017), 33 pages. Google Scholar
Digital Library
- Paul Blain Levy. 2003. Call-by-Push-Value: A Functional-Imperative Synthesis. Springer. Google Scholar
Cross Ref
- Paul Blain Levy. 2006. Call-by-push-value: Decomposing call-by-value and call-by-name. Higher-Order and Symbolic Computation 19 (2006), 377–414. Google Scholar
Digital Library
- Robin Milner. 1977. Fully abstract models of typed λ-calculi. Theoretical Computer Science 4, 1 (1977), 1–22. Google Scholar
Cross Ref
- John C. Mitchell. 1996. Foundations for programming languages. The MIT Press.Google Scholar
Digital Library
- Yue Niu and Jan Hoffmann. 2018. Automatic Space Bound Analysis for Functional Programs with Garbage Collection. In LPAR-22. 22nd International Conference on Logic for Programming, Artificial Intelligence and Reasoning (EPiC Series in Computing), Gilles Barthe, Geoff Sutcliffe, and Margus Veanes (Eds.), Vol. 57. EasyChair, 543–563. Google Scholar
Cross Ref
- Benjamin C. Pierce. 2002. Types and Programming Languages. The MIT Press.Google Scholar
Digital Library
- A. M. Pitts. 1994. Some notes on inductive and co-inductive techniques in the semantics of functional programs. Technical Report. BRICS. https://www.brics.dk/NS/94/5/BRICS- NS- 94- 5.pdfGoogle Scholar
- A. M. Pitts. 1997. Operationally-Based Theories of Program Equivalence. In Semantics and Logics of Computation, A. M. Pitts and P. Dybjer (Eds.). Cambridge University Press, 241–298. https://www.cl.cam.ac.uk/~amp12/papers/opebtp/opebtp.pdfGoogle Scholar
- Gordon Plotkin and John Power. 2001. Adequacy for Algebraic Effects. In Foundations of Software Science and Computation Structures. FoSSaCS 2001, Furio Honsell and M. Miculan (Eds.). Lecture Notes in Computer Science, Vol. 2030. Springer, Berlin, Heidelberg. Google Scholar
Cross Ref
- Gordon D. Plotkin. 1977. LCF considered as a programming language. Theoretical Computer Science 5, 3 (1977), 223–255. Google Scholar
Cross Ref
- G. D. Plotkin. 1985. Lectures on predomains and partial functions. Notes for a course given at CSLI, Stanford University.Google Scholar
- Jon G. Riecke. 1993. Fully abstract translations between functional languages. Mathematical Structures in Computer Science 3 (1993), 387–415. Google Scholar
Cross Ref
- V. Stoltenberg-Hansen, I. Lindstrom, and E. R. Griffor. 1994. Mathematical Theory of Domains. Cambridge University Press, Cambridge. Google Scholar
Cross Ref
- Thomas Streicher. 2006. Domain-theoretic Foundations of Functional Programming. World Scientific.Google Scholar
- Robert Endre Tarjan. 1985. Amortized computational complexity. SIAM J. Algebraic Discrete Methods 6, 2 (1985), 306–318. Google Scholar
Digital Library
- Ben Wegbreit. 1975. Mechanical program analysis. Communications of the Association for Computing Machinery 18, 9 (1975), 528–539. Google Scholar
Digital Library
Index Terms
Recurrence extraction for functional programs through call-by-push-value
Recommendations
Denotational recurrence extraction for amortized analysis
A typical way of analyzing the time complexity of functional programs is to extract a recurrence expressing the running time of the program in terms of the size of its input, and then to solve the recurrence to obtain a big-O bound. For recurrence ...
Call-by-push-value in Coq: operational, equational, and denotational theory
CPP 2019: Proceedings of the 8th ACM SIGPLAN International Conference on Certified Programs and ProofsCall-by-push-value (CBPV) is an idealised calculus for functional and imperative programming, introduced as a subsuming paradigm for both call-by-value (CBV) and call-by-name (CBN). We formalise weak and strong operational semantics for (effect-free) ...
Call-by-push-value: Decomposing call-by-value and call-by-name
We present the call-by-push-value (CBPV) calculus, which decomposes the typed call-by-value (CBV) and typed call-by-name (CBN) paradigms into fine-grain primitives. On the operational side, we give big-step semantics and a stack machine for CBPV, which ...






Comments