skip to main content
research-article

Functional translation of a calculus of capabilities

Published:20 September 2008Publication History
Skip Abstract Section

Abstract

Reasoning about imperative programs requires the ability to track aliasing and ownership properties. We present a type system that provides this ability, by using regions, capabilities, and singleton types. It is designed for a high-level calculus with higher-order functions, algebraic data structures, and references (mutable memory cells). The type system has polymorphism, yet does not require a value restriction, because capabilities act as explicit store typings.

We exhibit a type-directed, type-preserving, and meaning-preserving translation of this imperative calculus into a pure calculus. Like the monadic translation, this is a store-passing translation. Here, however, the store is partitioned into multiple fragments, which are threaded through a computation only if they are relevant to it. Furthermore, the decomposition of the store into fragments can evolve dynamically to reflect ownership transfers.

The translation offers deep insight about the inner workings and soundness of the type system. If coupled with a semantic model of its target calculus, it leads to a semantic model of its imperative source calculus. Furthermore, it provides a foundation for our long-term objective of designing a system for specifying and certifying imperative programs with dynamic memory allocation.

Skip Supplemental Material Section

Supplemental Material

Video

References

  1. Arthur Chargu´eraud and François Pottier. Technical appendix. http://arthur.chargueraud.org/research/2008/icfp/.Google ScholarGoogle Scholar
  2. Amal Ahmed, Matthew Fluet, and Greg Morrisett. L3: A linear language with locations. Fundamenta Informaticæ, 77(4), 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Mike Barnett, Rob DeLine, Manuel Fähndrich, K. Rustan M. Leino, and Wolfram Schulte. Verification of object-oriented programs with invariants. Journal of Object Technology, 3(6), 2004.Google ScholarGoogle ScholarCross RefCross Ref
  4. John Tang Boyland and William Retert. Connecting effects and uniqueness with adoption. In POPL, pages 283--295, January 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Michael Brandt and Fritz Henglein. Coinductive axiomatization of recursive type equality and subtyping. Fundamenta Informaticæ, 33:309--338, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Chih-Ping Chen and Paul Hudak. Rolling your own mutable ADT-a connection between linear types and monads. In POPL, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Karl Crary, David Walker, and Greg Morrisett. Typed memory management in a calculus of capabilities. In POPL, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Jean-Christophe Filliâtre. Verification of non-functional programs using interpretations in type theory. JFP, 13(4), 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Jean-Christophe Filliâtre and Claude Marché. TheWhy/Krakatoa/Caduceus platform for deductive program verification. In CAV, volume 4590 of LNCS, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Matthew Fluet and Greg Morrisett. Monadic regions. JFP, 16(4-5):485--545, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Matthew Fluet, Greg Morrisett, and Amal Ahmed. Linear regions are all you need. In ESOP, volume 3924 of LNCS, March 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Manuel Fähndrich and Robert DeLine. Adoption and focus: practical linear types for imperative programming. In PLDI, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Eugenio Moggi. An abstract view of programming languages. Technical Report ECS-LFCS-90-113, University of Edinburgh, 1989.Google ScholarGoogle Scholar
  14. Aleksandar Nanevski, Amal Ahmed, Greg Morrisett, and Lars Birkedal. Abstract predicates and mutable ADTs in Hoare type theory. In ESOP, LNCS, March 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Peter W. O'Hearn and John C. Reynolds. From Algol to polymorphic linear lambda-calculus. Journal of the ACM, 47(1):167--223, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Benjamin C. Pierce. Types and Programming Languages. MIT Press, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. François Pottier. Hiding local state in direct style: a higher-order anti-frame rule. In LICS, 2008.Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. John C. Reynolds. Separation logic: A logic for shared mutable data structures. In LICS, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Frederick Smith, David Walker, and Greg Morrisett. Alias types. In ESOP, volume 1782 of LNCS, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Mads Tofte and Jean-Pierre Talpin. Region-based memory management. Information and Computation, 132(2):109--176, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Philip Wadler. The essence of functional programming. In POPL, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. David Walker and Greg Morrisett. Alias types for recursive data structures. In TIC, volume 2071 of LNCS, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Dengping Zhu and Hongwei Xi. Safe programming with pointers through stateful views. In PADL, volume 3350 of LNCS, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Functional translation of a calculus of capabilities

      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 SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 43, Issue 9
        ICFP '08
        September 2008
        399 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/1411203
        Issue’s Table of Contents
        • cover image ACM Conferences
          ICFP '08: Proceedings of the 13th ACM SIGPLAN international conference on Functional programming
          September 2008
          422 pages
          ISBN:9781595939197
          DOI:10.1145/1411204

        Copyright © 2008 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 20 September 2008

        Check for updates

        Qualifiers

        • research-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!