Strong Normalisation for Asynchronous Effects
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.
💡 Research Summary
The paper conducts a thorough meta‑theoretic study of the λæ calculus introduced by Ahman and Pretnar for modelling asynchronous algebraic effects. The calculus separates an effectful operation call into two distinct phases: an outgoing signal ↑op that requests the execution of the operation’s implementation, and an incoming interrupt ↓op that delivers the result back to the caller, which can install interrupt handlers and explicitly await promises. This decoupling eliminates the inherent blocking of traditional algebraic effects and enables natural representations of pre‑emptive multithreading, cancellable remote calls, multi‑party protocols, and even parallel runners.
The authors first consider the fragment of λæ without any form of general recursion. They show that both the sequential fragment (which contains values, computations, and the asynchronous constructs) and the parallel fragment (processes built from run M, parallel composition, and signal/interrupt propagation) are strongly normalising (SN). The proof proceeds by extending the Girard‑Tait reducibility method with the ⊤⊤‑lifting technique introduced by Lindley and Stark. ⊤⊤‑lifting lifts effectful terms twice, allowing a simultaneous treatment of the pure core and the effect‑annotated layer. Effect annotations (o, ι) form a partial order that is respected by the lifting, ensuring that reduction steps cannot increase effect “size”. Consequently every well‑typed term reduces in a finite number of steps, despite the calculus’s inherent nondeterminism and non‑confluence.
Recognising that the recursion‑free fragment is too weak for realistic asynchronous programs, the paper then re‑introduces a controlled form of recursion via “reinstallable interrupt handlers”. These handlers may be re‑installed after handling an interrupt, thereby permitting limited self‑reference without full general recursion. The authors prove that even with this feature the sequential fragment remains SN. The key insight is that the reinstallable handlers are typed with effect annotations that bound the depth of nesting; the reducibility candidates are refined to respect this bound, preventing infinite unfolding of handler re‑installation.
Finally, the authors address the full parallel calculus without reinstallable handlers. They demonstrate that the combination of parallel composition, signal broadcasting, and interrupt propagation does not break SN. The proof shows that each parallel component independently satisfies the SN property and that the broadcast rules preserve the well‑foundedness of the reduction measure. Thus, in the absence of unrestricted recursion, the entire λæ language—both sequential and parallel aspects—is strongly normalising.
All results are formalised in Agda, and the mechanised development is publicly available. The formalisation validates the intricate interplay of higher‑order functions, effect annotations, non‑blocking continuations, and the non‑deterministic operational semantics. The paper’s contributions provide a solid theoretical foundation for designing safe asynchronous effect systems, showing that termination guarantees can be retained even when expressive asynchronous communication patterns are present, provided recursion is suitably restricted. This work paves the way for future languages and libraries that aim to combine algebraic effects with asynchronous programming while preserving strong meta‑theoretic properties.
Comments & Academic Discussion
Loading comments...
Leave a Comment