足够聪明的编译器是一个定理证明器
The sufficiently smart compiler is a theorem prover
摘要:
Haskell编译器GHC能够证明Haskell代码之间的非平凡等式,凭借其积极的优化器,特别是编译器中的术语重写引擎。我们在GHC插件中用一个令人惊讶的小代码演示了这一点,解释了我们必须转动的旋钮,讨论了这种方法的局限性和相同想法的相关应用,即测试Haskell库中具有特定于域的优化的承诺。
英文摘要:
That the Haskell Compiler GHC is capable of proving non-trivial equalities between Haskell code, by virtue of its aggressive optimizer, in particular the term rewriting engine in the simplifier. We demonstrate this with a surprising little code in a GHC plugin, explains the knobs we had to turn, discuss the limits of the approach and related applications of the same idea, namely testing that promises from Haskell libraries with domain-specific optimizations hold.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。