Sciweavers

TACAS
2007
Springer

State of the Union: Type Inference Via Craig Interpolation

14 years 5 months ago
State of the Union: Type Inference Via Craig Interpolation
The ad-hoc use of unions to encode disjoint sum types in C programs and the inability of C’s type system to check the safe use of these unions is a long standing source of subtle bugs. We present a dependent type system that rigorously captures the ad-hoc protocols that programmers use to encode disjoint sums, and introduce a novel technique for automatically inferring, via Craig Interpolation, those dependent types and thus those protocols. In addition to checking the safe use of unions, the dependent type information inferred by interpolation gives programmers looking to modify or extend legacy code a precise understanding of the conditions under which some fields may safely be accessed. We present an empirical evaluation of our technique on 350KLOC of open source C code. In 80 out of 90 predicated edges (corresponding to 1472 out of 1684 union accesses), our type system is able to infer the correct dependent types. This demonstrates that our type system captures and explicates pr...
Ranjit Jhala, Rupak Majumdar, Ru-Gang Xu
Added 09 Jun 2010
Updated 09 Jun 2010
Type Conference
Year 2007
Where TACAS
Authors Ranjit Jhala, Rupak Majumdar, Ru-Gang Xu
Comments (0)