Lava: Foundations for Liquid Haskell via Translation to Rocq
Colin Rothgang, Loïc Peyrot, Yannick Forster, Michael Greenberg, Niki Vazou
Abstract
Liquid Haskell is an extension of the Glasgow Haskell compiler (GHC) that adds support for refinement types: types restricted by logical predicates. Specifications are automatically checked by an SMT solver, thus offering lightweight verification directly within the language. However, the necessarily large trusted codebase behind Liquid Haskell (from GHC to the SMT solver to the refinement typechecker itself) raises the question of trust in the verification and the necessity for a formalized semantics of Liquid Haskell linked to its implementation. Grounding Liquid Haskell in theory is complicated by the interaction between two semantic levels in the language: a computational one and a logical one (for refinement predicates). While both are well understood separately, their interaction is subtle and has only been partially described. We give a semantics to Liquid Haskell by translation to Rocq. Both the computational and logical parts are translated to the same language, with a well-understood semantics; our translation makes the discrepancy between the two semantic levels explicit. The translation is implemented in Haskell and comes with a Rocq library that includes powerful proof automation standing in for the SMT solver. Thus, on the practical level, our tool Lava serves as a certificate checker for the supported subset of Liquid Haskell.
Create a lesson
Related papers
Contravariant Universe Subtyping, Formalized, Mechanized
Shengyi Jiang, Jason Z. S. Hu
Mechanising Denotational Semantics in Agda
Peter D. Mosses, Jesper Cockx, Bernhard Reus
(Implicitly) Characterizing Probabilistic Polynomial Time as Used in Cryptography
Ugo Dal Lago, Giulia Giusti
A Simplified Layout Algebra for GPU Kernels
Nan An, Xiaotian Zhou
Coexponential Exploration in the Clef Programming Language
Houston Haynes
Bayes Rule for Conditioning Probabilistic Programs
Feras A. Saad