Lightweight Invariants with Full Dependent Types

Dependent types allow a programmer to express invariant properties of functions, such as the relationship between the input and output lengths of a list. Several “lightweight” approaches to dependent types have been proposed for existing systems, such as Haskell’s Generalised Algebraic Data Types or Type Families. Such approaches are lightweight in the sense that they require minimal modifications to existing systems. However, while these extensions are apparently simple, we find that we often run into limitations fairly quickly. In this paper we will explore these limitations, and show that a full dependent type system allows more straightforward implementation of simple invariants without restricting expressivity.

[1]  Edwin Brady,et al.  A Dependently Typed Framework for Static Analysis of Program Execution Costs , 2005, IFL.

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

[3]  Walid Taha,et al.  Multi-Stage Programming: Its Theory and Applications , 1999 .

[4]  Edwin Brady,et al.  Correct-by-Construction Concurrency , 2008 .

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

[6]  Hugo Herbelin,et al.  The Coq proof assistant : reference manual, version 6.1 , 1997 .

[7]  Conor McBride Faking it: Simulating dependent types in Haskell , 2002, J. Funct. Program..

[8]  P. Medawar A view from the left , 1984, Nature.

[9]  U. Norell,et al.  Towards a practical programming language based on dependent type theory , 2007 .

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

[11]  Walid Taha,et al.  Concoqtion: indexed types now! , 2007, PEPM '07.

[12]  SheardTim Type-level Computation Using Narrowing in Ωmega , 2007 .

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

[14]  Tim Sheard,et al.  WHAT IS A PROOF , 2005 .

[15]  Christine Paulin-Mohring,et al.  The coq proof assistant reference manual , 2000 .

[16]  Thorsten Altenkirch,et al.  Epigram reloaded: a standalone typechecker for ETT , 2005, Trends in Functional Programming.

[17]  Edwin Brady,et al.  Constructing Correct Circuits: Verification of Functional Aspects of Hardware Specifications with Dependent Types , 2007, Trends in Functional Programming.

[18]  Edwin Brady,et al.  Practical implementation of a dependently typed functional programming language , 2005 .

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

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