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

关于分叉小径花园的推理

Reasoning about the garden of forking paths

Yao Li, Li-yao Xia, Stephanie Weirich

摘要:

惰性求值是函数式程序员的一个强大工具。它使按需计算的简洁表达和其他评估策略下不可用的组合形式。然而,惰性求值的状态性质使得很难分析程序的计算成本,无论是非正式的还是正式的。在这项工作中,我们提出了一个新的和简单的框架,正式推理懒惰的计算成本的基础上最近的模型懒惰的评价:千里眼呼叫的价值。我们的框架的关键特征是它的简单性,正如我们对千里眼单子的定义所表达的那样。这个单子既容易定义(大约20行Coq),也容易推理。我们表明,这个单子可以有效地用于机械原因懒惰的功能程序的计算成本在Coq。

英文摘要:

Lazy evaluation is a powerful tool for functional programmers. It enables the concise expression of on-demand computation and a form of compositionality not available under other evaluation strategies. However, the stateful nature of lazy evaluation makes it hard to analyze a program's computational cost, either informally or formally. In this work, we present a novel and simple framework for formally reasoning about lazy computation costs based on a recent model of lazy evaluation: clairvoyant call-by-value. The key feature of our framework is its simplicity, as expressed by our definition of the clairvoyance monad. This monad is both simple to define (around 20 lines of Coq) and simple to reason about. We show that this monad can be effectively used to mechanically reason about the computational cost of lazy functional programs written in Coq.

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

↑