Skip to main content

The Logical Abstract Machine: A Curry-Howard Isomorphism for Machine Code

  • Conference paper
Functional and Logic Programming (FLOPS 1999)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1722))

Included in the following conference series:

Abstract

This paper presents a logical framework for low-level machine code and code generation. We first define a calculus, called sequential sequent calculus, of intuitionistic propositional logic. A proof of the calculus only contains left rules and has a linear (non-branching) structure, which reflects the properties of sequential machine code. We then establish a Curry-Howard isomorphism between this proof system and machine code based on the following observation. An ordinary machine instruction corresponds to a polymorphic proof transformer that extends a given proof with one inference step. A return instruction, which turns a sequence of instructions into a program, corresponds to a logical axiom (an initial proof tree). Sequential execution of code corresponds to transforming a proof to a smaller one by successively eliminating the last inference step. This logical correspondence enables us to present and analyze various low-level implementation processes of a functional language within the logical framework. For example, a code generation algorithm for the lambda calculus is extracted from a proof of the equivalence theorem between the natural deduction and the sequential sequent calculus.

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 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.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. Appel, A.W.: Compiling with Continuations. Cambridge University Press, Cambridge (1992)

    Google Scholar 

  2. Cousineau, G., Curien, P.-L., Mauny, M.: The categorical abstract machine. Science of Computer Programming 8(2) (1987)

    Google Scholar 

  3. Curry, H.B., Feys, R.: Combinatory Logic, vol. 1. North-Holland, Amsterdam (1968)

    MATH  Google Scholar 

  4. Flanagan, C., Sabry, A., Duba, B.F., Felleisen, M.: The essence of compiling with continuation. In: Proc. ACM PLDI Conference, pp. 237–247 (1993)

    Google Scholar 

  5. Griffn, T.: A formulae-as-types notion of control. In: Conference Record of the Seventeenth Annual ACM Symposium on Principles of Programming Languages, pp. 47–58 (1990)

    Google Scholar 

  6. Gunter, C.A.: Semantics of Programming Languages – Structures and Techniques. The MIT Press, Cambridge (1992)

    MATH  Google Scholar 

  7. Howard, W.: The formulae-as-types notion of construction. In: To, H.B. (ed.) Curry: Essays on Combinatory Logic, Lambda-Calculus and Formalism, pp. 476–490. Academic Press, London (1980)

    Google Scholar 

  8. Katsumata, S.: Personal communication (1999)

    Google Scholar 

  9. Kleene, S.: Introduction to Metamathematics, 7th edn. North-Holland, Amsterdam (1952)

    MATH  Google Scholar 

  10. Lambek, J.: From λ-calculus to cartesian closed categories. In: To, H.B. (ed.) Curry: Essays on Combinatory Logic, Lambda-Calculus and Formalism, pp. 375–402. Academic Press, London (1980)

    Google Scholar 

  11. Landin, P.J.: The mechanical evaluation of expressions. Computer Journal 6, 308–320 (1964)

    MATH  Google Scholar 

  12. Leroy, X.: The ZINC experiment: an economical implementation of the ML language. Technical Report 117, INRIA (1992)

    Google Scholar 

  13. Lindholm, T., Yellin, F.: The Java virtual machine specification. Addison-Wesley, Reading (1996)

    Google Scholar 

  14. Mitchell, J.C.: Foundations for Programming Languages. MIT Press, Cambridge (1996)

    Google Scholar 

  15. Morrisett, G., Crary, K., Glew, N., Walker, D.: Stack-based typed assembly language. In: Leroy, X., Ohori, A. (eds.) TIC 1998. LNCS, vol. 1473, pp. 28–52. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  16. Morrisett, G., Walker, D., Crary, K., Glew, N.: From system F to typed assembly language. In: Proc. ACM Symposium on Principles of Programming Languages (1998)

    Google Scholar 

  17. Ohori, A.: A curry-howard isomorphism for compilation and program execution. In: Girard, J.-Y. (ed.) TLCA 1999. LNCS, vol. 1581, pp. 258–279. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  18. Jones, S.L.P.: The Implementation of Functional Programming Languages. Series in Computer Science. Prentice-Hall, Englewood Cliffs (1987)

    MATH  Google Scholar 

  19. Stata, B., Abadi, M.: A type system for java bytecode subroutines. In: Proc. ACM Symposium on Principles of Programming Languages, pp. 149–160 (1998)

    Google Scholar 

  20. Turner, D.A.: A new implementation technique for applicative languages. Software Practice and Experience 9, 31–49 (1979)

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1999 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Ohori, A. (1999). The Logical Abstract Machine: A Curry-Howard Isomorphism for Machine Code. In: Middeldorp, A., Sato, T. (eds) Functional and Logic Programming. FLOPS 1999. Lecture Notes in Computer Science, vol 1722. Springer, Berlin, Heidelberg. https://doi.org/10.1007/10705424_20

Download citation

  • DOI: https://doi.org/10.1007/10705424_20

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-66677-6

  • Online ISBN: 978-3-540-47950-5

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics