skip to main content
10.1145/3479394.3479401acmotherconferencesArticle/Chapter ViewAbstractPublication PagesppdpConference Proceedingsconference-collections
research-article

A Derived Reasonable Abstract Machine for Strong Call by Value

Authors Info & Claims
Published:07 October 2021Publication History

ABSTRACT

We present an efficient implementation of the full-reducing call-by-value strategy for the pure λ-calculus in the form of an abstract machine. The presented machine has been systematically derived using Danvy et al.’s functional correspondence that connects higher-order interpreters with abstract-machine models by a well-established transformation technique. It improves on a previously presented machine by Biernacka et al. in terms of efficiency: the new machine simulates β-reduction with the overhead polynomial in the number of β-steps and in the size of the initial term. Thus, the machine makes a “reasonable” (in the sense of Accattoli et al.) implementation of Strong CbV.

We prove correctness and reasonability of the machine. The latter property is shown using a form of amortized cost analysis à la Okasaki.

References

  1. Beniamino Accattoli. 2019. A Fresh Look at the lambda-Calculus (Invited Talk). In 4th International Conference on Formal Structures for Computation and Deduction, FSCD 2019, June 24-30, 2019, Dortmund, Germany(LIPIcs, Vol. 131), Herman Geuvers (Ed.). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 1:1–1:20. https://doi.org/10.4230/LIPIcs.FSCD.2019.1Google ScholarGoogle Scholar
  2. Beniamino Accattoli and Bruno Barras. 2017. Environments and the complexity of abstract machines. In Proceedings of the 19th International Symposium on Principles and Practice of Declarative Programming (PPDP’17), Namur, Belgium, October 09 - 11, 2017, Wim Vanhoof and Brigitte Pientka (Eds.). ACM, 4–16. https://doi.org/10.1145/3131851.3131855Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Beniamino Accattoli and Claudio Sacerdoti Coen. 2015. On the Relative Usefulness of Fireballs. In 30th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2015, Kyoto, Japan, July 6-10, 2015. IEEE Computer Society, 141–155. https://doi.org/10.1109/LICS.2015.23Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Beniamino Accattoli, Andrea Condoluci, and Claudio Sacerdoti Coen. 2021. Strong Call-by-Value is Reasonable, Implosively. In 36th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2021, Rome, Italy, June 29 - July 2, 2021. IEEE, 1–14. https://doi.org/10.1109/LICS52264.2021.9470630Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Beniamino Accattoli, Andrea Condoluci, Giulio Guerrieri, and Claudio Sacerdoti Coen. 2019. Crumbling Abstract Machines. In Proceedings of the 21st International Symposium on Principles and Practice of Programming Languages, PPDP 2019, Porto, Portugal, October 7-9, 2019, Ekaterina Komendantskaya (Ed.). ACM, 4:1–4:15. https://doi.org/10.1145/3354166.3354169Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Beniamino Accattoli and Ugo Dal Lago. 2012. On the Invariance of the Unitary Cost Model for Head Reduction. In 23rd International Conference on Rewriting Techniques and Applications (RTA’12), RTA 2012, May 28 - June 2, 2012, Nagoya, Japan(LIPIcs, Vol. 15), Ashish Tiwari (Ed.). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 22–37. https://doi.org/10.4230/LIPIcs.RTA.2012.22Google ScholarGoogle Scholar
  7. Beniamino Accattoli and Ugo Dal Lago. 2016. (Leftmost-Outermost) Beta Reduction is Invariant, Indeed, In Logical Methods in Computer Science. Logical Methods in Computer Science 12. https://doi.org/10.2168/LMCS-12(1:4)2016Google ScholarGoogle Scholar
  8. Beniamino Accattoli and Giulio Guerrieri. 2016. Open Call-by-Value. In Programming Languages and Systems - 14th Asian Symposium, APLAS 2016, Hanoi, Vietnam, November 21-23, 2016, Proceedings(Lecture Notes in Computer Science, Vol. 10017), Atsushi Igarashi (Ed.). 206–226. https://doi.org/10.1007/978-3-319-47958-3_12Google ScholarGoogle Scholar
  9. Beniamino Accattoli and Giulio Guerrieri. 2019. Abstract machines for Open Call-by-Value. Sci. Comput. Program. 184 (2019). https://doi.org/10.1016/j.scico.2019.03.002Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Klaus Aehlig and Felix Joachimski. 2004. Operational Aspects of Untyped Normalization by Evaluation. Mathematical Structures in Computer Science 14 (2004), 587–611.Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Mads Sig Ager, Dariusz Biernacki, Olivier Danvy, and Jan Midtgaard. 2003. From Interpreter to Compiler and Virtual Machine: a Functional Derivation. Technical Report BRICS RS-03-14. DAIMI, Department of Computer Science, Aarhus University, Aarhus, Denmark.Google ScholarGoogle Scholar
  12. Mads Sig Ager, Dariusz Biernacki, Olivier Danvy, and Jan Midtgaard. 2003. A Functional Correspondence between Evaluators and Abstract Machines. In Proceedings of the Fifth ACM-SIGPLAN International Conference on Principles and Practice of Declarative Programming (PPDP’03), Dale Miller (Ed.). ACM Press, Uppsala, Sweden, 8–19.Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Thibaut Balabonski, Pablo Barenbaum, Eduardo Bonelli, and Delia Kesner. 2017. Foundations of strong call by need. PACMPL 1, ICFP (2017), 20:1–20:29. https://doi.org/10.1145/3110264Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Malgorzata Biernacka, Dariusz Biernacki, Witold Charatonik, and Tomasz Drab. 2020. An Abstract Machine for Strong Call by Value. In Programming Languages and Systems - 18th Asian Symposium, APLAS 2020, Fukuoka, Japan, November 30 - December 2, 2020, Proceedings(Lecture Notes in Computer Science, Vol. 12470), Bruno C. d. S. Oliveira (Ed.). Springer, 147–166. https://doi.org/10.1007/978-3-030-64437-6_8Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Malgorzata Biernacka and Witold Charatonik. 2019. Deriving an Abstract Machine for Strong Call by Need. In 4th International Conference on Formal Structures for Computation and Deduction, FSCD 2019, June 24-30, 2019, Dortmund, Germany(LIPIcs, Vol. 131), Herman Geuvers (Ed.). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 8:1–8:20. https://doi.org/10.4230/LIPIcs.FSCD.2019.8Google ScholarGoogle Scholar
  16. Malgorzata Biernacka, Witold Charatonik, and Klara Zielinska. 2017. Generalized Refocusing: From Hybrid Strategies to Abstract Machines. In 2nd International Conference on Formal Structures for Computation and Deduction, FSCD 2017, September 3-9, 2017, Oxford, UK(LIPIcs, Vol. 84), Dale Miller(Ed.). Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, 10:1–10:17. https://doi.org/10.4230/LIPIcs.FSCD.2017.10Google ScholarGoogle Scholar
  17. Andrea Condoluci, Beniamino Accattoli, and Claudio Sacerdoti Coen. 2019. Sharing Equality is Linear. In Proceedings of the 21st International Symposium on Principles and Practice of Programming Languages, PPDP 2019, Porto, Portugal, October 7-9, 2019. 9:1–9:14. https://doi.org/10.1145/3354166.3354174Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Pierre Crégut. 2007. Strongly Reducing Variants of the Krivine Abstract Machine. Higher-Order and Symbolic Computation 20, 3 (2007), 209–230. A preliminary version was presented at the 1990 ACM Conference on Lisp and Functional Programming.Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Ugo Dal Lago and Beniamino Accattoli. 2017. Encoding Turing Machines into the Deterministic Lambda-Calculus. CoRR abs/1711.10078(2017). arxiv:1711.10078http://arxiv.org/abs/1711.10078Google ScholarGoogle Scholar
  20. Andrzej Filinski and Henning Korsholm Rohde. 2005. Denotational Aspects of Untyped Normalization by Evaluation. Theoretical Informatics and Applications 39, 3 (2005), 423–453. A preliminary version was presented at FOSSACS 2004.Google ScholarGoogle ScholarCross RefCross Ref
  21. Yannick Forster, Fabian Kunze, and Marc Roth. 2020. The weak call-by-value λ-calculus is reasonable for both time and space. Proc. ACM Program. Lang. 4, POPL (2020), 27:1–27:23. https://doi.org/10.1145/3371095Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. A García-Pérez and Pablo Nogueira. 2014. On the syntactic and functional correspondence between hybrid (or layered) normalisers and abstract machines. Science of Computer Programming 95 (2014), 176–199.Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Benjamin Grégoire and Xavier Leroy. 2002. A compiled implementation of strong reduction. In Proceedings of the Seventh ACM SIGPLAN International Conference on Functional Programming (ICFP ’02), Pittsburgh, Pennsylvania, USA, October 4-6, 2002, Mitchell Wand and Simon L. Peyton Jones (Eds.). ACM, 235–246. https://doi.org/10.1145/581478.581501Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. J. D. Hunter. 2007. Matplotlib: A 2D graphics environment. Computing in Science & Engineering 9, 3 (2007), 90–95. https://doi.org/10.1109/MCSE.2007.55Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Xavier Leroy, Damien Doligez, Alain Frisch, Jacques Garrigue, Didier Rémy, and Jérôme Vouillon. 2020. The OCaml system, release 4.10. INRIA, Rocquencourt, France. https://caml.inria.fr/pub/docs/manual-ocaml/Google ScholarGoogle Scholar
  26. Chris Okasaki. 1999. Purely functional data structures. Cambridge University Press.Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Peter Sestoft. 2002. Demonstrating Lambda Calculus Reduction. In The Essence of Computation, Complexity, Analysis, Transformation. Essays Dedicated to Neil D. Jones [on occasion of his 60th birthday](Lecture Notes in Computer Science, 2566), Torben Æ. Mogensen, David A. Schmidt, and Ivan Hal Sudborough (Eds.). Springer, 420–435. https://doi.org/10.1007/3-540-36377-7_19Google ScholarGoogle Scholar
  28. Cees F. Slot and Peter van Emde Boas. 1984. On Tape Versus Core; An Application of Space Efficient Perfect Hash Functions to the Invariance of Space. In Proceedings of the 16th Annual ACM Symposium on Theory of Computing, April 30 - May 2, 1984, Washington, DC, USA, Richard A. DeMillo (Ed.). ACM, 391–400. https://doi.org/10.1145/800057.808705Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A Derived Reasonable Abstract Machine for Strong Call by Value
          Index terms have been assigned to the content through auto-classification.

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in
          • Published in

            cover image ACM Other conferences
            PPDP '21: Proceedings of the 23rd International Symposium on Principles and Practice of Declarative Programming
            September 2021
            277 pages
            ISBN:9781450386890
            DOI:10.1145/3479394

            Copyright © 2021 ACM

            Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 7 October 2021

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • research-article
            • Research
            • Refereed limited

            Acceptance Rates

            Overall Acceptance Rate230of486submissions,47%

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader

          HTML Format

          View this article in HTML Format .

          View HTML Format