Table of Contents
Fetching ...

Strong Normalisation for Asynchronous Effects

Danel Ahman, Ilja Sobolev

TL;DR

The paper investigates termination guarantees for the core calculus $\lambda_{\ae}$ of asynchronous algebraic effects, which models asynchronous operation calls via signals, interrupts, and interrupt handlers alongside blocking awaits. It develops a type-directed reducibility framework based on $\top\top$-lifting (an extension of Girard–Tait techniques) and Kripke-style indexing to handle the interplay of sequential and parallel computations and their effects, proving strong normalisation for the recursion-free sequential fragment, and for a restricted reinstallable-interrupt-handlers variant. It further shows that reinstantiating interrupt handlers breaks SN in parallel settings unless carefully constrained, and provides a strongly normalising variant that encodes reinstallability with sum types in handler return values. The results are formalised in Agda, providing rigorous termination guarantees for expressive asynchronous computations and guiding the design of safe higher-order effectful languages with dynamic concurrency features.

Abstract

Asynchronous effects of Ahman and Pretnar complement the conventional synchronous treatment of algebraic computational effects with asynchrony based on decoupling the execution of algebraic operation calls into signalling that an operation's implementation needs to be executed, and into interrupting a running computation with the operation's result, to which the computation can react by installing matching interrupt handlers. Beyond providing asynchrony for algebraic effects, the resulting core calculus also naturally models examples such as pre-emptive multi-threading, (cancellable) remote function calls, multi-party applications, and even a parallel variant of runners of algebraic effects. In this paper, we study the normalisation properties of this calculus. We prove that if one removes general recursion from the original calculus, then the remaining calculus is strongly normalising, including both its sequential and parallel parts. However, this only guarantees termination for very simple asynchronous examples. To improve on this result, we also prove that the sequential fragment of the calculus remains strongly normalising when a controlled amount of interrupt-driven recursive behaviour is reintroduced. Our strong normalisation proofs are structured compositionally as a natural extension of Lindley and Stark's $\top\top$-lifting based approach for proving strong normalisation of effectful languages. All our results are also formalised in Agda.

Strong Normalisation for Asynchronous Effects

TL;DR

The paper investigates termination guarantees for the core calculus of asynchronous algebraic effects, which models asynchronous operation calls via signals, interrupts, and interrupt handlers alongside blocking awaits. It develops a type-directed reducibility framework based on -lifting (an extension of Girard–Tait techniques) and Kripke-style indexing to handle the interplay of sequential and parallel computations and their effects, proving strong normalisation for the recursion-free sequential fragment, and for a restricted reinstallable-interrupt-handlers variant. It further shows that reinstantiating interrupt handlers breaks SN in parallel settings unless carefully constrained, and provides a strongly normalising variant that encodes reinstallability with sum types in handler return values. The results are formalised in Agda, providing rigorous termination guarantees for expressive asynchronous computations and guiding the design of safe higher-order effectful languages with dynamic concurrency features.

Abstract

Asynchronous effects of Ahman and Pretnar complement the conventional synchronous treatment of algebraic computational effects with asynchrony based on decoupling the execution of algebraic operation calls into signalling that an operation's implementation needs to be executed, and into interrupting a running computation with the operation's result, to which the computation can react by installing matching interrupt handlers. Beyond providing asynchrony for algebraic effects, the resulting core calculus also naturally models examples such as pre-emptive multi-threading, (cancellable) remote function calls, multi-party applications, and even a parallel variant of runners of algebraic effects. In this paper, we study the normalisation properties of this calculus. We prove that if one removes general recursion from the original calculus, then the remaining calculus is strongly normalising, including both its sequential and parallel parts. However, this only guarantees termination for very simple asynchronous examples. To improve on this result, we also prove that the sequential fragment of the calculus remains strongly normalising when a controlled amount of interrupt-driven recursive behaviour is reintroduced. Our strong normalisation proofs are structured compositionally as a natural extension of Lindley and Stark's -lifting based approach for proving strong normalisation of effectful languages. All our results are also formalised in Agda.
Paper Structure (21 sections, 28 theorems, 35 equations, 2 figures)

This paper contains 21 sections, 28 theorems, 35 equations, 2 figures.

Key Result

Proposition 1

Given $V \in \mathbf{VRed}_X^\Gamma$ and $\rho \in \mathsf{Ren}\;\Gamma\;\Gamma'$, then we have $V[\rho] \in \mathbf{VRed}_X^{\Gamma'}$, and analogously for the other reducibility predicates for computations and continuations.

Figures (2)

  • Figure 1: Evaluation contexts-based small-step operational semantics of $\lambda_{\text{\ae}}$'s sequential part.
  • Figure 2: Evaluation contexts-based small-step operational semantics of $\lambda_{\text{\ae}}$'s parallel part.

Theorems & Definitions (28)

  • Proposition 1
  • Proposition 2
  • Theorem 3
  • Proposition 4
  • Proposition 5
  • Proposition 6
  • Proposition 7
  • Proposition 8
  • Proposition 9
  • Proposition 10
  • ...and 18 more