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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Appel, A.W.: Compiling with Continuations. Cambridge University Press, Cambridge (1992)
Cousineau, G., Curien, P.-L., Mauny, M.: The categorical abstract machine. Science of Computer Programming 8(2) (1987)
Curry, H.B., Feys, R.: Combinatory Logic, vol. 1. North-Holland, Amsterdam (1968)
Flanagan, C., Sabry, A., Duba, B.F., Felleisen, M.: The essence of compiling with continuation. In: Proc. ACM PLDI Conference, pp. 237–247 (1993)
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)
Gunter, C.A.: Semantics of Programming Languages – Structures and Techniques. The MIT Press, Cambridge (1992)
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)
Katsumata, S.: Personal communication (1999)
Kleene, S.: Introduction to Metamathematics, 7th edn. North-Holland, Amsterdam (1952)
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)
Landin, P.J.: The mechanical evaluation of expressions. Computer Journal 6, 308–320 (1964)
Leroy, X.: The ZINC experiment: an economical implementation of the ML language. Technical Report 117, INRIA (1992)
Lindholm, T., Yellin, F.: The Java virtual machine specification. Addison-Wesley, Reading (1996)
Mitchell, J.C.: Foundations for Programming Languages. MIT Press, Cambridge (1996)
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)
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)
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)
Jones, S.L.P.: The Implementation of Functional Programming Languages. Series in Computer Science. Prentice-Hall, Englewood Cliffs (1987)
Stata, B., Abadi, M.: A type system for java bytecode subroutines. In: Proc. ACM Symposium on Principles of Programming Languages, pp. 149–160 (1998)
Turner, D.A.: A new implementation technique for applicative languages. Software Practice and Experience 9, 31–49 (1979)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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