Lava:通过转换为Rocq实现Liquid Haskell的基础
Lava: Foundations for Liquid Haskell via Translation to Rocq
AI总结:
本文提出工具Lava,通过将Liquid Haskell转换为Rocq建立其形式化语义,明确了该语言计算与逻辑语义层面的差异,可作为所支持Liquid Haskell子集的证书检查器。
摘要:
Liquid Haskell是Glasgow Haskell编译器(GHC)的扩展,添加了精化类型支持:即受逻辑谓词限制的类型,其规约由SMT求解器自动检查,可在语言内提供轻量级验证。但Liquid Haskell背后庞大的可信代码库(从GHC到SMT求解器再到精化类型检查器本身)引发了对验证可信度的质疑,以及对与实现关联的Liquid Haskell形式化语义的需求。由于该语言存在计算和逻辑(用于精化谓词)两个语义层面,二者各自虽被充分理解,但交互微妙且仅被部分描述,这使得为Liquid Haskell建立理论基础变得复杂。我们通过转换为Rocq为Liquid Haskell提供语义,将计算和逻辑部分转换为同一种具有良好理解语义的语言,该转换明确了两个语义层面的差异。此转换用Haskell实现,附带的Rocq库包含替代SMT求解器的强大证明自动化功能,因此在实践层面,我们的工具Lava可作为所支持Liquid Haskell子集的证书检查器。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。