Advertisement

Formal Small-Step Verification of a Call-by-Value Lambda Calculus Machine

  • Fabian KunzeEmail author
  • Gert SmolkaEmail author
  • Yannick ForsterEmail author
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11275)

Abstract

We formally verify an abstract machine for a call-by-value \(\lambda \)-calculus with de Bruijn terms, simple substitution, and small-step semantics. We follow a stepwise refinement approach starting with a naive stack machine with substitution. We then refine to a machine with closures, and finally to a machine with a heap providing structure sharing for closures. We prove the correctness of the three refinement steps with compositional small-step bottom-up simulations. There is an accompanying Coq development verifying all results.

References

  1. 1.
    Accattoli, B., Barenbaum, P., Mazza, D.: Distilling abstract machines. In: Proceedings of the 19th ACM SIGPLAN International Conference on Functional Programming, pp. 363–376 (2014)Google Scholar
  2. 2.
    Baier, C., Katoen, J.-P.: Principles of Model Checking. MIT Press, Cambridge (2008)zbMATHGoogle Scholar
  3. 3.
    Biernacka, M., Charatonik, W., Zielinska, K.: Generalized refocusing: from hybrid strategies to abstract machines. In: LIPIcs, vol. 84. Schloss Dagstuhl-Leibniz-Zentrum für Informatik (2017)Google Scholar
  4. 4.
    Biernacka, M., Danvy, O.: A concrete framework for environment machines. ACM Trans. Comput. Logic (TOCL) 9(1), 6 (2007)MathSciNetCrossRefGoogle Scholar
  5. 5.
    Cardelli, L.: Compiling a functional language. In: Proceedings of the 1984 ACM Symposium on LISP and Functional Programming, pp. 208–217. ACM (1984)Google Scholar
  6. 6.
    Cousineau, G., Curien, P.-L., Mauny, M.: The categorical abstract machine. Sci. Comput. Program. 8(2), 173–202 (1987)MathSciNetCrossRefGoogle Scholar
  7. 7.
    Crégut, P.: An abstract machine for lambda-terms normalization. In: Proceedings of the 1990 ACM Conference on LISP and Functional Programming, pp. 333–340 (1990)Google Scholar
  8. 8.
    Dal Lago, U., Martini, S.: The weak lambda calculus as a reasonable machine. Theor. Comput. Sci. 398(1–3), 32–50 (2008)MathSciNetCrossRefGoogle Scholar
  9. 9.
    Danvy, O., Nielsen, L.R.: Refocusing in reduction semantics. BRICS Rep. Ser. 11(26) (2004)Google Scholar
  10. 10.
    Felleisen, M., Friedman, D.P.: Control Operators, the SECD-machine, and the \(\lambda \)-calculus. Indiana University, Computer Science Department (1986)Google Scholar
  11. 11.
    Forster, Y., Kunze, F., Roth, M.: The strong invariance thesis for a \(\lambda \)-calculus. In: Workshop on Syntax and Semantics of Low-Level Languages (LOLA) (2017)Google Scholar
  12. 12.
    Forster, Y., Smolka, G.: Weak call-by-value lambda calculus as a model of computation in Coq. In: Ayala-Rincón, M., Muñoz, C.A. (eds.) ITP 2017. LNCS, vol. 10499, pp. 189–206. Springer, Cham (2017).  https://doi.org/10.1007/978-3-319-66107-0_13CrossRefGoogle Scholar
  13. 13.
    Hardin, T., Maranget, L., Pagano, B.: Functional runtime systems within the lambda-sigma calculus. J. Funct. Programm. 8(2), 131–176 (1998)MathSciNetCrossRefGoogle Scholar
  14. 14.
    Landin, P.J.: The mechanical evaluation of expressions. Comput. J. 6(4), 308–320 (1964)CrossRefGoogle Scholar
  15. 15.
    Leroy, X.: The ZINC experiment: an economical implementation of the ML language. Technical report, INRIA (1990)Google Scholar
  16. 16.
    Leroy, X.: Functional programming languages, Part II: Abstract machines, the Modern SECD. Lectures on Functional Programming and Type Systems, MPRI course 2–4, slides and Coq developments (2016). https://xavierleroy.org/mpri/2-4/
  17. 17.
    Leroy, X., Grall, H.: Coinductive big-step operational semantics. Inf. Comput. 207(2), 284–304 (2009)MathSciNetCrossRefGoogle Scholar
  18. 18.
    Plotkin, G.D.: Call-by-name, call-by-value and the \(\lambda \)-calculus. Theor. Comput. Sci. 1(2), 125–159 (1975)MathSciNetCrossRefGoogle Scholar
  19. 19.
    Ramsdell, J.D.: The tail-recursive SECD machine. J. Autom. Reason. 23(1), 43–62 (1999)MathSciNetCrossRefGoogle Scholar
  20. 20.
    Rittri, M.: Proving the correctness of a virtual machine by a bisimulation. Licentiate thesis, Chalmers University and University of Göteborg (1988)Google Scholar
  21. 21.
    Swierstra, W.: From mathematics to abstract machine: a formal derivation of an executable Krivine machine. In: Proceedings Fourth Workshop on Mathematically Structured Functional Programming, pp. 163–177 (2012)CrossRefGoogle Scholar
  22. 22.
    The Coq Proof Assistant (2018). http://coq.inria.fr

Copyright information

© Springer Nature Switzerland AG 2018

Authors and Affiliations

  1. 1.Saarland UniversitySaarbrückenGermany

Personalised recommendations