Ensuring Correct-by-Construction Resource Usage by using Full-Spectrum Dependent Types

Where it has been done at all, formally demonstrating the correctness of functional programs has historically focused on proving essential properties derived from the functional specification of the software. In this paper, we show that correct-by-construction software development can also handle the equally important class of extra-functional properties, namely the correct usage of resources. We do this using a novel embedded domain-specific language approach that exploits the capabilities of full-spectrum dependent types. Our approach provides significant benefits over previous approaches based on less powerful type systems in reducing notational overhead, and in simplifying the process of formal proof.

[1]  Alan Dearle,et al.  Design, Implementation and Deployment of State Machines Using a Generative Approach , 2007, WADS.

[2]  Walid Taha,et al.  A Gentle Introduction to Multi-stage Programming , 2003, Domain-Specific Program Generation.

[3]  Edwin Brady,et al.  Ivor, a Proof Engine , 2006, IFL.

[4]  Naoki Kobayashi,et al.  Type-Based Analysis of Deadlock for a Concurrent Calculus with Interrupts , 2007, ESOP.

[5]  Magnus Carlsson,et al.  An exercise in dependent types: A well-typed interpreter , 1999 .

[6]  Peter J. Stuckey,et al.  Resource Usage Verification , 2003, APLAS.

[7]  Peter Thiemann,et al.  An embedded domain-specific language for type-safe server-side web scripting , 2005, TOIT.

[8]  Chung-chieh Shan,et al.  Lightweight Static Capabilities , 2007, PLPV@IJCAR.

[9]  Walid Taha,et al.  Tagless staged interpreters for typed languages , 2002, ICFP '02.

[10]  Wouter Swierstra,et al.  The power of Pi , 2008, ICFP.

[11]  Simon Thompson,et al.  Haskell: The Craft of Functional Programming , 1996 .

[12]  Simon L. Peyton Jones,et al.  Simple unification-based type inference for GADTs , 2006, ICFP '06.

[13]  Ganesh Sittampalam,et al.  Paradise: a two-stage DSL embedded in Haskell , 2008, ICFP.

[14]  Gerald J. Sussman,et al.  Structure and interpretation of computer programs , 1985, Proceedings of the IEEE.

[15]  Paul Hudak,et al.  Building domain-specific embedded languages , 1996, CSUR.

[16]  Ralf Lämmel,et al.  Strongly typed heterogeneous collections , 2004, Haskell '04.

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

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

[19]  Chung-chieh Shan,et al.  Position : Lightweight static resources ? Sexy types for embedded and systems programming , 2007 .

[20]  David Walker,et al.  Policy enforcement via program monitoring , 2006 .

[21]  Benjamin C. Pierce,et al.  Mechanized Metatheory for the Masses: The PoplMark Challenge , 2005, TPHOLs.

[22]  Mary Sheeran,et al.  Lava: hardware design in Haskell , 1998, ICFP '98.

[23]  Edwin Brady,et al.  A verified staged interpreter is a verified compiler , 2006, GPCE '06.

[24]  P. J. Landin,et al.  The next 700 programming languages , 1966, CACM.

[25]  Peter Hancock,et al.  Interactive Programs in Dependent Type Theory , 2000, CSL.

[26]  Greg J. Michaelson,et al.  Hume: A Domain-Specific Language for Real-Time Embedded Systems , 2003, GPCE.

[27]  Naoki Kobayashi,et al.  A Type System for Lock-Free Processes , 2002, Inf. Comput..

[28]  Ganesh Sittampalam,et al.  Paradise: a two-stage DSL embedded in Haskell , 2008, ICFP 2008.

[29]  Simon L. Peyton Jones,et al.  Type checking with open type functions , 2008, ICFP.

[30]  Peter Amey,et al.  Correctness By Construction: Better Can Also Be Cheaper , 2002 .

[31]  Lars Birkedal,et al.  Ynot: dependent types for imperative programs , 2008, ICFP.