Dependent Types for Low-Level Programming

In this paper, we describe the key principles of a dependent type system for low-level imperative languages. The major contributions of this work are (1) a sound type system that combines dependent types and mutation for variables and for heap-allocated structures in a more flexible way than before and (2) a technique for automatically inferring dependent types for local variables. We have applied these general principles to design Deputy, a dependent type system for C that allows the user to describe bounded pointers and tagged unions. Deputy has been used to annotate and check a number of real-world C programs.

[1]  Jeremy G. Siek Gradual Typing for Functional Languages , 2006 .

[2]  Zhe Yang,et al.  Modular checking for buffer overflows in the large , 2006, ICSE.

[3]  Miodrag Potkonjak,et al.  MediaBench: a tool for evaluating and synthesizing multimedia and communications systems , 1997, Proceedings of 30th Annual International Symposium on Microarchitecture.

[4]  Todd M. Austin,et al.  Efficient detection of all pointer and array access errors , 1994, PLDI '94.

[5]  David E. Culler,et al.  The nesC language: A holistic approach to networked embedded systems , 2003, PLDI.

[6]  George C. Necula,et al.  Data Slicing: Separating the Heap into Independent Regions , 2005, CC.

[7]  Stephen N. Freund,et al.  Hybrid Types , Invariants , and Refinements For Imperative Objects , 2006 .

[8]  Paul H. J. Kelly,et al.  Backwards-Compatible Bounds Checking for Arrays and Pointers in C Programs , 1997, AADEBUG.

[9]  Dinakar Dhurjati,et al.  Backwards-compatible array bounds checking for C with very low overhead , 2006, ICSE.

[10]  Frank Pfenning,et al.  Dependent types in practical programming , 1999, POPL '99.

[11]  Robert Szewczyk,et al.  System architecture directions for networked sensors , 2000, ASPLOS IX.

[12]  Alexander Aiken,et al.  A theory of type qualifiers , 1999, PLDI '99.

[13]  James Cheney,et al.  Cyclone: A Safe Dialect of C , 2002, USENIX Annual Technical Conference, General Track.

[14]  Harish Patil,et al.  Efficient Run-time Monitoring Using Shadow Processing , 1995, AADEBUG.

[15]  Cormac Flanagan,et al.  Hybrid type checking , 2006, POPL '06.

[16]  Robert Wahbe,et al.  Efficient software-based fault isolation , 1994, SOSP '93.

[17]  Walid Taha,et al.  Gradual Typing for Objects , 2007, ECOOP.

[18]  Martin C. Carlisle,et al.  Olden: parallelizing programs with dynamic data structures on distributed-memory machines , 1996 .

[19]  Hongwei Xi,et al.  Imperative programming with dependent types , 2000, Proceedings Fifteenth Annual IEEE Symposium on Logic in Computer Science (Cat. No.99CB36332).

[20]  Zachary R. Anderson,et al.  Static Analysis of C for Hybrid Type Checking , 2007 .

[21]  Dinakar Dhurjati,et al.  Memory safety without garbage collection for embedded applications , 2005, TECS.

[22]  Shane Markstrum,et al.  Semantic type qualifiers , 2005, PLDI '05.

[23]  George C. Necula,et al.  Using Dependent Types to Certify the Safety of Assembly Code , 2005, SAS.

[24]  George C. Necula,et al.  SafeDrive: safe and recoverable extensions using language-based techniques , 2006, OSDI '06.

[25]  George C. Necula,et al.  CIL: Intermediate Language and Tools for Analysis and Transformation of C Programs , 2002, CC.

[26]  Brian N. Bershad,et al.  Improving the reliability of commodity operating systems , 2005, TOCS.

[27]  George C. Necula,et al.  CCured: type-safe retrofitting of legacy software , 2005, TOPL.

[28]  Aleksandar Nanevski,et al.  Dependent type theory of stateful higher-order functions , 2005 .

[29]  Hans-Juergen Boehm Space efficient conservative garbage collection , 2004, SIGP.

[30]  David Walker,et al.  Dynamic Typing with Dependent Types , 2004, IFIP TCS.

[31]  Lennart Augustsson,et al.  Cayenne—a language with dependent types , 1998, ICFP '98.