Title
Refinement types for Haskell
Abstract
We present LiquidHaskell (http://goto.ucsd.edu/liquid), an automatic verifier for Haskell. LiquidHaskell uses Refinement types, a restricted form of dependent types where relationships between values are encoded by decorating types with logical predicates drawn from an efficiently SMT decidable theory (of arithmetic and uninterpreted functions.) In this talk, we will describe the key ingredients of LiquidHaskell. First, we will present a rapid overview of refinement types, including SMT solver based (decidable) subtyping, and inference. Decidability is achieved by eschewing the use of arbitrary terms inside types, and the use of indices to encode rich properties of data. Second, we will show how to recover some of the expressiveness lost by restricting the logic, with two new techniques: measures which encode structural properties of values and abstract refinements which enable generalization (i.e. quantification) over refinements. Third, we will discuss the curious interaction of laziness and refinement typing. In a nutshell, the technique of refinement typing can be viewed as a type-based generalization of Floyd-Hoare logics. Surprisingly, we demonstrate that under non-strict evaluation, these logics (and hence, classical refinement typing) is unsound, due to the presence of potentially divergent sub-computations. Fortunately, we show how soundness can be recovered with a termination analysis, itself, circularly bootstrapped off refinement typing. We have used LiquidHaskell to verify safety, functional correctness and termination properties of real-world Haskell libraries totalling mroe than 10,000 lines of code. Time permitting, we will present a demonstration of the tool and a few short case studies illustrating its use.
Year
DOI
Venue
2014
10.1145/2541568.2541569
PLPV
Keywords
DocType
Citations 
refinement type,type-based generalization,termination property,refinement typing,smt decidable theory,classical refinement typing,smt solver,termination analysis,real-world haskell library,abstract refinement,type inference,dependent types
Conference
10
PageRank 
References 
Authors
0.52
23
1
Name
Order
Citations
PageRank
Ranjit Jhala12183111.68