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

02/16/2022
by   Dylan McDermott, et al.
0

We establish a general framework for reasoning about the relationship between call-by-value and call-by-name. In languages with side-effects, call-by-value and call-by-name executions of programs often have different, but related, observable behaviours. For example, if a program might diverge but otherwise has no side-effects, then whenever it terminates under call-by-value, it terminates with the same result under call-by-name. We propose a technique for stating and proving these properties. The key ingredient is Levy's call-by-push-value calculus, which we use as a framework for reasoning about evaluation orders. We construct maps between the call-by-value and call-by-name interpretations of types. We then identify properties of side-effects that imply these maps form a Galois connection. These properties hold for some side-effects (such as divergence), but not others (such as mutable state). This gives rise to a general reasoning principle that relates call-by-value and call-by-name. We apply the reasoning principle to example side-effects including divergence and nondeterminism.

READ FULL TEXT

page 1

page 2

page 3

page 4

11/06/2018

Gradual Type Theory (Extended Version)

Gradually typed languages are designed to support both dynamically typed...
01/23/2021

Equational reasoning for non-determinism monad: the case of Spark aggregation

As part of the author's studies on equational reasoning for monadic prog...
02/14/2022

Quantitative Strongest Post

We present a novel strongest-postcondition-style calculus for quantitati...
01/26/2021

A program logic for fresh name generation

We present a program logic for Pitts and Stark's ν-calculus, an extensio...
05/21/2018

One Monad to Prove Them All (Functional Pearl)

One Monad to Prove Them All is a modern fairy tale about curiosity and p...
07/21/2022

Temporal Verification with Answer-Effect Modification

Type-and-effect systems are a widely-used approach to program verificati...
03/12/2021

Reasoning about the garden of forking paths

Lazy evaluation is a powerful tool for functional programmers. It enable...