An Algebraic Perspective on Operational Semantics
Eric Bond, Max New
Abstract
Languages with effects are typically given two independently specified semantic accounts: a denotational semantics based on (free) models, and an operational semantics defined by effect-specific reduction rules. This separation leads to two independently constructed semantic structures whose relationship must then be established a posteriori. We present a unified construction in which both denotational interpretation and operational reduction are constructed from an algebraic theory specifying the effects. We work with call-by-push-value extended by the operations of an algebraic theory. We prove equational canonicity and give a tree-based operational semantics that reduces every closed computation to a tree of operations. When the free model monad is a monadic container, we derive from it a configuration-based small-step semantics. Configurations are elements of the free model. Every step preserves the denotation. Under a condition we call affinity, every reduction terminates and at ground types computes the denotation. We instantiate the framework with state, errors, writer, and weighted and pre-convex probabilistic choice. For errors, writer and weighted choice we recover the familiar rules. For state we get a machine that runs the program from every initial state at once.
Create a lesson
Related papers
Cleave: Scaling Tensor Program Optimization via Decoupled Algebraic Search and Operator Scheduling
Shared title terminology · David Pissarra, Jinkun Lin, Haitian Jiang et al.
Episodic Loops: Finitary Event Structures and Operational Semantics for C11 Programs with Retries
Shared title terminology · Christian Kissig, Jay Richards, Mark Batty
Composable Rewrites for Layouts of Algebraic Data Types
Shared title terminology · Christophe Gyurgyik, Alexander J Root, Benjamin Driscoll et al.
SymFC: Configurable Semantics for All Paths Symbolic Execution in Haskell via Embeddings
Shared title terminology · Robin Webbers, Wind Wong, Klaus v. Gleissenthall
Grassmann: The Coordinate-Independent Linear Algebra Programming Language
Shared title terminology · Theadora Fields Collin, Gilbert Bernstein, Oded Stein et al.
Proof Repair and (Co)algebra Equivalences
Shared title terminology · E. G Plante, Eric Paul, Cosmo Viola et al.