Lightweight linear types in system f°

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.

[1]  Philip Wadler,et al.  Operational Interpretations of Linear Logic , 1999, Theor. Comput. Sci..

[2]  J. Gregory Morrisett,et al.  L3: A Linear Language with Locations , 2007, Fundam. Informaticae.

[3]  Claudio V. Russo,et al.  Operational Properties of Lily, a Polymorphic Linear Lambda Calculus with Recursion , 2001, HOOTS.

[4]  J. Y. Girard,et al.  Interpretation fonctionelle et elimination des coupures dans l'aritmetique d'ordre superieur , 1972 .

[5]  António Ravara,et al.  Type checking a multithreaded functional language with session types , 2006, Theor. Comput. Sci..

[6]  Benjamin C. Pierce,et al.  Advanced Topics In Types And Programming Languages , 2004 .

[7]  J. Girard,et al.  Proofs and types , 1989 .

[8]  J. Gregory Morrisett,et al.  A step-indexed model of substructural state , 2005, ICFP '05.

[9]  Philip Wadler,et al.  A Syntax for Linear Logic , 1993, MFPS.

[10]  Philip Wadler,et al.  There's No Substitute for Linear Logic , 1991 .

[11]  Atsushi Igarashi,et al.  Resource usage analysis , 2002, POPL '02.

[12]  Matthias Felleisen,et al.  A Syntactic Approach to Type Soundness , 1994, Inf. Comput..

[13]  John C. Reynolds,et al.  Towards a theory of type structure , 1974, Symposium on Programming.

[14]  Philip Wadler,et al.  A Taste of Linear Logic , 1993, MFCS.

[15]  Arthur Charguéraud,et al.  Functional translation of a calculus of capabilities , 2008 .

[16]  Chung-chieh Shan,et al.  Lightweight monadic regions , 2008, Haskell '08.

[17]  Andrew G. Barber,et al.  Linear type theories, semantics and action calculi , 1997 .

[18]  James R. Larus,et al.  Language support for fast and reliable message-based communication in singularity OS , 2006, EuroSys.

[19]  Kohei Honda,et al.  An Interaction-based Language and its Typing System , 1994, PARLE.

[20]  Matthew Fluet,et al.  A Linear Language with Locations , 2007 .

[21]  Dan Grossman,et al.  Experience with safe manual memory-management in cyclone , 2004, ISMM '04.

[22]  Rasmus Ejlers Møgelberg,et al.  Category-theoretic models of Linear Abadi & Plotkin Logic , 2008 .

[23]  John C. Reynolds,et al.  Types, Abstraction and Parametric Polymorphism , 1983, IFIP Congress.

[24]  Marinus J. Plasmeijer,et al.  Uniqueness Typing Simplified , 2008, IFL.

[25]  Yves Lafont,et al.  The Linear Abstract Machine , 1988, Theor. Comput. Sci..

[26]  Gavin M. Bierman,et al.  Program equivalence in a linear functional language , 2000, Journal of Functional Programming.

[27]  Patrick Lincoln,et al.  Linear logic , 1992, SIGA.

[28]  David Walker,et al.  A type system for expressive security policies , 2000, POPL '00.

[29]  Simon L. Peyton Jones,et al.  Once upon a polymorphic type , 1999, POPL '99.

[30]  Robert DeLine,et al.  Enforcing high-level protocols in low-level software , 2001, PLDI '01.

[31]  Nick Benton,et al.  A Mixed Linear and Non-Linear Logic: Proofs, Terms and Models (Extended Abstract) , 1994, CSL.

[32]  Robert DeLine,et al.  Adoption and focus: practical linear types for imperative programming , 2002, PLDI '02.

[33]  Rasmus Ejlers Møgelberg,et al.  Parametric Domain-theoretic models of Linear Abadi & Plotkin Logic , 2005 .

[34]  Hongwei Xi,et al.  Safe Programming with Pointers Through Stateful Views , 2005, PADL.

[35]  Vasco Thudichum Vasconcelos,et al.  Language Primitives and Type Discipline for Structured Communication-Based Programming Revisited: Two Systems for Higher-Order Session Communication , 1998, SecReT@ICALP.

[36]  Philip Wadler,et al.  Linear Types can Change the World! , 1990, Programming Concepts and Methods.

[37]  P. Lincoln,et al.  Operational aspects of linear lambda calculus , 1992, [1992] Proceedings of the Seventh Annual IEEE Symposium on Logic in Computer Science.

[38]  Nick Benton,et al.  A Term Calculus for Intuitionistic Linear Logic , 1993, TLCA.