Hostname: page-component-89b8bd64d-shngb Total loading time: 0 Render date: 2026-05-13T05:51:40.247Z Has data issue: false hasContentIssue false

A quantitative approach to global state composition

Published online by Cambridge University Press:  30 October 2025

Sandra Alves
Affiliation:
Faculdade de Ciências, Universidade do Porto, Rua do Campo Alegre, 4169-007, Porto, Portugal CRACS, INESC-TEC, DCC, Porto, Portugal
Delia Kesner
Affiliation:
Université Paris Cité, CNRS, IRIF, Paris, France
Miguel Ramos*
Affiliation:
Faculdade de Ciências, Universidade do Porto, Rua do Campo Alegre, 4169-007, Porto, Portugal Université Paris Cité, CNRS, IRIF, Paris, France LIACC, DCC, Porto, Portugal
*
Corresponding author: Miguel Ramos; Email: jmiguelsramos@gmail.com
Rights & Permissions [Opens in a new window]

Abstract

We show that recent approaches to quantitative analysis based on non-idempotent typing systems can be extended to programming languages with effects. In particular, we consider two cases: the weak open call-by-name (CBN) and call-by-value (CBV) variants of the $\lambda$-calculus, equipped with operations to write and read from a global state. In order to capture quantitative information with respect to time and space for both CBN and CBV, we design for each of them a quantitative type system based on a (tight) multi-type system. One key observation of this work is how CBN and CBV influence the composition of state types. That is, each type system is developed by taking into account how each language manages the global state: in CBN, the composition of state types is almost straightforward, since function application does not require evaluation of its argument; in CBV, however, the interaction between functions and arguments makes the composition of state types more subtle since only values can be passed as actual arguments. The main contribution of this paper is the design of type systems capturing quantitative information about effectful CBN and CBV programming languages. Indeed, we develop type systems that are qualitatively and quantitatively sound and complete.

Information

Type
Special Issue: WoLLIC 2023
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

Figure 1. The syntax of the $\lambda$-calculus.

Figure 1

Figure 2. Reduction rules for Weak Open CBN and CBV.

Figure 2

Figure 3. Weak Open CBN and CBV size.

Figure 3

Figure 4. Normal and neutral terms for Weak Open CBN and CBV.

Figure 4

Figure 5. Types for Weak Open CBN and CBV.

Figure 5

Figure 6. Typing rules for Weak Open CBN and CBV.

Figure 6

Figure 7. The extended syntax of the $\lambda$-calculus for Weak Open CBN with Global State.

Figure 7

Figure 8. Weak Open CBN size extended for global state.

Figure 8

Figure 9. Reduction rule for Weak Open CBN with Global State.

Figure 9

Figure 10. Normal and neutral terms for Weak Open CBN with Global State.

Figure 10

Figure 11. The CBN monadic translation for types, typing environments, and judgments.

Figure 11

Figure 12. Types for Weak Open CBN with Global State.

Figure 12

Figure 13. Typing rules for Weak Open CBN with Global State.

Figure 13

Figure 14. The extended syntax of the $\lambda$-calculus for Weak Open CBV with Global State.

Figure 14

Figure 15. Weak Open CBV size extended for global state.

Figure 15

Figure 16. Reduction rules and blocked configurations for Weak Open CBV with Global State.

Figure 16

Figure 17. Normal and neutral terms for Weak Open CBV with Global State.

Figure 17

Figure 18. The CBV monadic translation for types, typing environments, and judgments.

Figure 18

Figure 19. Types for Weak Open CBV with Global State.

Figure 19

Figure 20. Typing rules for Weak Open CBV with Global State.