arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1806.03541cs.PL
收藏

函数珍珠:所有人的定理证明(Liquid Haskell中的等式推理)

Functional Pearl: Theorem Proving for All (Equational Reasoning in Liquid Haskell)

Niki Vazou, Joachim Breitner, Will Kunkel, David Van Horn, Graham Hutton

摘要:

等式推理是Haskell等纯函数式语言的关键特性之一。然而,到目前为止,这种推理总是在Haskell外部进行,要么在纸上手动进行,要么在定理证明器中机械化。本文展示了如何在Haskell中直接无缝地执行等式推理,并使用Liquid Haskell进行检查。特别是,语言学习者-对他们来说,外部定理证明器是遥不可及的-可以从机械地检查他们的证明中受益。具体地说,我们展示了如何从格雷厄姆的教科书中的方程证明和推导可以被改写为Haskell中的证明(剧透:它们看起来本质上是一样的)。

英文摘要:

Equational reasoning is one of the key features of pure functional languages such as Haskell. To date, however, such reasoning always took place externally to Haskell, either manually on paper, or mechanised in a theorem prover. This article shows how equational reasoning can be performed directly and seamlessly within Haskell itself, and be checked using Liquid Haskell. In particular, language learners --- to whom external theorem provers are out of reach --- can benefit from having their proofs mechanically checked. Concretely, we show how the equational proofs and derivations from Graham's textbook can be recast as proofs in Haskell (spoiler: they look essentially the same).

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑