Reasoning about the garden of forking paths

by   Yao Li, et al.

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.


page 1

page 2

page 3

page 4


Relational Cost Analysis for Functional-Imperative Programs

Relational cost analysis aims at formally establishing bounds on the dif...

Modeling Associative Reasoning Processes

The human capability to reason about one domain by using knowledge of ot...

Synthesizing Set Functions

Set functions are a feature of functional logic programming to encapsula...

Live Functional Programming with Typed Holes

This paper develops a dynamic semantics for incomplete functional progra...

The Faddeev-LeVerrier algorithm and the Pfaffian

We adapt the Faddeev-LeVerrier algorithm for the computation of characte...

Denotational semantics as a foundation for cost recurrence extraction for functional languages

A standard method for analyzing the asymptotic complexity of a program i...

Galois connecting call-by-value and call-by-name

We establish a general framework for reasoning about the relationship be...