10.1145/1708016.1708027acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article

Lightweight linear types in system f°

Published:23 January 2010Publication History

ABSTRACT

We present System F°, an extension of System F that uses kinds to distinguish between linear and unrestricted types, simplifying the use of linearity for general-purpose programming. We demonstrate through examples how System F° can elegantly express many useful protocols, and we prove that any protocol representable as a DFA can be encoded as an F° type. We supply mechanized proofs of System F°'s soundness and parametricity properties, along with a nonstandard operational semantics that formalizes common intuitions about linearity and aids in reasoning about protocols.

We compare System F° to other linear systems, noting that the simplicity of our kind-based approach leads to a more explicit account of what linearity is meant to capture, allowing otherwise-conflicting interpretations of linearity (in particular, restrictions on aliasing versus restrictions on resource usage) to coexist peacefully. We also discuss extensions to System F^o aimed at making the core language more practical, including the additive fragment of linear logic, algebraic datatypes, and recursion.

References

  1. Amal Ahmed, Matthew Fluet, and Greg Morrisett. A step-indexed model of substructural state. In ICFP '05: Proceedings of the tenth ACM SIGPLAN international conference on Functional programming, pages 78--91, New York, NY, USA, 2005. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Amal Ahmed, Matthew Fluet, and Greg Morrisett. L3: A linear language with locations. Fundam. Inf., 77(4):397--449, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Andrew Barber. Linear Type Theories, Semantics and Action Calculi. PhD thesis, Edinburgh University, 1997.Google ScholarGoogle Scholar
  4. Nick Benton, G. M. Bierman, J. Martin E. Hyland, and Valeria de Paiva. A term calculus for intuitionistic linear logic. In M. Bezem and J. F. Groote, editors, Proceedings of the International Conference on Typed Lambda Calculi and Applications, pages 75--90. Springer-Verlag LNCS 664, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. P. N. Benton. A mixed linear and non-linear logic: proofs, terms and models. In Proceedings of Computer Science Logic (CSL '94), Kazimierz, Poland., pages 121--135. Springer-Verlag, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. G. M. Bierman, A. M. Pitts, and C. V. Russo. Operational properties of lily, a polymorphic linear lambda calculus with recursion. In Fourth International Workshop on Higher Order Operational Techniques in Semantics, Montral, volume 41 of Electronic Notes in Theoretical Computer Science. Elsevier, 2000.Google ScholarGoogle Scholar
  7. Gavin M. Bierman. Program equivalence in a linear functional language. Journal of Functional Programming, 10(2), 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Lars Birkedal, Rasmus Ejlers Møgelberg, and Rasmus Lerchedahl Petersen. Category-theoretic models of Linear Abadi & Plotkin Logic. Theory and Applications in Categories, 20(7), 2008.Google ScholarGoogle Scholar
  9. Arthur Charguéraud and Franc¸ois Pottier. Functional translation of a calculus of capabilities. In ICFP '08: Proceeding of the 13th ACM SIGPLAN international conference on Functional programming, pages 213--224, New York, NY, USA, 2008. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Karl Crary, David Walker, and Greg Morrisett. Typed memory management in a calculus of capabilities. In Proc. 26th ACM Symp. on Principles of Programming Languages (POPL), pages 262--275, San Antonio, Texas, January 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Robert DeLine and Manuel Fähndrich. Enforcing high-level protocols in low-level software. In Proc. of the SIGPLAN Conference on Programming Language Design, pages 59--69, Snowbird, UT, June 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Manuel Fähndrich, Mark Aiken, Chris Hawblitzel, Orion Hodson, Galen Hunt, James R. Larus, and Steven Levi. Language support for fast and reliable message-based communication in singularity os. SIGOPS Oper. Syst. Rev., 40(4):177--190, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Manuel Fähndrich and Robert DeLine. Adoption and focus: Practical linear types for imperative programming. In Proc. of the SIGPLAN Conference on Programming Language Design, pages 13--24, Berlin, Germany, June 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Jean-Yves Girard. Interprétation fonctionnelle et élimination des coupures de l'arith mé tique d'ordre supérieur. Thèse d'état, University of Paris VII, 1972. Summary in J. E. Fenstad, editor, Scandinavian Logic Symposium, pp. 63--92, North-Holland, 1971.Google ScholarGoogle Scholar
  15. Jean-Yves Girard. Linear logic. Theoretical Computer Science, 50:1--102, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Jean-Yves Girard, Y. Lafont, and P. Taylor. Proofs and Types. Cambridge University Press, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Michael Hicks, Greg Morrisett, Dan Grossman, and Trevor Jim. Experience with safe manual memory-management in Cyclone. In ISMM'04: Proceedings of the 4th international symposium on Memory management, pages 73--84, New York, NY, USA, 2004. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Kohei Honda, Vasco T. Vasconcelos, and Makoto Kubo. Language primitives and type discipline for structured communication-based programming. In ESOP98, volume 1381 of LNCS, pages 122--138. Springer-Verlag, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Atsushi Igarashi and Naoki Kobayashi. Resource usage analysis. ACM Trans. Program. Lang. Syst., 27(2):264--313, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Oleg Kiselyov and Chung-chieh Shan. Lightweight monadic regions. In Haskell '08: Proceedings of the first ACM SIGPLAN symposium on Haskell, pages 1--12, New York, NY, USA, 2008. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Yves Lafont. The linear abstract machine. Theoretical Computer Science, 59:157--180, 1988. Some corrections in volume 62 (1988), pp. 327--328. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Patrick Lincoln and John Mitchell. Operational aspects of linear lambda calculus. In 7th Symposium on Logic in Computer Science, IEEE, pages 235--246. IEEE Computer Society Press, 1992.Google ScholarGoogle ScholarCross RefCross Ref
  23. John C. Reynolds. Towards a theory of type structure. In Programming Symposium, volume 19 of Lecture Notes in Computer Science, pages 408--425. Springer-Verlag, Paris, France, April 1974. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. John C. Reynolds. Types, abstraction, and parametric polymorphism. In R.E.A Mason, editor, Information Processing, pages 513--523. Elsevier Science Publishers B.V., 1983.Google ScholarGoogle Scholar
  25. Kaku Takeuchi, Kohei Honda, and Makoto Kubo. An interactionbased language and its typing system. In Proceedings of PARLE'94, pages 398--413. Springer-Verlag, 1994. Lecture Notes in Computer Science number 817. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. David N. Turner and Philip Wadler. Operational interpretations of linear logic. Theoretical Computer Science, 227(1-2):231--248, September 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Vasco T. Vasconcelos, Simon J. Gay, and António Ravara. Type checking a multithreaded functional language with session types. Theoretical Computer Science, 368(1--2):64--87, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Edsko Vries, Rinus Plasmeijer, and David M. Abrahamson. Uniqueness typing simplified. In Implementation and Application of Functional Languages: 19th International Workshop, IFL 2007, Freiburg, Germany, September 27-29, 2007. Revised Selected Papers, pages 201--218, Berlin, Heidelberg, 2008. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Philip Wadler. Linear types can change the world! In M. Broy and C. Jones, editors, Progarmming Concepts and Methods, Sea of Galilee, Israel, April 1990. North Holland. IFIP TC 2 Working Conference.Google ScholarGoogle Scholar
  30. Philip Wadler. There's no substitute for linear logic. In 8th International Workshop on the Mathematical Foundations of Programming Semantics, 1992.Google ScholarGoogle Scholar
  31. PhilipWadler. A taste of linear logic. In Mathematical Foundations of Computer Science, volume 711 of Lecture Notes in Computer Science, pages 185--210. Springer-Verlag, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. David Walker. A type system for expressive security policies. In Proc. 27th ACM Symp. on Principles of Programming Languages (POPL), pages 254--267. ACM Press, Jan 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. David Walker. Advanced Topics in Types and Programming Languages, chapter Substructural Type Systems. MIT Press, 2005.Google ScholarGoogle Scholar
  34. Keith Wansbrough and Simon Peyton Jones. Once upon a polymorphic type. In POPL '99: Proceedings of the 26th ACM SIGPLANSIGACT symposium on Principles of programming languages, pages 15--28, New York, NY, USA, 1999. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Andrew K. Wright and Matthias Felleisen. A syntactic approach to type soundness. Information and Computation, 115(1):38--94, 1994. Preliminary version in Rice TR 91-160. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Dengping Zhu and Hongwei Xi. Safe Programming with Pointers through Stateful Views. In Proceedings of the 7th International Symposium on Practical Aspects of Declarative Languages, pages 83--97, Long Beach, CA, January 2005. Springer-Verlag LNCS vol. 3350. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Lightweight linear types in system f°

    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
      TLDI '10: Proceedings of the 5th ACM SIGPLAN workshop on Types in language design and implementation
      January 2010
      108 pages
      ISBN:9781605588919
      DOI:10.1145/1708016

      Copyright © 2010 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 23 January 2010

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate 11 of 26 submissions, 42%

    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!