Reference. Modular models of monoids with operations by lifting functors along fibrations
Inspired by Plotkin and Power’s algebraic treatment of computational effects and the principle of notions of computations as monoids, we propose a categorical framework for equational theories and models of monoids equipped with operations. This framework generalises Plotkin and Power’s algebraic treatment of effectful operations taking or returning values as input or output to operations that may take or return computations as input or output. Additionally, to give semantic models of computational effects in a modular way, we introduce a formal theory of modular constructions of algebraic structures based on the framework of lifting functors along fibrations.
Cite
Cites 103 works (15 here)
With notes (15)
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.
Quotients, inductive types, and quotient inductive types fiore-2022-quotients
This paper introduces an expressive class of indexed quotient-inductive types, called QWI types, within the framework of constructive type theory. They are initial algebras for indexed families of equational theories with possibly infinitary operators and equations. We prove that QWI types can be derived from quotient types and inductive types in the type theory of toposes with natural number object and universes, provided those universes satisfy the Weakly Initial Set of Covers (WISC) axiom. We do so by constructing QWI types as colimits of a family of approximations to them defined by well-founded recursion over a suitable notion of size, whose definition involves the WISC axiom. We developed the proof and checked it using the Agda theorem prover.
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.
Breadth-First Traversal via Staging gibbons-2022-breadth
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.
Reasoning about effect interaction by fusion yang-2021-reasoning
Effect handlers can be composed by applying them sequentially, each handling some operations and leaving other operations uninterpreted in the syntax tree. However, the semantics of composed handlers can be subtle—it is well known that different orders of composing handlers can lead to drastically different semantics. Determining the correct order of composition is a non-trivial task. To alleviate this problem, this paper presents a systematic way of deriving sufficient conditions on handlers for their composite to correctly handle combinations, such as the sum and the tensor, of the effect theories separately handled. These conditions are solely characterised by the clauses for relevant operations of the handlers, and are derived by fusing two handlers into one using a form of fold/build fusion and continuation-passing style transformation. As case studies, the technique is applied to commutative and distributive interaction of handlers to obtain a series of results about the interaction of common handlers: (a) equations respected by each handler are preserved after handler composition; (b) handling mutable state before any handler gives rise to a semantics in which state operations are commutative with any operations from the latter handler; (c) handling the writer effect and mutable state in either order gives rise to a correct handler of the commutative combination of these two theories.
Handlers in action kammar-2013-handlers
Kan Extensions for Program Optimisation Or: Art and Dan Explain an Old Trick hinze-2012-kan
Parameterised notions of computation atkey-2009-parameterised
Moggi’s Computational Monads and Power et al .‘s equivalent notion of Freyd category have captured a large range of computational effects present in programming languages. Examples include non-termination, non-determinism, exceptions, continuations, side effects and input/output. We present generalisations of both computational monads and Freyd categories, which we call parameterised monads and parameterised Freyd categories, that also capture computational effects with parameters. Examples of such are composable continuations, side effects where the type of the state varies and input/output where the range of inputs and outputs varies. By considering structured parameterisation also, we extend the range of effects to cover separated side effects and multiple independent streams of I/O. We also present two typed λ-calculi that soundly and completely model our categorical definitions – with and without symmetric monoidal parameterisation – and act as prototypical languages with parameterised effects.
Second-Order and Dependently-Sorted Abstract Syntax fiore-2008-second
Applicative programming with effects mcbride-2008-applicative
In this article, we introduce Applicative functors – an abstract characterisation of an applicative style of effectful programming, weaker than Monads and hence more widespread. Indeed, it is the ubiquity of this programming pattern that drew us to the abstraction. We retrace our steps in this article, introducing the applicative pattern by diverse examples, then abstracting it to define the Applicative type class and introducing a bracket notation that interprets the normal application syntax in the idiom of an Applicative functor. Furthermore, we develop the properties of applicative functors and the generic operations they support. We close by identifying the categorical structure of applicative functors and examining their relationship both with Monads and with Arrow.
Categorical Logic and Type Theory jacobs-1999
This book is an attempt to give a systematic presentation of both logic and type theory from a categorical perspective, using the unifying concept of fibred category. Its intended audience consists of logicians, type theorists, category theorists and (theoretical) computer scientists.
Introduction to Higher-Order Categorical Logic lambek_scott_1986
Abstract syntax and variable binding fiore_etal_nd
We develop a theory of abstract syntax with variable binding. To every binding signature we associate a category of models consisting of variable sets endowed with compatible algebra and substitution structures. The syntax generated by the signature is the initial model. This gives a notion of initial algebra semantics encompassing the traditional one; besides compositionality, it automatically verifies the semantic substitution lemma.
External (88)
- An Introduction to Different Approaches to Initial Semantics (2024)
- A framework for higher-order effects & handlers (2024)
- Hefty Algebras: Modular Elaboration of Higher-Order Algebraic Effects (2023)
- Syntax and semantics of modal type theory (2023)
- Fibered Categories a la Jean Benabou (2023)
- Weakest preconditions in fibrations (2022)
- Monadic and Higher-Order Structure (2022)
- Flexible Presentations of Graded Monads (2022)
- Flexibly Graded Monads and Graded Algebras (2022)
- What Makes a Strong Monad? (2022)
- Algebras for Weighted Search (2021)
- Algebraic Models of Simple Type Theories: A Polynomial Approach (2020)
- 2-Dimensional Categories (2020)
- Generalized Monoidal Effects and Handlers (2020)
- Monad Transformers and Modular Algebraic Effects: What Binds Them Together (2019)
- Impredicative Encodings of (Higher) Inductive Types (2018)
- Build Systems à La Carte (2018)
- Syntax and Semantics for Operations with Scopes (2018)
- List Objects with Algebraic Structure (2017)
- Classical Lambda Calculus in Modern Dress (2017)
- Notions of Computation as Monoids (2017)
- Eilenberg–Moore Monoids and Backtracking Monad Transformers (2016)
- Programming with algebraic effects and handlers (2015)
- Freer Monads, More Extensible Effects (2015)
- Behavioral Metrics via Functor Lifting (2014)
- Functorial Semantics of Second-Order Algebraic Theories (2014)
- Substitution, jumps, and algebraic effects (2014)
- Parametric Effect Monads and Semantics of Effect Systems (2014)
- Effect Handlers in Scope (2014)
- Handling Algebraic Effects (2013)
- mtl: Monad classes, using functional dependencies (2012)
- Constructing applicative functors (2012)
- Theory and Practice of Fusion (2011)
- Algebraic Theories (2010)
- Second-Order Equational Logic (2010)
- Second-Order Algebraic Theories (2010)
- Monad Transformers as Monoid Transformers (2010)
- On the Construction of Free Algebras for Equational Systems (2009)
- Categorical Semantics for Arrows (2009)
- Modular Monad Transformers (2009)
- Handlers of Algebraic Effects (2009)
- Realizability: an introduction to its categorical side (1st ed.) (2008)
- Free-algebra models for the 𝜋-calculus (2008)
- Data types à la carte (2008)
- Equational Systems and Free Constructions (2007)
- Explicit Substitutions and Higher-Order Syntax (2006)
- Combining Effects: Sum and Tensor (2006)
- A Semantic Formulation of ⊤⊤-Lifting and Logical Predicates for Computational Metalanguage (2005)
- Coproducts of Ideal Monads (2004)
- Computational Effects and Operations: An Overview (2004)
- Algebraic Operations and Generic Effects (2003)
- Notions of Computation Determine Monads (2002)
- Semantics for Algebraic Operations (2001)
- Generalising Monads to Arrows (2000)
- Representing Layered Monads (1999)
- Enriched Lawvere theories (1999)
- Categories for the Working Mathematician (2nd ed.) (1998)
- Domain Theory (1995)
- Monad Transformers and Modular Interpreters (1995)
- Locally Presentable and Accessible Categories (1994)
- Handbook of Categorical Algebra: Volume 2, Categories and Structures (1994)
- Handbook of Categorical Algebra: Volume 3, Sheaf Theory (1994)
- Categories for Types (1994)
- Computation and reasoning: a type theory for computer science (1994)
- A Syntactic Approach to Modularity in Denotational Semantics (1993)
- A Short Cut to Deforestation (1993)
- Adjunctions whose counits are coequalizers, and presentations of finitary enriched monads (1993)
- Notions of computation and monads (1991)
- A functional theory of exceptions (1990)
- Comprehending Monads (1990)
- An Abstract View of Programming Languages (1989)
- Computational Lambda-Calculus and Monads (1989)
- The calculus of constructions (1988)
- A small complete category (1988)
- Concurrency vs interleaving: An instructive example (1987)
- Generalised algebraic theories and contextual categories (1986)
- The System F of variable types, fifteen years later (1986)
- A Novel Representation of Lists and its Application to the Function "reverse" (1986)
- Types, Abstraction and Parametric Polymorphism (1983)
- Structures defined by finite limits in the enriched context, I (1982)
- Universal Algebra (1981)
- A unified treatment of transfinite constructions for free algebras, free monoids, colimits, associated sheaves, and so on (1980)
- Initial Algebra Semantics and Continuous Algebras (1977)
- Free Algebras and Automata Realizations in the Language of Categories (1974)
- Strong Functors and Monoidal Monads (1972)
- On Closed Categories of Functors (1970)
- A fixpoint theorem for complete categories (1968)
- Über eine elementare Frage der Mannigfaltigkeitslehre (1891)