skip to main content
10.1145/2034773.2034831acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

A kripke logical relation for effect-based program transformations

Published:19 September 2011Publication History

ABSTRACT

We present a Kripke logical relation for showing the correctness of program transformations based on a type-and-effect system for an ML-like programming language with higher-order store and dynamic allocation.

We show how to use our model to verify a number of interesting program transformations that rely on effect annotations.

Our model is constructed as a step-indexed model over the standard operational semantics of the programming language. It extends earlier work [7, 8]that has considered, respectively, dynamically allocated first-order references and higher-order store for global variables (but no dynamic allocation). It builds on ideas from region-based memory management [21], and on Kripke logical relations for higher-order store [12, 14].

Our type-and-effect system is region-based and includes a region-masking rule which allows to hide local effects. One of the key challenges in the model construction for dynamically allocated higher-order store is that the meaning of a type may change since references, conceptually speaking, may become dangling due to region-masking. We explain how our Kripke model can be used to show correctness of program transformations for programs involving references that, conceptually, are dangling.

Skip Supplemental Material Section

Supplemental Material

_talk15.mp4

mp4

47.7 MB

References

  1. A. Ahmed. Semantics of Types for Mutable State. PhD thesis, Princeton University, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. A. Ahmed, D. Dreyer, and A. Rossberg. State-dependent representation independence. In Proceedings of POPL, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. A. J. Ahmed. Step-indexed syntactic logical relations for recursive and quantified types. In P. Sestoft, editor, ESOP, volume 3924 of Lecture Notes in Computer Science, pages 69--83. Springer, 2006. ISBN 3-540-33095-X. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. A. Aiken, M. Fähndrich, and R. Levien. Better static memory management: Improving region-based analysis of higher-order languages. In Prcoeedings of PLDI, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. N. Benton and P. Buchlovsky. Semantics of an effect analysis for exceptions. In Proceedings of TLDI, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. N. Benton, A. Kenney, M. Hofmann, and L. Beringer. Reading, writing and relations: Towards extensional semantics for effect analyses. In Proceedings of APLAS, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. N. Benton, L. Beringer, M. Hofmann, and A. Kennedy. Relational semantics for effect-based program transformations with dynamic allocation. In Proceedings of PPDP. ACM, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. N. Benton, L. Beringer, M. Hofmann, and A. Kennedy. Relational semantics for effect-based program transformations: Higher-order store. In Proceedings of PPDP. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. L. Birkedal, M. Tofte, and M. Vejlstrup. From region inference to von Neumann machines via region representation inference. In Proceedings of POPL, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. L. Birkedal, N. Torp-Smith, and H. Yang. Semantics of separation-logic typing and higher-order frame rules for algol-like langauges. Logical Methods in Computer Science, 2 (5:1): 1--33, 2006.Google ScholarGoogle ScholarCross RefCross Ref
  11. L. Birkedal, K. Støvring, and J. Thamsborg. Realizability semantics of parametric polymorphism, general references, and recursive types. In Proceedings of FOSSACS, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. L. Birkedal, B. Reus, J. Schwinghammer, K. Støvring, J. Thamsborg, and H. Yang. Step-indexed Kripke models over recursive worlds. In Proceedings of POPL, pages 119--132, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. D. Dreyer, A. Ahmed, and L. Birkedal. Logical step-indexed logical relations. In LICS, pages 71--80. IEEE Computer Society, 2009. ISBN 978-0-7695-3746-7. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. D. Dreyer, G. Neis, and L. Birkedal. The impact of higher-order state and control effects on local relational reasoning. In Proceedings of ICFP, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. D. Gifford and J. Lucassen. Integrating functional and imperative programming. In ACM Conference of LISP and Functional Programming, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. F. Henglein, M. Makholm, and H. Niss. A direct approach to control-flow sensitive region-based memory management. In Prcoeedings of PPDP, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. F. Henglein, H. Makholm, and H. Niss. Effect types and region-based memory management. In B. Pierce, editor, Advanced Topics in Types and Programming Languages. MIT Press, 2005.Google ScholarGoogle Scholar
  18. J. Lucassen and D. Gifford. Polymorphic effect systems. In Proceedings of POPL, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. A. Nanevski, G. Morrisett, and L. Birkedal. Polymorphism and separation in hoare type theory. In J. H. Reppy and J. L. Lawall, editors, ICFP, pages 62--73. ACM, 2006. ISBN 1-59593-309-3. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. A. M. Pitts. Relational properties of domains. Inf. Comput., 127 (2): 66--90, 1996.Google ScholarGoogle ScholarCross RefCross Ref
  21. M. Tofte and J.-P. Talpin. Implementation of the typed call-by-value λ-calculus using a stack of regions. In Proceedings of POPL, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A kripke logical relation for effect-based program transformations

          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
            ICFP '11: Proceedings of the 16th ACM SIGPLAN international conference on Functional programming
            September 2011
            470 pages
            ISBN:9781450308656
            DOI:10.1145/2034773
            • cover image ACM SIGPLAN Notices
              ACM SIGPLAN Notices  Volume 46, Issue 9
              ICFP '11
              September 2011
              456 pages
              ISSN:0362-1340
              EISSN:1558-1160
              DOI:10.1145/2034574
              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: 19 September 2011

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • research-article

            Acceptance Rates

            ICFP '11 Paper Acceptance Rate33of92submissions,36%Overall Acceptance Rate333of1,064submissions,31%

            Upcoming Conference

            ICFP '24

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader