Hostname: page-component-5db58dd55d-qmkzp Total loading time: 0 Render date: 2026-05-26T10:52:11.916Z Has data issue: false hasContentIssue false

Call-by-value and call-by-name: A simple proof of a classic theorem

Published online by Cambridge University Press:  29 October 2025

DARIUSZ BIERNACKI
Affiliation:
University of Wrocław, Wrocław, Poland (e-mail: dabi@cs.uni.wroc.pl)
JAMES MCKINNA
Affiliation:
Heriot-Watt University, Edinburgh EH14 4AS, UK (e-mail: j.mckinna@hw.ac.uk)
FILIP SIECZKOWSKI
Affiliation:
Heriot-Watt University, Edinburgh EH14 4AS, UK and University of Wrocław, Wrocław, Poland (e-mail: efes@cs.uni.wroc.pl)
Rights & Permissions [Opens in a new window]

Abstract

One of the natural problems of operational semantics is to characterise the relationship between eager and lazy evaluation. In the context of $\lambda$-calculus, this is expressed by the classic theorem that call-by-value evaluation of a program to (weak-head) normal form can always be simulated by a call-by-name evaluation. While the statement and intuition behind it are simple and clear, naive attempts at proof famously fail: the result is usually established as a consequence of the more complex standardisation theorem. In this work, we develop and formalise a novel and lightweight inductive approach to tackle the problem of simulation between two semantics for a single calculus, but with different evaluation orders. We exercise our method on the classic call-by-value and call-by-name example and report on methodological takeaways suggested by our approach, in particular what effect the flavour of semantics chosen has on the proof.

Information

Type
Theoretical Pearl
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited.
Copyright
© The Author(s), 2025. Published by Cambridge University Press
Figure 0

Fig. 1. The (scope-aware) syntax of untyped $\lambda$-calculus. We elide the sets of free variables except where their inclusion aids clarity. We take closed terms, i.e., $p \in \Lambda^\emptyset$, as complete programs.

Figure 1

Fig. 2. Environment semantics for call-by-value (left) and call-by-name (right). The difference in structure of the two semantics is highlighted by framing the distinctive parts of the two definitions. Note that in both cases, closures and values are closed by construction. To avoid clutter, we elide the sets of free variables except where useful as a clarification.

Figure 2

Fig. 3. The simulation relation for environment semantics.

Figure 3

Fig. 4. Small-step, substitution-based semantics: call-by-value (left) and call-by-name (right). The notation $e[e'/x]$ denotes a substitution of expression e’ for the variable x in e; we take values v to range over closed lambda abstractions, and only reduce closed programs.

Figure 4

Fig. 5. Simulation definition for small-step, substitution-based semantics. Here, $\mathrel{\sim^{\mathrm{t}}}$ is the open, structural closure of the relation for arguments, $\sim$. The later is expressed in terms of the ‘chase’ relation, which in turn utilises a structural relation on partially evaluated programs, $\mathrel{\sim^{\mathrm{p}}}$.

Figure 5

Fig. 6. Agda formalisation of the syntax and operational semantics for call-by-value (left) and call-by-name (right) lambda-calculus.

Figure 6

Fig. 7. Agda formalisation of the simulation relation for environment semantics.

Figure 7

Fig. 8. The Agda proof of the simulation theorem.

Supplementary material: File

Biernacki et al. supplementary material

Biernacki et al. supplementary material
Download Biernacki et al. supplementary material(File)
File 12.5 KB
Submit a response

Discussions

No Discussions have been published for this article.