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

research
12/10/2018

Relational Cost Analysis for Functional-Imperative Programs

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

Modeling Associative Reasoning Processes

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

Synthesizing Set Functions

Set functions are a feature of functional logic programming to encapsula...
research
12/09/2021

Towards Neural Functional Program Evaluation

This paper explores the capabilities of current transformer-based langua...
research
05/01/2018

Live Functional Programming with Typed Holes

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

The Faddeev-LeVerrier algorithm and the Pfaffian

We adapt the Faddeev-LeVerrier algorithm for the computation of characte...
research
02/16/2022

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

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

Please sign up or login with your details

Forgot password? Click here to reset