Reasoning about the garden of forking paths

03/12/2021
by   Yao Li, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

12/10/2018

Relational Cost Analysis for Functional-Imperative Programs

Relational cost analysis aims at formally establishing bounds on the dif...
01/03/2022

Modeling Associative Reasoning Processes

The human capability to reason about one domain by using knowledge of ot...
08/22/2018

Synthesizing Set Functions

Set functions are a feature of functional logic programming to encapsula...
05/01/2018

Live Functional Programming with Typed Holes

This paper develops a dynamic semantics for incomplete functional progra...
08/10/2020

The Faddeev-LeVerrier algorithm and the Pfaffian

We adapt the Faddeev-LeVerrier algorithm for the computation of characte...
02/17/2020

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

A standard method for analyzing the asymptotic complexity of a program i...
02/16/2022

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

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