Skip to main content

Automating Derivations of Abstract Machines from Reduction Semantics:

A Generic Formalization of Refocusing in Coq

  • Conference paper
Implementation and Application of Functional Languages (IFL 2010)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 6647))

Included in the following conference series:

Abstract

We present a generic formalization of the refocusing transformation for functional languages in the Coq proof assistant. The refocusing technique, due to Danvy and Nielsen, allows for mechanical transformation of an evaluator implementing a reduction semantics into an equivalent abstract machine via a succession of simple program transformations. So far, refocusing has been used only as an informal procedure: the conditions required of a reduction semantics have not been formally captured, and the transformation has not been formally proved correct.

The aim of this work is to formalize and prove correct the refocusing technique. To this end, we first propose an axiomatization of reduction semantics that is sufficient to automatically apply the refocusing method. Next, we prove that any reduction semantics conforming to this axiomatization can be automatically transformed into an abstract machine equivalent to it. The article is accompanied by a Coq development that contains the formalization of the refocusing method and a number of case studies that serve both as an illustration of the method and as a sanity check on the axiomatization.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 54.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 69.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Biernacka, M., Biernacki, D.: Formalizing constructions of abstract machines for functional languages in Coq. In: Giesl, J. (ed.) Preliminary proceedings of the Seventh International Workshop on Reduction Strategies in Rewriting and Programming (WRS 2007), Paris, France (June 2007)

    Google Scholar 

  2. Biernacka, M., Danvy, O.: A concrete framework for environment machines. ACM Transactions on Computational Logic 9(1), 1–30 (2007)

    Article  MathSciNet  MATH  Google Scholar 

  3. Biernacka, M., Danvy, O.: A syntactic correspondence between context-sensitive calculi and abstract machines. Theoretical Computer Science 375(1-3), 76–108 (2007)

    Article  MathSciNet  MATH  Google Scholar 

  4. Biernacka, M., Danvy, O.: Towards compatible and interderivable semantic specifications for the Scheme programming language, Part II: Reduction semantics and abstract machines. In: Palsberg, J. (ed.) Semantics and Algebraic Specification. LNCS, vol. 5700, pp. 186–206. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  5. Chrząszcz, J.: Implementing modules in the Coq system. In: Basin, D.A., Wolff, B. (eds.) TPHOLs 2003. LNCS, vol. 2758, pp. 270–286. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  6. Curien, P.-L.: An abstract framework for environment machines. Theoretical Computer Science 82, 389–402 (1991)

    Article  MathSciNet  MATH  Google Scholar 

  7. Danvy, O.: Defunctionalized interpreters for programming languages. In: Thiemann, P. (ed.) Proceedings of the 2008 ACM SIGPLAN International Conference on Functional Programming (ICFP 2008), Victoria, British Columbia. SIGPLAN Notices, vol. 43(9), ACM Press, New York (September 2008)

    Google Scholar 

  8. Danvy, O.: From reduction-based to reduction-free normalization. In: Koopman, P., Plasmeijer, R., Swierstra, D. (eds.) AFP 2008. LNCS, vol. 5832, pp. 66–164. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  9. Danvy, O., Johannsen, J.: Inter-deriving semantic artifacts for object-oriented programming. Journal of Computer and System Sciences 76, 302–323 (2010)

    Article  MathSciNet  MATH  Google Scholar 

  10. Danvy, O., Millikin, K.: On the equivalence between small-step and big-step abstract machines: a simple application of lightweight fusion. Information Processing Letters 106(3), 100–109 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  11. Danvy, O., Millikin, K., Munk, J., Zerny, I.: Defunctionalized interpreters for call-by-need evaluation. In: Blume, M., Kobayashi, N., Vidal, G. (eds.) FLOPS 2010. LNCS, vol. 6009, pp. 240–256. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  12. Danvy, O., Nielsen, L.R.: Refocusing in reduction semantics. Research Report BRICS RS-04-26, DAIMI, Department of Computer Science, Aarhus University, Aarhus, Denmark, A preliminary version appeared in the informal proceedings of the Second International Workshop on Rule-Based Programming (RULE 2001). Electronic Notes in Theoretical Computer Science, Vol. 59(4) (November 2004)

    Google Scholar 

  13. Danvy, O., Zerny, I.: Three syntactic theories for combinatory graph reduction. In: Alpuente, M. (ed.) LOPSTR 2010. LNCS, vol. 6564, pp. 1–20. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  14. Danvy, O., Zerny, I., Johannsen, J.: A walk in the semantic park. In: Proceedings of the 2011 ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM 2011), Austin, USA. ACM Press, New York (January 2011) Invited talk

    Google Scholar 

  15. Felleisen, M., Friedman, D.P.: Control operators, the SECD machine, and the λ-calculus. In: Wirsing, M. (ed.) Formal Description of Programming Concepts III, pp. 193–217. Elsevier Science Publishers B.V., North-Holland (1986)

    Google Scholar 

  16. Garcia, R., Lumsdaine, A., Sabry, A.: Lazy evaluation and delimited control. Logical Methods in Computer Science 6(3:1), 1–39 (2010)

    MathSciNet  MATH  Google Scholar 

  17. Krivine, J.-L.: A call-by-name lambda-calculus machine. Higher-Order and Symbolic Computation 20(3), 199–207 (2007)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Sieczkowski, F., Biernacka, M., Biernacki, D. (2011). Automating Derivations of Abstract Machines from Reduction Semantics:. In: Hage, J., Morazán, M.T. (eds) Implementation and Application of Functional Languages. IFL 2010. Lecture Notes in Computer Science, vol 6647. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-24276-2_5

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-24276-2_5

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-24275-5

  • Online ISBN: 978-3-642-24276-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics