skip to main content
10.1145/1926385.1926402acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article

A kripke logical relation between ML and assembly

Authors Info & Claims
Published:26 January 2011Publication History

ABSTRACT

There has recently been great progress in proving the correctness of compilers for increasingly realistic languages with increasingly realistic runtime systems. Most work on this problem has focused on proving the correctness of a particular compiler, leaving open the question of how to verify the correctness of assembly code that is hand-optimized or linked together from the output of multiple compilers. This has led Benton and other researchers to propose more abstract, compositional notions of when a low-level program correctly realizes a high-level one. However, the state of the art in so-called "compositional compiler correctness" has only considered relatively simple high-level and low-level languages.

In this paper, we propose a novel, extensional, compiler-independent notion of equivalence between high-level programs in an expressive, impure ML-like λ-calculus and low-level programs in an (only slightly) idealized assembly language. We define this equivalence by means of a biorthogonal, step-indexed, Kripke logical relation, which enables us to reason quite flexibly about assembly code that uses local state in a different manner than the high-level code it implements (e.g. self-modifying code). In contrast to prior work, we factor our relation in a symmetric, language-generic fashion, which helps to simplify and clarify the formal presentation, and we also show how to account for the presence of a garbage collector. Our approach relies on recent developments in Kripke logical relations for ML-like languages, in particular the idea of possible worlds as state transition systems.

Skip Supplemental Material Section

Supplemental Material

13-mpeg-4.mp4

mp4

478 MB

References

  1. A. Ahmed. Step-indexed syntactic logical relations for recursive and quantified types. In ESOP, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. A. Ahmed, D. Dreyer, and A. Rossberg. State-dependent representation independence. In POPL, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. A. Appel and D. McAllester. An indexed model of recursive types for foundational proof-carrying code. TOPLAS, 23(5):657--683, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. A. Appel, P.-A. Melliès, C. Richards, and J. Vouillon. A very modal model of a modern, major, general type system. In POPL, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. N. Benton and C.-K. Hur. Biorthogonality, step-indexing and compiler correctness. In ICFP, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. N. Benton and C.-K. Hur. Realizability and compositional compiler correctness for a polymorphic language. Technical Report MSR-TR-2010-62, Microsoft Research, Apr. 2010.Google ScholarGoogle Scholar
  7. L. Birkedal, K. Støvring, and J. Thamsborg. A relational realizability model for higher-order stateful ADTs. Submitted for publication, 2010.Google ScholarGoogle Scholar
  8. N. Bohr. Advances in Reasoning Principles for Contextual Equivalence and Termination. PhD thesis, IT University of Copenhagen, 2007.Google ScholarGoogle Scholar
  9. H. Cai, Z. Shao, and A. Vaynberg. Certified self-modifying code. In PLDI, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. A. Chlipala. A certified type-preserving compiler from lambda calculus to assembly language. In PLDI, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. A. Chlipala. Syntactic proofs of compositional compiler correctness, 2009. Submitted for publication.Google ScholarGoogle Scholar
  12. A. Chlipala. A verified compiler for an impure functional language. In POPL, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Z. Dargaye. Vérification formelle d'un compilateur pour langages fonctionnels. PhD thesis, Université Paris 7 Denis Diderot, July 2009.Google ScholarGoogle Scholar
  14. D. Dreyer, G. Neis, and L. Birkedal. The impact of higher-order state and control effects on local relational reasoning. In ICFP, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. C.-K. Hur and D. Dreyer. Technical appendix for this paper, 2010. URL: http://www.mpi-sws.org/~dreyer/papers/lrmlasm/Google ScholarGoogle Scholar
  16. G. Jaber and N. Tabareau. Krivine realizability for compiler correctness. In LOLA, 2010.Google ScholarGoogle Scholar
  17. J.-L. Krivine. Classical logic, storage operators and second-order lambda-calculus. Annals of Pure and Applied Logic, 68:53--78, 1994.Google ScholarGoogle ScholarCross RefCross Ref
  18. X. Leroy. A formally verified compiler back-end. Journal of Automated Reasoning, 43(4):363--446, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. A. McCreight, T. Chevalier, and A. Tolmach. A certified framework for compiling and executing garbage-collected languages. In ICFP, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. A. McCreight, Z. Shao, C. Lin, and L. Li. A general framework for certifying garbage collectors and their mutators. In PLDI, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. A. Pitts. Typed operational reasoning. In B. C. Pierce, editor, Advanced Topics in Types and Programming Languages, chapter 7. MIT Press, 2005.Google ScholarGoogle Scholar
  22. A. Pitts and I. Stark. Operational reasoning for functions with local state. In HOOTS, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. E. Sumii. A complete characterization of observational equivalence in polymorphic lambda-calculus with general references. In CSL, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. N. Torp-Smith, L. Birkedal, and J. C. Reynolds. Local reasoning about a copying garbage collector. TOPLAS, 30(4), 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A kripke logical relation between ML and assembly

            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
            • Published in

              cover image ACM Conferences
              POPL '11: Proceedings of the 38th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
              January 2011
              652 pages
              ISBN:9781450304900
              DOI:10.1145/1926385
              • cover image ACM SIGPLAN Notices
                ACM SIGPLAN Notices  Volume 46, Issue 1
                POPL '11
                January 2011
                624 pages
                ISSN:0362-1340
                EISSN:1558-1160
                DOI:10.1145/1925844
                Issue’s Table of Contents

              Copyright © 2011 ACM

              Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

              Publisher

              Association for Computing Machinery

              New York, NY, United States

              Publication History

              • Published: 26 January 2011

              Permissions

              Request permissions about this article.

              Request Permissions

              Check for updates

              Qualifiers

              • research-article

              Acceptance Rates

              Overall Acceptance Rate824of4,130submissions,20%

              Upcoming Conference

              POPL '25

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader