skip to main content
research-article

Superficially substructural types

Published:09 September 2012Publication History
Skip Abstract Section

Abstract

Many substructural type systems have been proposed for controlling access to shared state in higher-order languages. Central to these systems is the notion of a *resource*, which may be split into disjoint pieces that different parts of a program can manipulate independently without worrying about interfering with one another. Some systems support a *logical* notion of resource (such as permissions), under which two resources may be considered disjoint even if they govern the *same* piece of state. However, in nearly all existing systems, the notions of resource and disjointness are fixed at the outset, baked into the model of the language, and fairly coarse-grained in the kinds of sharing they enable.

In this paper, inspired by recent work on "fictional disjointness" in separation logic, we propose a simple and flexible way of enabling any module in a program to create its own custom type of splittable resource (represented as a commutative monoid), thus providing fine-grained control over how the module's private state is shared with its clients. This functionality can be incorporated into an otherwise standard substructural type system by means of a new typing rule we call *the sharing rule*, whose soundness we prove semantically via a novel resource-oriented Kripke logical relation.

References

  1. A. Ahmed. Semantics of Types for Mutable State. PhD thesis, Princeton University, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. A. Ahmed. Step-indexed syntactic logical relations for recursive and quantified types. In ESOP, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. A. Ahmed, D. Dreyer, and A. Rossberg. State-dependent representation independence. In POPL, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. A. Ahmed, M. Fluet, and G. Morrisett. A step-indexed model of substructural state. In ICFP, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. A. Ahmed, M. Fluet, and G. Morrisett. Łthree: A linear language with locations. Fundamenta Informaticae, 77:397--449, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 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
  7. J. Boyland. Checking interference with fractional permissions. In SAS, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. T. Brus, M. C. J. D. van Eekelen, M. van Leer, M. J. Plasmeijer, and H. P. Barendregt. Clean: A language for functional graph rewriting. In FPCA, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. C. Calcagno, P. Gardner, and U. Zarfaty. Context logic and tree update. In POPL, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. C. Calcagno, P. W. O'Hearn, and H. Yang. Local action and abstract separation logic. In LICS, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. R. DeLine and M. F\"ahndrich. Enforcing high-level protocols in low-level software. In PLDI, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. T. Dinsdale-Young, L. Birkedal, P. Gardner, M. Parkinson, and H. Yang. Views: Compositional reasoning for concurrency, 2012. Submitted for publication.Google ScholarGoogle Scholar
  13. T. Dinsdale-Young, M. Dodds, P. Gardner, M. Parkinson, and V. Vafeiadis. Concurrent abstract predicates. In ECOOP, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. T. Dinsdale-Young, P. Gardner, and M. Wheelhouse. Abstraction and refinement for local reasoning. In VSTTE, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. M. Dodds, X. Feng, M. J. Parkinson, and V. Vafeiadis. Deny-guarantee reasoning. In ESOP, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. 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
  17. D. Dreyer, G. Neis, A. Rossberg, and L. Birkedal. A relational modal logic for higher-order stateful ADTs. In POPL, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. J. Dunfield. A Unified System of Type Refinements. PhD thesis, Carnegie Mellon University, 2007.Google ScholarGoogle Scholar
  19. M. Fähndrich and R. DeLine. Adoption and focus: Practical linear types for imperative programming. In PLDI, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. J.-Y. Girard. Linear logic. TCS, 50(1):1---102, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. J. Jensen and L. Birkedal. Fictional separation logic. In ESOP, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. C. B. Jones. The role of auxiliary variables in the formal development of concurrent programs. In Reflections on the work of C.A.R. Hoare, pages 167--188. Springer, 2010.Google ScholarGoogle ScholarCross RefCross Ref
  23. N. R. Krishnaswami, L. Birkedal, and J. Aldrich. Verifying event-driven programs using ramified frame properties. In TLDI, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. N. R. Krishnaswami, A. Turon, D. Dreyer, and D. Garg. Superficially substructural types (Technical appendix), 2012.\ URL:verbGoogle ScholarGoogle Scholar
  25. http://www.mpi-sws.org/ dreyer/papers/supsub/Google ScholarGoogle Scholar
  26. .Google ScholarGoogle Scholar
  27. R. Ley-Wild and A. Nanevski. Subjective concurrent separation logic, 2012. Submitted for publication.Google ScholarGoogle Scholar
  28. K. Mazurak, J. Zhao, and S. Zdancewic. Lightweight linear types in System F$^\circ$. In TLDI, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. A. Nanevski, G. Morrisett, and L. Birkedal. Hoare Type Theory, polymorphism and separation. JFP, 18(5&6):865--911, Sept. 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. M. J. Parkinson and G. M. Bierman. Separation logic and abstraction. In POPL, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. A. Pilkiewicz and F. Pottier. The essence of monotonic state. In TLDI, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. 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
  33. A. Pitts and I. Stark. Operational reasoning for functions with local state. In HOOTS, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. F. Pottier. Hiding local state in direct style: a higher-order anti-frame rule. In LICS, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. F. Pottier. Syntactic soundness proof of a type-and-capability system with hidden state, 2011. Submitted for publication.Google ScholarGoogle Scholar
  36. J. C. Reynolds. Separation logic: A logic for shared mutable data structures. In LICS, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. J. Schwinghammer, L. Birkedal, F. Pottier, B. Reus, K. Støvring, and H. Yang. A step-indexed Kripke model of hidden state. Mathematical Structures in Computer Science, 2012. To appear.Google ScholarGoogle Scholar
  38. R. Shi, D. Zhu, , and H. Xi. A modality for safe resource sharing and code reentrancy. In ICTAC, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. F. Smith, D. Walker, and G. Morrisett. Alias types. In ESOP, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. R. E. Strom and S. Yemini. Typestate: A programming language concept for enhancing software reliability. IEEE Transactions on Software Engineering, 12(1):157---171, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. M. Tofte and J.-P. Talpin. Region-based memory management. Information and Computation, 132(2):109---176, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. J. Tov. Practical Programming with Substructural Types. PhD thesis, Northeastern University, 2012.Google ScholarGoogle Scholar
  43. V. Vafeiadis. Modular fine-grained concurrency verification. PhD thesis, University of Cambridge, 2008.Google ScholarGoogle Scholar
  44. D. Walker, K. Crary, and G. Morrisett. Typed memory management via static capabilities. TOPLAS, 22:701---771, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. J. Wickerson, M. Dodds, and M. Parkinson. Explicit stabilisation for modular rely-guarantee reasoning. In ESOP, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. N. Wolverson. Game semantics for an object-oriented language. PhD thesis, University of Edinburgh, 2008.Google ScholarGoogle Scholar
  47. H. Xi and F. Pfenning. Dependent types in practical programming. In POPL, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Superficially substructural types

            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

            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!