Chapter

Programming Languages and Systems

Volume 4421 of the series Lecture Notes in Computer Science pp 520-535

Dependent Types for Low-Level Programming

  • Jeremy ConditAffiliated withUniversity of California, Berkeley
  • , Matthew HarrenAffiliated withUniversity of California, Berkeley
  • , Zachary AndersonAffiliated withUniversity of California, Berkeley
  • , David GayAffiliated withIntel Research, Berkeley
  • , George C. NeculaAffiliated withUniversity of California, Berkeley

Abstract

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.