计算机科学 > 程序设计语言
[提交于 2021年3月12日]
标题:Reasoning about the garden of forking paths
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要: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.
提交历史
来自:Yao Li[v1] 2021年3月12日 星期五 21:42:36 UTC