A theory of substructural types and control

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.

[1]  John C. Reynolds,et al.  Definitional Interpreters for Higher-Order Programming Languages , 1972, ACM '72.

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

[3]  Jonathan Aldrich,et al.  Typestate-oriented programming , 2009, OOPSLA Companion.

[4]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[5]  Paul Curzon,et al.  On Intuitionistic Linear Logic , 2005 .

[6]  Martin Odersky,et al.  Scalable component abstractions , 2005, OOPSLA '05.

[7]  Matthias Felleisen,et al.  The theory and practice of first-class prompts , 1988, POPL '88.

[8]  Norman I. Adams,et al.  The Revised Revised Report on Scheme or An Uncommon Lisp , 1985 .

[9]  P. J. Landin,et al.  A Generalization of Jumps and Labels , 1998, High. Order Symb. Comput..

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

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

[12]  Andrew Barber,et al.  Dual Intuitionistic Linear Logic , 1996 .

[13]  Olivier Danvy,et al.  A Functional Abstraction of Typed Contexts , 1989 .

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

[15]  Riccardo Pucella,et al.  Practical affine types , 2011, POPL '11.

[16]  Steve Zdancewic,et al.  Lolliproc: to concurrency from classical linear logic via curry-howard and control , 2010, ICFP '10.

[17]  Yukiyoshi Kameyama,et al.  Polymorphic Delimited Continuations , 2007, APLAS.

[18]  Juan Chen,et al.  Enforcing Stateful Authorization and Information Flow Policies in Fine , 2010, ESOP.

[19]  James Cheney,et al.  Region-based memory management in cyclone , 2002, PLDI '02.

[20]  John B. Goodenough,et al.  Structured exception handling , 1975, POPL '75.

[21]  Chung-chieh Shan,et al.  A Substructural Type System for Delimited Continuations , 2007, TLCA.

[22]  David K. Gifford,et al.  Polymorphic effect systems , 1988, POPL '88.

[23]  Hayo Thielecke,et al.  From control effects to typed continuation passing , 2003, POPL '03.