🤖 AI Summary
This work addresses the need for a unified semantic framework for algebraic effects in domain theory, capable of modeling computational behaviors such as nondeterminism and partiality. To this end, it introduces a formalization of algebraic effects based on directed-complete partial orders (DCPOs), embedding effect operations and inequality axioms directly into DCPO algebras. Methodologically, it pioneers the use of quotient inductive-inductive types (QIITs) from homotopy type theory, implemented in Cubical Agda, to simultaneously define both base types and their associated equivalence relations. This enables a unified, constructive reconstruction of classical domain constructions—including coalesced sums, smash products, and free DCPOs—and yields a rigorous proof of the existence of initial DCPO algebras. The contribution bridges domain theory with advanced type-theoretic foundations, delivering the first formally verified, initial-algebra semantics for algebraic effects—fully mechanized and logically complete within a higher-order type system.
📝 Abstract
Domain theory has been developed as a mathematical theory of computation and to give a denotational semantics to programming languages. It helps us to fix the meaning of language concepts, to understand how programs behave and to reason about programs. At the same time it serves as a great theory to model various algebraic effects such as non-determinism, partial functions, side effects and numerous other forms of computation.
In the present paper, we present a general framework to construct algebraic effects in domain theory, where our domains are DCPOs: directed complete partial orders. We first describe so called DCPO algebras for a signature, where the signature specifies the operations on the DCPO and the inequational theory they obey. This provides a method to represent various algebraic effects, like partiality. We then show that initial DCPO algebras exist by defining them as so called Quotient Inductive-Inductive Types (QIITs), known from homotopy type theory. A quotient inductive-inductive type allows one to simultaneously define an inductive type and an inductive relation on that type, together with equations on the type. We illustrate our approach by showing that several well-known constructions of DCPOs fit our framework: coalesced sums, smash products and free DCPOs (partiality and power domains). Our work makes use of various features of homotopy type theory and is formalized in Cubical Agda.