skip to main content
research-article

A theory of substructural types and control

Published:22 October 2011Publication History
Skip Abstract Section

Abstract

Exceptions are invaluable for structured error handling in high-level languages, but they are at odds with linear types. More generally, control effects may delete or duplicate portions of the stack, which, if we are not careful, can invalidate all substructural usage guarantees for values on the stack. We have developed a type-and-effect system that tracks control effects and ensures that values on the stack are never wrongly duplicated or dropped. We present the system first with abstract control effects and prove its soundness. We then give examples of three instantiations with particular control effects, including exceptions and delimited continuations, and show that they meet the soundness criteria for specific control effects.

References

  1. A. Ahmed, M. Fluet, and G. Morrisett. A step-indexed model of substructural state. In Proc. 10th ACM SIGPLAN International Conference on Functional Programming (ICFP'05), pages 78--91, Tallinn, Estonia, September 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. J. Aldrich, J. Sunshine, D. Saini, and Z. Sparks. Typestate-oriented programming. In Proc. Onward!, pages 1015--1022, Orlando, FL, USA, October 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. K. Asai and Y. Kameyama. Polymorphic delimited continuations. In Programming Languages and Systems, volume 4807 of Lecture Notes in Computer Science, pages 239--254. Springer, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. A. Barber. Dual intuitionistic linear logic. Technical Report ECS-LFCS-960347, Laboratory for Foundations of Computer Science, University of Edinburgh, September 1996.Google ScholarGoogle Scholar
  5. G. M. Bierman. On Intuitionistic Linear Logic. PhD thesis, University of Cambridge, August 1993.Google ScholarGoogle Scholar
  6. W. Clinger, ed. The revised revised report on Scheme or an UnCommon Lisp. AI Memo No. 848, MIT AI Lab, Cambridge, MA, USA, August 1985.Google ScholarGoogle Scholar
  7. O. Danvy and A. Filinski. A functional abstraction of typed contexts. Technical Report DIKU Rapport 89/12, Computer Science Department, University of Copenhagen, Denmark, 1989.Google ScholarGoogle Scholar
  8. M. Felleisen. The theory and practice of first-class prompts. In Proc. 15th Annual ACM Symposium on Principles of Programming Languages (POPL'88), pages 180--190, San Diego, CA, USA, January 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. J.-Y. Girard. Linear logic. Theoretical Computer Science, 50 (1): 1--102, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. J. B. Goodenough. Structured exception handling. In Proc. 2th Annual ACM Symposium on Principles of Programming Languages (POPL'75), pages 204--224, Palo Alto, CA, USA, January 1975. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. J. Gosling, B. Joy, and G. Steele. The Java Language Specification. Addison Wesley, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. D. Grossman, G. Morrisett, T. Jim, M. Hicks, Y. Wang, and J. Cheney. Region-based memory management in Cyclone. In Proc. 2002 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'02), pages 282--293, Berlin, Germany, June 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. O. Kiselyov and C. Shan. A substructural type system for delimited continuations. In Proc. 8th International Conference on Typed Lambda Calculi and Applications (TLCA'07), pages 223--239, Paris, France, June 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. P. J. Landin. A generalization of jumps and labels. Technical report, UNIVAC Systems Programming Research, 1965.Google ScholarGoogle Scholar
  15. J. M. Lucassen and D. K. Gifford. Polymorphic effect systems. In Proc. 15th Annual ACM Symposium on Principles of Programming Languages (POPL'88), pages 47--57, San Diego, CA, USA, January 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. K. Mazurak and S. Zdancewic. Lolliproc: to concurrency from classical linear logic via Curry-Howard and control. In Proc. 15th ACM SIGPLAN International Conference on Functional Programming (ICFP'10), pages 39--50, Baltimore, MD, USA, September 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. G. Morrisett, A. Ahmed, and M. Fluet. L$^3$: A linear language with locations. In Proc. 7th International Conference on Typed Lambda Calculi and Applications (TLCA'05), pages 293--307, Nara, Japan, April 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. M. Odersky and M. Zenger. Scalable component abstractions. In Proc 20th ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'05), pages 41--57, San Diego, CA, USA, October 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. J. C. Reynolds. Definitional interpreters for higher-order programming languages. In Proc. ACM Annual Conference, volume 2, pages 717--470, Boston, MA, USA, August 1972. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. N. Swamy, J. Chen, and R. Chugh. Enforcing stateful authorization and information flow policies in Fine. In A. D. Gordon, editor, Proc. 19th European Symposium on Programming (ESOP'10), volume 6012 of Lecture Notes in Computer Science, pages 529--549, Paphos, Cyprus, March 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. H. Thielecke. From control effects to typed continuation passing. In Proc. 30th Annual ACM Symposium on Principles of Programming Languages (POPL'03), pages 139--149, New Orleans, LA, USA, January 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. J. A. Tov and R. Pucella. Practical affine types. In Proc. 38th Annual ACM Symposium on Principles of Programming Languages (POPL'11), pages 447--458, Austin, TX, USA, January 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. P. Wadler. There's no substitute for linear logic. In Proc. 8th International Workshop on the Mathematical Foundations of Programming Semantics (MFPS'92), Oxford, UK, April 1992.Google ScholarGoogle Scholar
  24. D. Walker. Substructural type systems. In B. C. Pierce, editor, Advanced Topics in Types and Programming Languages, pages 3--44. MIT Press, Cambridge, 2005.Google ScholarGoogle Scholar

Index Terms

  1. A theory of substructural types and control

    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

    • Article Metrics

      • Downloads (Last 12 months)11
      • Downloads (Last 6 weeks)3

      Other Metrics

    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!