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
- 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 Scholar
Digital Library
- Amal Ahmed, Matthew Fluet, and Greg Morrisett. L3: A linear language with locations. Fundam. Inf., 77(4):397--449, 2007. Google Scholar
Digital Library
- Andrew Barber. Linear Type Theories, Semantics and Action Calculi. PhD thesis, Edinburgh University, 1997.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- Gavin M. Bierman. Program equivalence in a linear functional language. Journal of Functional Programming, 10(2), 2000. Google Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- Jean-Yves Girard. Linear logic. Theoretical Computer Science, 50:1--102, 1987. Google Scholar
Digital Library
- Jean-Yves Girard, Y. Lafont, and P. Taylor. Proofs and Types. Cambridge University Press, 1989. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Atsushi Igarashi and Naoki Kobayashi. Resource usage analysis. ACM Trans. Program. Lang. Syst., 27(2):264--313, 2005. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Yves Lafont. The linear abstract machine. Theoretical Computer Science, 59:157--180, 1988. Some corrections in volume 62 (1988), pp. 327--328. Google Scholar
Digital Library
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- David N. Turner and Philip Wadler. Operational interpretations of linear logic. Theoretical Computer Science, 227(1-2):231--248, September 1999. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- Philip Wadler. There's no substitute for linear logic. In 8th International Workshop on the Mathematical Foundations of Programming Semantics, 1992.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- David Walker. Advanced Topics in Types and Programming Languages, chapter Substructural Type Systems. MIT Press, 2005.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
Index Terms
Lightweight linear types in system f°





Comments