## Liquid Types: Type Refinement via Predicate Abstraction

Patrick Rondon and Ranjit Jhala
CS2007-0903
September 18, 2007

Predicate abstraction and ML type inference are two well-known program analyses with very complementary strengths. The former is a technique for inferring precise, local, path-sensitive properties of base data values like integers but which is thwarted by complex data types and higher-order functions. The latter elegantly captures coarse properties of recursive data types and higher order functions. We present \emph{Liquid Types}, a system that synergistically combines the complementary strengths of predicate abstraction and ML type inference to yield an algorithm for statically inferring properties well beyond the scope of either technique. We have implemented liquid type inference for $\lang$, an extension of the $\lambda$-calculus with recursive types and ML style polymorphism. We present examples showing how liquid types can be used to statically prove the absence of divide-by-zero errors, out-of-bounds array access errors, and pattern match errors, with little to no user annotation.

## How to view this document

• Display an overview of the document in one of the following formats.

• Display a selected page in one of the following formats (document has 22 pages).
• Display the whole document in one of the following formats.