Refinement types for Haskell. SMT-based checking of refinement types for call-by-value languages is a well-studied subject. Unfortunately, the classical translation of refinement types to verification conditions is unsound under lazy evaluation. When checking an expression, such systems implicitly assume that all the free variables in the expression are bound to values. This property is trivially guaranteed by eager, but does not hold under lazy, evaluation. Thus, to be sound and precise, a refinement type system for Haskell and the corresponding verification conditions must take into account which subset of binders actually reduces to values. We present a stratified type system that labels binders as potentially diverging or not, and that (circularly) uses refinement types to verify the labeling. We have implemented our system in LiquidHaskell and present an experimental evaluation of our approach on more than 10,000 lines of widely used Haskell libraries. We show that LiquidHaskell is able to prove 96% of all recursive functions terminating, while requiring a modest 1.7 lines of termination-annotations per 100 lines of code.
Keywords for this software
References in zbMATH (referenced in 4 articles , 1 standard article )
Showing results 1 to 4 of 4.
- Alpuente, M.; Ballis, D.; Sapiña, J.: Efficient safety enforcement for Maude programs via program specialization in the \textsfÁTAME system (2020)
- Fedyukovich, Grigory; Kaufman, Samuel J.; Bodík, Rastislav: Learning inductive invariants by sampling from frequency distributions (2020)
- Sato, Ryosuke; Kobayashi, Naoki: Modular verification of higher-order functional programs (2017)
- Vazou, Niki; Seidel, Eric L.; Jhala, Ranjit; Vytiniotis, Dimitrios; Peyton-Jones, Simon: Refinement types for Haskell (2014)