skip to main content
article
Free Access

A proof theory for machine code

Published:01 October 2007Publication History
Skip Abstract Section

Abstract

This article develops a proof theory for low-level code languages. We first define a proof system, which we refer to as the sequential sequent calculus, and show that it enjoys the cut elimination property and that its expressive power is the same as that of the natural deduction proof system. We then establish the Curry-Howard isomorphism between this proof system and a low-level code language by showing the following properties: (1) the set of proofs and the set of typed codes is in one-to-one correspondence, (2) the operational semantics of the code language is directly derived from the cut elimination procedure of the proof system, and (3) compilation and decompilation algorithms between the code language and the typed lambda calculus are extracted from the proof transformations between the sequential sequent calculus and the natural deduction proof system. This logical framework serves as a basis for the development of type systems of various low-level code languages, type-preserving compilation, and static code analysis.

References

  1. Abramsky, S. 1993. Computational interpretation of linear logic. Theor. Comput. Sci. 3, 57, 3--57. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Cousineau, G., Curien, P.-L., and Mauny, M. 1987. The categorical abstract machine. Sci. Comput. Program. 8, 2, 173--202. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Curry, H. B. and Feys, R. 1968. Combinatory Logic. Vol. 1. North-Holland, Amsterdam.Google ScholarGoogle Scholar
  4. Flanagan, C., Sabry, A., Duba, B., and Felleisen, M. 1993. The essence of compiling with continuation. In Proceedings of the ACM PLDI Conference. ACM, New York, 237--247. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Freund, S. and Mitchell, J. 2003. A type system for the Java bytecode language and verifier. J. Automat. Reason. 30, 3--4, 271--321. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Gallier, J. 1993. Constructive logics part I: A tutorial on proof systems and typed λ-calculi. Theor. Comput. Sci. 110, 249--339. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Gentzen, G. 1969. Investigation into logical deduction. In The Collected Papers of Gerhard Gentzen, M. Szabo, Ed. North-Holland, Amsterdam.Google ScholarGoogle Scholar
  8. Girard, J., Lafont, Y., and Taylor, P. 1989. Proofs and Types. Cambridge University Press, Cambridge, UK. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Girard, J.-Y. 1987. Linear logic. Theor. Comput. Sci. 50, 1, 1--102. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Griffin, T. 1990. A formulae-as-types notion of control. In Proceedings of the ACM Symposium on Principles of Programming Languages. ACM, New York, 47--58. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Higuchi, T. and Ohori, A. 2002. Java bytecode as a typed term calculus. In Proceedings of the International Conference on Principles and Practice of Declarative Programming. ACM, New York, 201--211. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Higuchi, T. and Ohori, A. 2007. A static type system for jvm access control. ACM Trans. Program. Lang. Syst. 29, 1, article 4. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Howard, W. 1980. The formulae-as-types notion of construction. In To H. B. Curry: Essays on Combinatory Logic, Lambda-Calculus and Formalism. Academic Press, 476--490.Google ScholarGoogle Scholar
  14. Katsumata, S. and Ohori, A. 2001. Proof-directed de-compilation of low-level code. In Proceedings of the European Symposium on Programming. Lecture Notes in Computer Science, vol. 2028. Springer-Verlag, Berlin, 352--366. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Kleene, S. 1952. Introduction to Metamathematics, 7th Ed. North-Holland, Amsterdam.Google ScholarGoogle Scholar
  16. Lambek, J. 1980. From λ-calculus to cartesian closed categories. In To H. B. Curry: Essays on Combinatory Logic, Lambda-Calculus and Formalism. Academic Press, 375--402.Google ScholarGoogle Scholar
  17. Landin, P. J. 1964. The mechanical evaluation of expressions. Comput. J. 6, 308--320.Google ScholarGoogle ScholarCross RefCross Ref
  18. Minamide, Y., Morrisett, J. G., and Harper, R. 1996. Typed closure conversion. In Proceedings of the ACM Symposium on Principles of Programming Languages. ACM, New York, 271--283. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Mitchell, J. 1996. Foundations for Programming Languages. MIT Press, Boston, MA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Morrisett, G., Crary, K., Glew, N., and Walker, D. 1998. Stack-based typed assembly language. In Proceedings of the International Workshop on Types in Compilation. Lecture Notes in Computer Science, vol. 1473. Springer-Verlag, Berlin, 28--52. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Morrisett, G., Walker, D., Crary, K., and Glew, N. 1998. From system F to typed assembly language. In Proceedings of the ACM Symposium on Principles of Programming Languages. ACM, New York, 85--7. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. O'Hearn, P. and Pym, D. 1999. The logic of bunched implications. Bull. Sym. Logic 5, 2, 215--244.Google ScholarGoogle ScholarCross RefCross Ref
  23. Ohori, A. 1999. A Curry-Howard isomorphism for compilation and program execution. In Proceedings of the Typed Lambda Calculi and Applications. Lecture Notes in Computer Science, vol. 1581. Springer-Verlag, Berlin, 258--179. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Ohori, A. 2004. Register allocation by proof transformation. J. Sci. Comput. Program. 50, 1--3, 161--187. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Ono, H. and Komori, Y. 1985. Logics without the contraction rule. J. Symb. Logic 50, 1, 169--201.Google ScholarGoogle ScholarCross RefCross Ref
  26. Parigot, M. 1992. λμ-calculus: an alorithmic interpretation of classical natural deduction. In Proceedings of the Logic Programming and Automated Reasoning. Lecture Notes in Computer Science, vol. 624. Springer-Verlag, Berlin, 190--201. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Raffalli, C. 1994. Machine deduction. In Proceedings of the Types for Proofs and Program. Lecture Notes in Computer Science, vol. 806. Springer-Verlag, Berlin, 333--351. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Skalka, S. and Smith, S. 2000. Static enforcement of security with types. In Proceedings of the International Conference on Functional Programming (ICFP). ACM, New York, 34--45. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Stata, R. and Abadi, M. 1998. A type system for Java bytecode subroutines. In Proceedings of the ACM Symposium on Principles of Programming Languages. ACM, New York, 149--160. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Tait, W. 1966. Intensional interpretations of functionals of finite type i. J. Symb. Logic 32, 2, 198--212.Google ScholarGoogle ScholarCross RefCross Ref
  31. Turner, D. 1979. A new implementation technique for applicative languages. Softw. Pract. Exper. 9, 31--49.Google ScholarGoogle Scholar
  32. Wadler, P. 1990. Linear types can change the world! In Progarmming Concepts and Methods, IFIP TC 2 Working Conference. M. Broy and C. Jones, Eds. North Holland, 561--581.Google ScholarGoogle Scholar

Index Terms

  1. A proof theory for machine code

              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

              Full Access

              • Published in

                cover image ACM Transactions on Programming Languages and Systems
                ACM Transactions on Programming Languages and Systems  Volume 29, Issue 6
                October 2007
                408 pages
                ISSN:0164-0925
                EISSN:1558-4593
                DOI:10.1145/1286821
                Issue’s Table of Contents

                Copyright © 2007 ACM

                Publisher

                Association for Computing Machinery

                New York, NY, United States

                Publication History

                • Published: 1 October 2007
                Published in toplas Volume 29, Issue 6

                Permissions

                Request permissions about this article.

                Request Permissions

                Check for updates

                Qualifiers

                • article

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader
              About Cookies On This Site

              We use cookies to ensure that we give you the best experience on our website.

              Learn more

              Got it!