Reference. Scoped Effects as Parameterized Algebraic Theories

Notions of computation can be modelled by monads. Algebraic effects offer a characterization of monads in terms of algebraic operations and equational axioms, where operations are basic programming features, such as reading or updating the state, and axioms specify observably equivalent expressions. However, many useful programming features depend on additional mechanisms such as delimited scopes or dynamically allocated resources. Such mechanisms can be supported via extensions to algebraic effects including scoped effects and parameterized algebraic theories . We present a fresh perspective on scoped effects by translation into a variation of parameterized algebraic theories. The translation enables a new approach to equational reasoning for scoped effects and gives rise to an alternative characterization of monads in terms of generators and equations involving both scoped and algebraic operations. We demonstrate the power of our fresh perspective by way of equational characterizations of several known models of scoped effects.

Cite

Cite as @lindley-2024-scoped (helia, typst) · \cite{lindley-2024-scoped} (LaTeX)
BibTeX
bibtex · 1 line
@inbook{lindley-2024-scoped, title={Scoped Effects as Parameterized Algebraic Theories}, ISBN={9783031572623}, ISSN={1611-3349}, url={http://dx.doi.org/10.1007/978-3-031-57262-3_1}, DOI={10.1007/978-3-031-57262-3_1}, booktitle={Programming Languages and Systems}, publisher={Springer Nature Switzerland}, author={Lindley, Sam and Matache, Cristina and Moss, Sean and Staton, Sam and Wu, Nicolas and Yang, Zhixuan}, year={2024}, pages={3–21} }
hayagriva YAML (typst)
yaml · 21 lines
lindley-2024-scoped:
  type: chapter
  title: Scoped Effects as Parameterized Algebraic Theories
  author:
  - Lindley, Sam
  - Matache, Cristina
  - Moss, Sean
  - Staton, Sam
  - Wu, Nicolas
  - Yang, Zhixuan
  date: 2024
  page-range: 3-21
  url: http://dx.doi.org/10.1007/978-3-031-57262-3_1
  serial-number:
    doi: 10.1007/978-3-031-57262-3_1
    isbn: '9783031572623'
    issn: 1611-3349
  parent:
    type: book
    title: Programming Languages and Systems
    publisher: Springer Nature Switzerland
Cited by (1)

Scoped Effects, Scoped Operations, and Parameterized Algebraic Theories matache-2025-scoped

Notions of computation can be modeled by monads. Algebraic effects offer a characterization of monads in terms of algebraic operations and equational axioms, where operations are basic programming features, such as reading or updating the state, and axioms specify observably equivalent expressions. However, many useful programming features depend on additional mechanisms such as delimited scopes or dynamically allocated resources. Such mechanisms can be supported via extensions to algebraic effects including scoped effects and parameterized algebraic theories . We present a fresh perspective on scoped effects by translation into a variation of parameterized algebraic theories. The translation enables a new approach to equational reasoning for scoped effects and gives rise to an alternative characterization of monads in terms of generators and equations involving both scoped and algebraic operations. We demonstrate the power of our approach by way of equational characterizations of several known models of scoped effects.
PDF · DOI · pldb
Cites 46 works (5 here)
With notes (5)

Modular Models of Monoids with Operations yang-2023-modular

Inspired by algebraic effects and the principle of notions of computations as monoids, we study a categorical framework for equational theories and models of monoids equipped with operations. The framework covers not only algebraic operations but also scoped and variable-binding operations. Appealingly, in this framework both theories and models can be modularly composed. Technically, a general monoid-theory correspondence is shown, saying that the category of theories of algebraic operations is equivalent to the category of monoids. Moreover, more complex forms of operations can be coreflected into algebraic operations, in a way that preserves initial algebras. On models, we introduce modular models of a theory, which can interpret abstract syntax in the presence of other operations. We show constructions of modular models (i) from monoid transformers, (ii) from free algebras, (iii) by composition, and (iv) in symmetric monoidal categories.
PDF · DOI · pldb

Formal metatheory of second-order abstract syntax fiore-2022-formal

Despite extensive research both on the theoretical and practical fronts, formalising, reasoning about, and implementing languages with variable binding is still a daunting endeavour – repetitive boilerplate and the overly complicated metatheory of capture-avoiding substitution often get in the way of progressing on to the actually interesting properties of a language. Existing developments offer some relief, however at the expense of inconvenient and error-prone term encodings and lack of formal foundations. We present a mathematically-inspired language-formalisation framework implemented in Agda. The system translates the description of a syntax signature with variable-binding operators into an intrinsically-encoded, inductive data type equipped with syntactic operations such as weakening and substitution, along with their correctness properties. The generated metatheory further incorporates metavariables and their associated operation of metasubstitution, which enables second-order equational/rewriting reasoning. The underlying mathematical foundation of the framework – initial algebra semantics – derives compositional interpretations of languages into their models satisfying the semantic substitution lemma by construction.
PDF · DOI · arXiv · pldb

Structured Handling of Scoped Effects yang-2022-structured

Algebraic effects offer a versatile framework that covers a wide variety of effects. However, the family of operations that delimit scopes are not algebraic and are usually modelled as handlers, thus preventing them from being used freely in conjunction with algebraic operations. Although proposals for scoped operations exist, they are either ad-hoc and unprincipled, or too inconvenient for practical programming. This paper provides the best of both worlds: a theoretically-founded model of scoped effects that is convenient for implementation and reasoning. Our new model is based on an adjunction between a locally finitely presentable category and a category of functorial algebras . Using comparison functors between adjunctions, we show that our new model, an existing indexed model, and a third approach that simulates scoped operations in terms of algebraic ones have equal expressivity for handling scoped operations. We consider our new model to be the sweet spot between ease of implementation and structuredness. Additionally, our approach automatically induces fusion laws of handlers of scoped effects, which are useful for reasoning and optimisation.
PDF · DOI · arXiv · pldb

Linear logic girard_linear_1987

The familiar connective of negation is broken into two operations: linear negation which is the purely negative part of negation and the modality “of course” which has the meaning of a reaffirmation. Following this basic discovery, a completely new approach to the whole area between constructive logics and programmation is initiated.
DOI

Functorial Semantics of Algebraic Theories lawvere_1963

Web
External (41)
lindley-2024-scoped reference entries/refs/lindley-2024-scoped/lindley-2024-scoped.hel