Affiliation:
1. University of Pennsylvania, USA
Abstract
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.
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Cited by
6 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Liquid Amortization: Proving Amortized Complexity with LiquidHaskell (Functional Pearl);Proceedings of the 17th ACM SIGPLAN International Haskell Symposium;2024-08-28
2. Story of Your Lazy Function’s Life: A Bidirectional Demand Semantics for Mechanized Cost Analysis of Lazy Programs;Proceedings of the ACM on Programming Languages;2024-08-15
3. Thunks and Debits in Separation Logic with Time Credits;Proceedings of the ACM on Programming Languages;2024-01-05
4. PureCake: A Verified Compiler for a Lazy Functional Language;Proceedings of the ACM on Programming Languages;2023-06-06
5. mimium: a self-extensible programming language for sound and music;Proceedings of the 9th ACM SIGPLAN International Workshop on Functional Art, Music, Modelling, and Design;2021-08-22