Modules over monads and operational semantics

This paper is a contribution to the search for eﬃcient and high-level mathematical tools to specify and reason about (abstract) programming languages or calculi. Generalising the reduction monads of Ahrens et al., we introduce transition monads, thus covering new applications such as λµ -calculus, π -calculus, Positive GSOS speciﬁcations, diﬀerential λ -calculus, and the big-step, simply-typed, call-by-value λ -calculus. Finally, we design a suitable notion of signature for transition monads.


Introduction
The search for a mathematical notion of programming language goes back at least to Turi and Plotkin [TP97], who coined the name "Mathematical Operational Semantics", and explained how known classes of well-behaved rules for structural operational semantics, such as GSOS [BIM95], can be categorically understood and specified via bialgebras and distributive laws. Their initial framework did not cover variable binding, and several authors have proposed variants which do [FT01,FS06,Sta08], treating examples like the -calculus. However, none of these approaches covers higher-order languages like the -calculus.
In recent work, following previous work on modules over monads for syntax with binding [HM07, AHLM19] (see also [Ahr16]), Ahrens et al. [AHLM20] introduce reduction monads, and show how they cover several standard variants of the -calculus. Furthermore, as expected in similar contexts, they propose a mechanism for specifying reduction monads by suitable signatures.
Our starting point is the fact that already the call-by-value -calculus does not form a reduction monad. Indeed, in this calculus, variables are placeholders for values but not for general -terms; in other words, reduction, although it involves general terms, is stable under substitution by values only. In the present work, we generalise reduction monads to what we call transition monads. The main new ingredients of our generalisation are as follows.
• We now have two kinds of terms, called placetakers and states: variables are placeholders for our placetakers, while transitions relate states. Typically, in the call-by-value, small-step -calculus, placetakers are values, while states are general terms. • We also have a set of types for placetakers, and a possibly different set of types for transitions and states: transitions of a given type relate states of this type. Typically, in the simply-typed, call-by-value -calculus, both sets of types coincide and are given by simple types; while in pure¯-calculus, we have two placetaker types, one for programs and one for stacks, and three transition types, respectively for programs, stacks, and commands. • We in fact have two possibly different kinds of states for each transition type, source states and target states, so that a transition of a given type now relates a source state to a target state of this type. Typically, in the untyped, call-by-value, big-step -calculus, source states (of the unique transition type) are general terms, while target states are values. • Our variables form a (variable!) family of sets indexed by the placetaker types. To such a variables family , a transition monad assigns an object ( ) ('of placetakers with free variables in '), which is again a family of sets indexed by the placetaker types, and two state objects 1 ( ( )) and 2 ( ( )) ('of source (resp. target) states with free variables in '), which are families of sets indexed by transition types; here 1 and 2 are two functors producing state objects out of placetaker objects.
Roughly speaking (see §3), a transition monad consists of three components: • a placetaker monad , • two state functors 1 , 2 , • a transition structure consisting of a -module and two -module morphisms src : → 1 and tgt : → 2 , where -modules [HM07] are objects equipped with substitution by elements of . We view the transition structure ( , src, tgt) as an object of the slice category -Mod / 1 × 2 of (finitary) -modules over 1 × 2 . Reduction monads [AHLM20] correspond to the untyped case with 1 = 2 = Id Set . There, reduction monads are identified with suitable relative monads [ACU15], and we provide a similar identification for transition monads (see Proposition 3.6).
We present our series of examples of transition monads in §4: -calculus, simply-typed -calculus (in its call-by-value, big-step variant), -calculus (as an unlabelled transition system), positive GSOS systems, and differential -calculus.
After defining transition monads, we embark on a second part of the paper, devoted to offering the operational semanticist some hopefully convenient tools for defining programming languages (as transition monads).
Specifically, we propose an approach to the specification of transition monads via signatures, which follows the spirit of Initial Algebra Semantics [GTW78]. This approach is thus categorical in nature, hence we have to upgrade our sets of transition monads into categories, say TransMnd(P, S), one for each pair (P, S) of sets of placetaker types and transition types (see Definition §5.13). For these categories, we propose what we call a register: for a category C, a register consists of (1) a set Sig of signatures, (2) a semantics map − assigning to each signature in Sig a category -alg of algebras, or models, together with a forgetful 1 functor : -alg → C, and (3) a validity proof of the fact that for each , the category -alg has an initial object.
Remark 1.1. This definition is written in type-theoretic style, in the sense that the validity proof is treated as a proper mathematical object. The reader working in a standard, settheoretical logical setting should of course understand this as an additional condition that registers must satisfy.
A register for C yields a "decoding" map spec sending to spec ( ) := (0), where 0 here denotes the initial object in -alg. The efficiency of a register for a category lies in the fact that it allows the expert to easily formalise the informal specification they have in mind for the relevant object. We illustrate in §11 the expressiveness of our register RegTransMnd P,S for transition monads by designing signatures for our examples of §4. For Positive GSOS systems, we even go further by defining a specific register, in which each individual system is more easily specified.
Our register for transition monads is built out from three intermediate registers, corresponding to the three components listed above: • a register RegMnd (Set P ) for monads in the category Set P , • a register Reg[Set P , Set S ] for functors Set P → Set S , and • a register RegTransStruct P,S ( , 1 , 2 ) for transition structures over ( , 1 , 2 ). And as could be expected, a signature for a transition monad in our register RegTransMnd P,S is a record consisting of • a signature of RegMnd (Set P ) specifying the placetaker monad , • two signatures of Reg[Set P , Set S ] specifying the state functors 1 and 2 , and • a signature of RegTransStruct P,S ( , 1 , 2 ) specifying the transition structure.
Here, a crucial feature is that the involved register in the last field of this record depends on the objects specified by previous fields. This contrasts with the approach taken in [AHLM20], where the corresponding field cannot be expressed in terms of the specified placetaker monad, and must instead be parametric in the models of previous fields. Our choice allows more signatures, and we take advantage of this subtle fact in our treatment (see §11.5) of Ehrhard and Regnier's differential -calculus [ER03]. Let us mention that the counterpart for this advantage is that the recursion principle induced by our initial semantics is significantly weaker than could be expected (see Remark 5.14 and §12).
Our signatures for functors and monads incorporate equations similar to those of equational systems: a signature without equations specifies a kind of free object, and adding equations specifies a kind of quotient of this free object, obtained by somehow forcing the added equations to hold. Such a quotienting procedure has already been achieved in a fairly general (and elaborate) way by Fiore and Hur [FH09]. Under mild additional hypotheses on the ambient category and on equations, we obtain a compact "free+quotient" description of our initial models (Theorems 7.18 and 8.23).
This description roughly goes as follows: we consider a signature augmented with one formal operation for each equation, which yields a new set of terms, say augmented terms.
By interpreting the new operations as prescribed by each side of the equations, we obtain two translations, say and , from augmented terms to plain terms. The initial model is then obtained by identifying any two plain terms of the form ( ) and ( ), for some augmented term .
This description is a crucial ingredient of our treatment of the differential -calculus: as already mentioned, the type of the third field of its signature depends in particular on the monad specified by the first field, and the construction of the signature for this third field relies on our explicit description for that monad (see the proof of Lemma 11.6).
Along the elaboration of our registers, we strive to offer the operational semanticist intuitive notation for defining signatures. They may thus specify programming languages as transition monads by the following procedure: • Fix sets P and S of placetaker and transition types.
• Pick a signature of RegMnd (Set P ) for specifying the placetaker monad , by operations and equations (e.g., using Notation 7.12). • Choose two signatures of Reg[Set P , Set S ] for specifying the state functors 1 and 2 , again by operations and equations (e.g., using Notation 8.18). • Choose a signature of RegTransStruct P,S ( , 1 , 2 ) for specifying the transition structure, e.g., by giving some rules using the notation of §6.4.
Plan. In §2, we present our notations and give some categorical preliminaries. In §3 we define transition monads and in §4, we present our selected examples (in the traditional way). Then, in §5, we introduce registers and define our register for transition monads, deferring the precise definition of its components to the next sections. We then introduce our registers for transition structures ( §6), monads ( §7), and functors ( §8), stating the announced explicit descriptions of initial algebras along the way. Proofs are dealt with in §9 and §10.
In §11, we then revisit all examples from §4, specifying them through signatures of our registers RegTransMnd P,S for transition monads. Finally, we conclude in §12 by summing up our contributions, assessing the scope of our registers RegTransMnd P,S , and giving some perspectives.
Remark 1.2. The reader only interested in using our framework may safely skip §9 and §10.
Related work. As mentioned above, our work refines a recent work [AHLM20], allowing to cover many new applications with a very similar approach. This approach differs from the bialgebraic one introduced long ago by Plotkin and Turi [TP97]: the positive difference is that it covers higher-order languages like the -calculus, while a negative difference is that it does not recover congruence of bisimilarity.
Regarding syntax with variable binding, we model it using monads, following a standard approach going back to Bellegarde and Hook [BH94] (but see also [AR99,HM10,AHLM19]). Because the monad-based approach is essentially equivalent to the presheaf-based one [FPT99,Fio08], we anticipate that our whole framework could be straightforwardly adapted to presheaf models. We are more cautious about nominal sets [GP99], mainly because we would need a better understanding of the status of substitution in the latter approach (see, e.g., Power [Pow07]). Furthermore, our main register for monads ( §7) is a simply-typed refinement of a known one [AHLM19], close in spirit to [Ahr16]. Its validity proof relies on another, new register ( §9), which combines two standard registers from the literature, respectively based on equational systems [FH09] and pointed strong endofunctors [FPT99]. We could in fact define a register based on equational systems, and use it directly for specifying monads. Moreover, our explicit description of initial models applies in particular to equational systems (Theorem 10.14). Concerning our registers for slice categories, we suspect that they could be understood in terms of polynomial functors [Koc09], which were recently used in a similar context by Arkor and Fiore [AF20].
We are aware of a few notions of signatures for languages with variable binding equipped with some notion of evaluation (or transition) [Ham03,Ham04,Hir13,Ahr16]. They essentially model rewriting, which implies that transitions are closed under arbitrary contexts. Such approaches cannot cover languages like the -calculus, in which transitions may not occur under inputs or outputs.
As is well-known, evaluation is a directed variant of equality, and transition proofs are a directed form of identity proofs. For this reason, notions of signatures for dependently-typed languages like type theory may provide an alternative approach to the specification of operational semantics systems. Examples of such notions of signatures include Fiore's simple dependently-sorted signatures [Fio08], Altenkirch et al.'s categorical semantics of inductive-inductive definitions [AMFS11], and Garner's combinatorial approach [Gar15].
Finally, let us mention that a preliminary version of the present work appears in the third author's PhD thesis [Laf19, Chapter 6].
Differences with conference version. Here is a list of significant differences w.r.t. the conference version, beyond more detailed proofs.
• Most importantly, we provide an explicit description of the initial algebras of signatures involving equations, in §10. • We also correct a few errors, notably: -We had omitted the congruence rules for reduction in¯-calculus and differential -calculus. -We had omitted the syntactic equation ( · ) · ≡ ( · ) · from our definition of differential -calculus. -Again about differential -calculus, we had also erroneously claimed that the method we used for defining unary multiterm substitution applies to partial differentiation. We now rely on the explicit descriptions of §10 for both operations. • Finally, we include a few minor improvements, e.g.: -We design an abstract version of the original register for slice module categories. In passing, the new version is slightly more expressive. -We design a new register combining the features of equational systems and pointed strong endofunctors into monoidal equational systems ( §9.3). -We provide an alternative way in which to organise the -calculus as a transition monad.

Notations and categorical preliminaries
In this section, we fix some notation, and recall a few categorical notions. We advise the reader to skip it, except perhaps for §2.1, and get back to it when needed. In §2.1, we fix some basic notation. In §2.2, we recall some well-known results about locally finitely presentable categories. Then, in §2.3, we introduce a notion of convenient monoidal category. This is important for us because we will use finitary monads a lot, and these are monoids for the composition monoidal structure on the category of finitary endofunctors. We show in particular that this composition monoidal structure is convenient. We go on in §2.4 by recalling the standard notion of module over a monoid in a monoidal category, and introduce a notion of parametric module, roughly a module definable for all monoids. We then recall a slightly more general definition of (parametric) modules in the particular case of modules over monads (i.e., when the base category is a functor category). In §2.5, after briefly recalling Beck's monadicity theorem, we state one of its useful (folklore) consequences, a "cancellation" property for monadic functors. In §2.6, we recall the well-known correspondence between finitary monadic functors and finitary monads. Finally, in §2.7, we recall the important fact that equalisers of (finitary) monadic functors are computed as in CAT.
2.1. Basic notation. In the following, Set denotes the category of sets, and CAT denotes the (very large) category of locally small categories. We often implicitly view natural numbers as intervals {1, . . . , } in N, so that, e.g., 2 ∈ 3, 2 ⊆ 3, and so on. Furthermore, in any category with binary products, we denote by , : → × the pairing induced by any morphisms : → and : → . Similarly, when it makes sense, the copairing of : → and : → is denoted by [ , ] : + → . Initial objects are denoted by 0. Given an endofunctor , the category of algebras → is denoted by -alg. When is a monad, the notation -alg rather refers to its category of algebras in the sense of monads, that is, morphisms → satisfying the three standard axioms. Finally, given an object of a category , we denote the slice (resp. coslice) category over (resp. under) by / (resp. / ).

2.2.
Locally finitely presentable categories and finitary functors. We heavily rely on the theory of locally finitely presentable categories [AR94]. Very briefly, recall that filtered categories are a categorical generalisation of directed posets.
Definition 2.1. A category is filtered when • it is not empty, • for any two objects and , there is an object and arrows → and → , and furthermore, • any two parallel arrows ⇒ are coequalised by some morphism → . A filtered colimit is a colimit of some functor from some small filtered category. Remark 2.13. The coherence conditions amount to equipping with algebra structure for the monad − ⊗ induced by .
A parametric module will assign a module to any monoid. In order to formally define this, let us introduce the following category, which collects all categories of the form -Mod.
Definition 2.14. Let Mod(C) denote the category • whose objects are pairs ( , ) where is a monoid and is an -module, and • whose morphisms ( , ) → ( , ) are pairs ( , ) of a monoid morphism : → and a morphism : → in C such that the following diagram commutes.
Definition 2.15. A parametric module over C is a section of the forgetful functor U Mod : Mod(C) → Mon(C), i.e., a functor : In other words, a parametric module functorially assigns to each monoid a module over it.
Example 2.16. If C has products, then we can define the parametric module mapping any monoid to the -module × . It will become clear in §7 how this parametric module can be viewed as the arity of a binary operation, with C = [Set, Set] .
Example 2.17. Any endofunctor on Mon(C) equipped with a natural transformation : Id → induces a parametric module monmod mapping any monoid to ( ), with action given by where the second morphism is the multiplication of ( ) ∈ Mon(C). This construction applies in particular for any monad on Mon(C).
Definition 2.18. A parametric module morphism → over C is a natural transformation : → between underlying functors Mon(C) → Mod(C), such that U Mod • = id.
Remark 2.19. Concretely, the components of a natural transformation : → at any monoid ∈ Mon(C) are pairs of a monoid morphism : → and a suitable natural transformation : ( ) → ( ). The condition U Mod • = id unfolds to = id for all .
2.4.2. (Parametric) modules over monads. The previous definitions of (parametric) modules specialise to the case where C = [E, E] (for the composition monoidal structure). Then, monoids are finitary monads. However, because in this case C is an endofunctor category, there is a slightly more general, "relative", or "heterogeneous" notion of module [HM07] which will be important for us. Let us recall it now. Definition 2.20. Given a monad on C and a category D, a D-valued -module is a finitary functor : C → D equipped with a right -action • → satisfying coherence conditions analogous to those of Definition 2.12. A morphism of -modules is similarly a natural transformation commuting with action. We denote by -Mod (D) the category of -modules and morphisms between them.
Remark 2.21. D-valued -modules are algebras for the monad − • on [C, D] . When D = C, these are the same as -modules in [C, C] in the sense of Definition 2.12.
Notation 2.22. Given any monad on C, and functor : C → D, we sometimes implicitly equip the functor with its canonical -module structure. This module is free on , in the sense that for any -module and natural transformation : → , there is a unique -module morphism˜: → making the following diagram commute.
Of course,˜is merely the composite − − → → .
Let us briefly show how to exploit the variability of D.
Definition 2.23. For any in a set P, and any monad on Set P , the functor : Set P → Set mapping any ∈ Set P to ( ) ( ) is a -module, with action given by , : ( ( )) ( ) → ( ) ( ), at any ∈ Set P .
Here is another example construction of -module, which is useful for specifying syntax with variable binding.
Let us now recall parametric modules over monads (called signatures in [AHLM18]).
Definition 2.25. Given categories C and D, let Mod(C, D), or Mod(D) when C is clear from context, denote the category • whose objects are pairs ( , ) of a finitary monad on C and a finitary -module : C → D, • and whose morphisms ( , ) → ( , ) are pairs ( , ) of a monad morphism : → and a natural transformation : → commuting with action, in the sense that the following square commutes. A parametric module morphism → is a natural transformation : → between underlying functors such that p • = id.
Terminology 2.27. In the following, C = Set P , and parametric modules are implicitly Set-valued by default.
Example 2.28. Let us start by a few basic constructions of parametric modules: • we denote by Θ the Set P -valued parametric module mapping a monad to itself, as a module over itself; • for any 1 , . . . , ∈ P and D-valued parametric module , let ( 1 ,..., ) associate to each monad the -module ( ) ( 1 ,..., ) as in §2.4, i.e., ( 1 ,..., ) ( ) ( ) = ( ) ( + y 1 + . . . + y ); when P = 1, we merely count the 's and write ( ) ; • for any finitary functor : D → E and D-valued parametric module , the E-parametric module • maps any monad to the -module • ( ); as particular cases: when D has a terminal object, the terminal D-valued parametric module 1 = 1 • Θ maps any monad to the constant -module 1; for any ∈ P and Set P -valued parametric module , we denote by the Set-valued parametric module mapping any monad to the -module ↦ → ( ) ; in particular, for any ∈ P, the Set-valued parametric module Θ maps a monad on Set P to the module ↦ → ( ) ; given a finite family ( ) ∈ of Set-valued parametric modules, let associate to any monad the -module ( ).
In the paper, we will at times use two distinct viewpoints on our signatures for monads. One, more user-friendly, is based on Set-valued, or heterogeneous, parametric modules. The other, more efficient for stating the explicit description of initial algebras, is based on Set P -valued, or homogeneous, modules. The two viewpoints are related by a P-indexed family of adjunctions, which we now recall. For all ∈ P, there is an adjunction • y : Set P denotes the family with a single element, sitting over ∈ P, and • the left adjoint maps any : Set P → Set to the endofunctor ( ∈ Set P ) ↦ → ( ) · y , i.e., ( ( ) · y ) ( ) = ( ) and ( ( ) · y ) ( ) = ∅ when ≠ . Indeed, we have a natural isomorphism Proof. Straightforward.
2.5. Creation of (co)limits and monadic functors. In this section, we recall Beck's monadicity theorem [Mac98, Theorem VI.7.1], and state a "cancellation" property for monadic functors. First, we need to recall creation of (co)limits, monadic functors, and absolute (co)limits. We will see in §10 that the main technical notion for our explicit descriptions of initial algebras is creation of (co)limits, so let us briefly recall the basics.
. Given a small category E, a functor : C → D creates (co)limits of shape E if for any functor : E → C, if has a (co)limit, then the (co)limiting (co)cone uniquely lifts to C, and the lifting is again (co)limiting.
A typical example is: For any monad on a category C, the forgetful functor : -alg → C creates limits.
We also have the following well-known result: Proposition 2.32. For any monad on a category C, the forgetful functor : -alg → C creates colimits of a given shape whenever preserves them. More concretely, if preserves all colimits of functors with some domain D, then creates them.
Lemma 2.33. For any category E and functor : C → D with D cocomplete, if creates colimits of shape E, then preserves them.
Proof. Consider any colimiting cocone, say : → of a functor : E → C. We want to show that is colimiting. By cocompleteness of D, has a colimiting cocone, say : → . By creation of colimits, has a unique lifting : → to C, which is colimiting. Because colimiting cocones are uniquely isomorphic, there is a unique isomorphism . Finally, functors preserve isomorphisms, so we have = . But is colimiting, hence so is , as desired.
Corollary 2.34. For any monad on a cocomplete category C, and for any category D, the following are equivalent (i) the forgetful functor : -alg → C preserves all colimits of shape D, (ii) the monad preserves all colimits of shape D, and (iii) the forgetful functor : -alg → C creates all colimits of shape D.
Definition 2.35. A functor : E → B is monadic if E is isomorphic to a category of algebras -alg for some monad on B, and furthermore, the following diagram commutes.

E
-alg A functor : E → B is monadic iff • it has a left adjoint, and • it creates coequalisers for those parallel pairs , : 1 ⇒ 2 for which ( ( ), ( )) has an absolute coequaliser in B.
We will use the following consequence. Proof. Given a colimiting cocone : → for a filtered diagram : D → A, this cocone is preserved by and created by . So ( ) is colimiting, and has a unique antecedent by , which is again colimiting. But ( ) is an antecedent, hence has to be the antecedent, and so is colimiting as desired. Let us readily make the following observation.
Lemma 2.44. The functor underlying any morphism in Monadic /C is itself monadic.
In fact, a lot of our understanding of Monadic /C will follow from the following equivalence. Proof. For any finitary monad , the forgetful functor is finitary by Corollary 2.34, which proves that the functor lifts as claimed. Furthermore, the lifted functor is clearly fully faithful. Finally, it is essentially surjective because if a monadic functor is finitary, then so is the induced monad, again by Corollary 2.34. 2.7. Limits of finitary monadic functors. In this section, we recall a well-known result about limits of (finitary) monadic functors, namely that they are computed as in CAT: Proposition 2.47. The forgetful functor Monadic /C → CAT/C creates limits.
The rest of this section will be devoted to the proof, but first let us record the following. Corollary 2.48. The forgetful functor Monadic /C → CAT creates equalisers. More precisely, given monadic functors 1 : D 1 → C and 2 : D 2 → C and functors 1 , 2 : D 1 → D 2 such that 2 • = 1 , if A → D 1 is the equaliser of 1 and 2 in CAT, then the composite A → D 1 → C is finitary monadic and underlies the equaliser of 1 and 2 in Monadic /C.
Proof. This follows straightforwardly from Proposition 2.47 and the fact that the forgetful functor from any slice category to the base category creates equalisers (see the proof of [Bor94b, Proposition 2.16.3]).
Returning to the proof of Proposition 2.47, let us start with the following two lemmas.
Lemma 2.49. Finitary monads over any locally finitely presentable category form a locally finitely presentable category.
Proof sketch (see [Lac97]). Let C be locally presentable. Then C is small, so [C , C] is again locally presentable. Now, finitary monads on C are equivalently monoids for the composition tensor product in [C , C], hence also algebras for a finitary monad on a locally presentable category, which allows us to conclude by the following lemma.
Lemma 2.50. The category of algebras for a finitary monad on any locally finitely presentable category is again locally finitely presentable.
We now need to recall three standard definitions, and prove two more lemmas.
Definition 2.51. A functor : C → D is conservative iff, for any morphism : → in C such that ( ) is an isomorphism, so is .
Lemma 2.53. For any conservative and amnestic functor : C → D and morphism in C, if ( ) is an identity, then so is .
Proof. By conservativeness, is an isomorphism. But then by amnesia is an identity.
Definition 2.54. A functor : C → D is an iso-fibration iff, for any isomorphism of the form : → ( ), there exists an isomorphism : → such that ( ) = .
Lemma 2.55. Any continuous, conservative, amnestic iso-fibration from a complete category creates limits.
Proof. Consider any continuous, amnestic iso-fibration F : C → D with C complete, and any functor : X → C such that has a limiting cone, say : → . Then, because C is complete, also has a limiting cone, say : → . Because is continuous, ( ) : ( ) → is again limiting, hence we get an isomorphism : → ( ) of cones over . Because is an iso-fibration, we then lift to an isomorphism : → in C such that ( ) = . The cone : → is thus limiting, and an antecedent of . It thus remains to show that it is the only antecedent of . Let thus : → be any antecedent of . Because is limiting, there exists a unique cone morphism : → . But now ( ) is a cone endomorphism → , hence ( ) = id. By Lemma 2.53, we then get = and = , thus proving that = as desired.

MODULES OVER MONADS AND OPERATIONAL SEMANTICS (EXPANDED VERSION) 3:15
At last, we have: Proof of Proposition 2.47. By Corollary 2.46, Monadic /C is equivalent to Mnd (C) op . But the latter is complete as the opposite of Mnd (C), which is locally finitely presentable by Lemma 2.49. Thus, Monadic /C is complete. Moreover, the forgetful functor Finally, the forgetful functor Monadic /C → CAT/C is a conservative, amnestic isofibration: • it is conservative and amnestic as a full subcategory embedding, and • an iso-fibration because the subcategory in question is replete (otherwise said, monadic functors are closed under isomorphisms). The result thus follows by Lemma 2.55.

Transition monads
In this section, we introduce the main new mathematical notion of the paper: transition monads. In §3.1 we give an informal description and in §3.2, we give our formal definition. In §3.3, we provide an equivalent definition based on the notion of relative monad. Finally, in §3.4, we sketch a proof-irrelevant variant of transition monads.

Placetakers and states
In standard -calculus, we have terms, variables are placeholders for terms, and transitions relate a source term to a target term. In a general transition monad we still have variables and transitions, but placetakers for variables and endpoints of transitions can be of a different nature, which we phrase as follows: variables are placeholders for placetakers, while transitions relate a source state with a target state.

The categories for placetakers and for states
In standard -calculi, we have a set T of types for terms (and variables); for instance in the untyped version, T is a singleton. Accordingly, terms form a monad on the category Set T . In a general transition monad we have a set P of placetaker types, and placetakers form a monad on the category Set P ; similarly, we have a set S of transition types, and the family of possible states (depending on a given family of variables) forms an object in Set S . For example, for the simply-typed -calculus, P = S is the set of simple types.

The object of variables
In our view of the untyped -calculus, there is a (variable!) set of variables and everything is parametric in this 'variables set'. Similarly, in a general transition monad , there is a 'variables object' in Set P and everything is functorial in this variables object. In particular, we have a placetaker object ( ) in Set P and a source (resp. target) state object in Set S , both depending upon the variables object.

A. Hirschowitz, T. Hirschowitz, and A. Lafont
Vol. 18:3 The state functors 1 and 2 While in the -calculus, states are the same as placetakers, in a general transition monad, they may differ, and more precisely both state objects are derived from the placetaker object by applying the state functors 1 , 2 : Set P → Set S .

The transition structure
In standard -calculi, there is a (typed!) set of transitions, which yields a graph on the set of terms. That is to say, if is the variables object, and ( ) the placetaker object, there is a transition object Trans ( ) equipped with two maps src , tgt : Trans ( ) → ( ). Note that we consider 'proof-relevant' transitions here, in the sense that two different transitions may have the same source and target (see 3.4 for the proof-irrelevant variant).
In a general transition monad , we still have a transition object Trans ( ), which now lives in Set S , together with state objects 1 ( ( )) and 2 ( ( )), so that the pairing src , forms a morphism Trans ( ) → 1 ( ( )) × 2 ( ( )). One main feature of transition monads is that transitions are closed under substitution. Technically, this is realised by taking the transition object Trans ( ) to be a -module, and that the morphism Trans ( ) → 1 ( ( )) × 2 ( ( )) to be a -module morphism.

The definition of transition monad. Here is our formal definition:
Definition 3.1. Given two sets P and S, a transition monad over (P, S) consists of • a finitary monad on Set P , called the placetaker monad, • two finitary functors 1 , 2 : Set P → Set S , called state functors, and • a transition structure src,tgt − −−−−−− → 1 × 2 consisting of a finitary -module : Set P → Set S , called the transition module, a source -module morphism src : → 1 , recalling from Notation 2.22 that 1 is the free -module on 1 , a target -module morphism tgt : → 2 .
Definition 3.2. For any sets P and S, finitary monad over Set P , and finitary functors 1 , 2 : Set P → Set S , we let TransStruct P,S ( , 1 , 2 ) denote the class of transition structures over , 1 , and 2 .
3.3. Transition monads as relative monads. In our definition of transition monad, we have required the two state modules to take the form 1 and 2 , but this is not essential in our development. Moreover, it probably leaves some relevant examples out of reach. We think in particular about the standard presentation of the -calculus as a labelled transition system. Our original reason for this design choice was purely aesthetic: it ensures that our transition monads are relative monads, as were the reduction monads introduced in [AHLM20] (in particular the untyped -calculus). These were monads relative to the 'discrete graph' functor from sets to graphs, and in our extended context, we have to replace graphs by -graphs. Let us provide more detail.
Let us first recall [ACU15] that, given any functor : C → D, a monad relative to , or -relative monad, consists of • an object mapping : ob(C) → ob(D), together with Vol. 18:3

MODULES OVER MONADS AND OPERATIONAL SEMANTICS (EXPANDED VERSION)
3:17 • morphisms : ( ) → ( ), and • for each morphism : ( ) → ( ), an extension ★ : ( ) → ( ), satisfying coherence conditions. Any -relative monad has an underlying functor C → D, and is said finitary when this functor is. Note that a monad is nothing but a -relative monad, for the identity endofunctor. Now we define -graphs: Definition 3.3. For any pair = ( 1 , 2 ) of functors Set P → Set S , an -graph over an object ∈ Set P consists of • an object (of edges) in Set S , and • a morphism : Accordingly, an -graph consists of an object ∈ Set P and an -graph over .
We can now say that in a general transition monad, transitions form an -graph over the placetaker object (the whole thing depending upon the variables object...). Before proceeding, we must introduce the category of -graphs: a morphism → consists of a morphism for vertices : → together with a morphism for edges : → making the following diagram commute.
The proof is a straightforward verification. We will consider monads relative to the following functors: Definition 3.5. For any pair = ( 1 , 2 ) of functors Set P → Set S , the discrete -graph functor : Set P → -Gph maps any ∈ Set P to the -graph over with no edges. Now we are ready to deliver our characterisation of transition monads as relative monads: Proposition 3.6. Given finitary functors 1 , 2 : Set P → Set S , transition monads with state functors 1 and 2 are exactly monads relative to the discrete -graph functor for = ( 1 , 2 ), such that the induced functor Set P → -Gph is finitary.
The proof consists merely in unfolding the definitions. Since we do not use this result, we do not give further details.
3.4. The proof-irrelevant variant. Although we have chosen a "proof-relevant" notion of transition monad, we can sketch a presentation of a "proof-irrelevant" variant.
Remark 3.8. We have a natural retraction which maps a transition structure : → 1 × 2 to the monomorphism ↩→ 1 × 2 obtained from the (strong epi)-mono factorisation; this factorisation exists [AR94, Proposition 1.61] since the category of finitary Set-valued -modules is a presheaf category [Ahr15, Definition 2.71]. In Proposition 6.19, we will upgrade this retraction into a coreflection of categories.

Examples of transition monads
In this section, we present very informally the announced examples of transition monads. This presentation should eventually be compared to the one via signatures given in §11.

4.1.
The call-by-value, simply-typed, big-step -calculus. The notion of transition monad accounts for many different variants of the -calculus. Let us detail the case of the simply-typed, call-by-value, big-step -calculus. Most often, big-step semantics describes evaluation of closed terms. Here we consider a variant describing the evaluation of open terms [PR99,Las98]. In this setting, the main subtlety lies in the fact that variables are only placeholders for values. We fix some set of base types, ranged over by and define successively types, values and terms, typing contexts, well-typed terms, and transitions, as follows.
Definition 4.1. The set P of types, ranged over by , , is defined inductively by Definition 4.2. For any set, say , of variables, we then define values, ranged over by , , and general terms, ranged over by , in a mutually inductive way as follows.
, | . , | Here, ranges over , and Terms are considered equivalent modulo -conversion. Furthermore, one may define capture-avoiding substitution, as usual.
Definition 4.3. A typing context is a type-indexed family of sets, i.e., an object of Set P . For any Γ ∈ Set P , ∈ P, and ∉ Γ , we let Γ, : denote Γ augmented with over .
Remark 4.4. The extended context Γ, : is isomorphic to Γ + y , where y denotes the Yoneda embedding P ↩→ Set P , viewing P as a discrete category. Indeed, because P is discrete, y ( ) is empty when ≠ , and y ( ) is a singleton. Thus Γ + y is Γ, plus one element of type .
Definition 4.5. Well-typed terms are inductively defined by the following rules.

MODULES OVER MONADS AND OPERATIONAL SEMANTICS (EXPANDED VERSION) 3:19
This calculus forms a transition monad as follows.
Placetakers and transition types As foreshadowed by the notation, because variables and values are indexed by (simple) types, we take P = S to be the set of types.
Placetaker monad The placetaker monad over Set P is given by well-typed values: given any Γ ∈ Set P , the placetaker object (Γ) ∈ Set P assigns to each type the set (Γ) of value typing derivations, i.e., the set of typing derivations with conclusion of the form Γ : .
State functors In big-step semantics, transitions relate terms to values. Hence, we are seeking state functors 1 , 2 : Set P → Set P such that 1 ( (Γ)) is the set of typing derivations of type with free variables in Γ, and 2 ( (Γ)) is the subset of value typing derivations therein. For 2 , we should clearly take the identity functor since consists of all value typing derivations. For 1 , we first observe that -terms can be described as application binary trees whose leaves are values (internal nodes being typed applications). More formally, let 1 (Γ) denotes the set of typing derivations with conclusion of the form Γ 1 : inductively generated by the following rules.
∈ Γ Γ 1 : If Γ is a typing context, 1 ( (Γ)) is indeed the set of general typing derivations with variables in Γ.
Transition module Finally, the transition module maps any Γ ∈ Set P to the family, over all ∈ P, of transition proofs of some ⇓ with ∈ 1 ( (Γ)) and ∈ (Γ) . Such transition proofs are stable under value substitution, so we obtain a transition monad.
Remark 4.7. Transition proofs are not stable under general substitution. E.g., the following proof Stacks | · , where and range over two disjoint sets of variables, called stack and program variables, respectively. Both constructions and bind their variable in the body. Reduction is generated by the following two basic transition rules concerning commands: . | · → [ ↦ → ] | . Reduction may occur "everywhere", so it involves programs and stacks as well.
Let us show how this gives rise to a transition monad. Placetaker types In the transition rules above, we see that placetakers may be programs or stacks. So, we take two placetaker types: P := 2 = {p, s}. A variables object is an element of Set P , that is, a pair of sets: the first one gives the available free program variables, and the second one the available free stack variables.
Placetaker monad The syntax may be viewed as a monad : Set P → Set P : given a variables object = ( p , s ) ∈ Set P , the placetaker object ( ( ) p , ( ) s ) ∈ Set P consists of the sets of program and stack terms with free variables in , up to bound variable renaming. As usual, monad multiplication is given by capture-avoiding substitution.
Transition types and state functors As mentioned above, transitions involve programs and stacks as well as commands. Thus, we take three transition types: S = 3 = {c, p, s}. Furthermore, commands are pairs of a program and a stack, so that, Transition module Finally, transitions with free variables in form a triple of graphs with vertices respectively in ( ) p × ( ) s (the set of commands taking free variables in ), ( ) p , and ( ) s . This family is natural in and commutes with substitution, hence forms a -module morphism, which completes our transition monad.
4.3. The -calculus. For an example involving equations on placetakers, let us recall the following standard presentation of (a simple variant of) the -calculus [SW01]. The syntax for processes is given by where ranges over process variables, and range over channel names, and is bound in . and ( ). . Processes are identified when related by the smallest context-closed where in the last equation should not occur free in . Transitions are then given by the following rules.
Remark 4.8. Please note that there are no context rules for inputs or outputs, so that nothing happens under them.
The -calculus gives rise to a transition monad as follows.
Placetaker types We consider two placetaker types, one for channels and one for processes. Hence, P = 2 = {c, p}.
Placetaker monad Then, the syntax may be viewed as a monad : Set P → Set P : given a variables object = ( c , p ) ∈ Set P , the placetaker object ( ) = ( c , ( ) p ) ∈ Set P consists of the sets of channels and processes with free variables in (modulo ≡). Note that ( ) c = c as there is no operation on channels.
Transition type and state functors Transitions relate processes, so we take S = 1 and Transition module Transitions are generated by the above three rules, and obviously stable under substitution. We thus obtain a transition monad.
Let us now describe a second way of organising the -calculus as a transition monad, this time over a single placetaker type. For this, we consider the same calculus, albeit without process variables, so that the syntax becomes Placetaker In this variant of the -calculus, all that needs substitution is channels, so we set P = 1.
Placetaker monad Since the syntax contains no channel constructor, the placetaker monad is merely the identity monad.
Transition types and state functors However, since transitions relate processes, we need to fit the syntax into the state functors. We thus take S = 1 and 1 ( ) = 2 ( ) to be the set of processes with free channels in .
Transition module Transitions are generated as above, and stable under channel renaming, hence again form a transition monad.  where • op ∈ is an operation with arity , • for all ∈ , is a natural number, • the variables and , are all distinct, and • is an expression potentially depending on all the variables. A Positive GSOS system is a set of Positive GSOS rules.
The semantics of a Positive GSOS rule is that of a "rule scheme", in the following sense. Otherwise said, each rule scheme (4.1) induces a rule Remark 4.12. The general notion of GSOS system includes negative rules, which means rules that may have premises of the shape / . Their semantics is significantly more involved, so we leave their integration as an open problem. Each Positive GSOS system yields a transition monad as follows.
Placetaker and transition types We take P = 1, because we are in an untyped setting, and S = 1 because states are terms.
Placetaker monad The selected family of operations (or rather arities) specifies the term monad .
State functors In order to take labels into account, we take 1 ( ) = and 2 ( ) = A × . Transitions thus form a set over × (A × ) as desired.
Transition structure As before, we take as transitions the set of all proofs generated by the rules, which is indeed stable under substitution by construction.
4.5. The differential -calculus. Let us finally sketch how differential -calculus [ER03] provides a further example with 1 ≠ 2 . Following Vaux [Vau07,§6], its syntax may be defined by where terms and multiterms are considered equivalent up to the following equations.
The definition of transitions is based on two auxiliary constructions: (1) Unary multiterm substitution [ ↦ → ] of a multiterm for a variable in a term , which returns a multiterm (not to be confused with unary monadic substitution, which handles the particular case where is a mere singleton).
(2) Partial derivative · of a term w.r.t. a term variable along a multiterm . This again returns a multiterm.
We may now define the transition relation as the smallest context-closed relation satisfying the rules below. Placetaker monad Terms induce a monad on Set, which we take as the placetaker monad (hence P = 1).
State functors Transitions relate terms to multiterms, hence S = 1, 1 is the identity, and 2 = ! is the functor mapping any set to the set of (finite) multisets over . Transition structure Transitions are stable under substitution by terms, hence we again have a transition monad.

Signatures for transition monads
In the previous section, we have shown that several significant (abstract) programming languages may be organised as transition monads. We are now interested in specifying such languages by signatures. We first introduce registers, as announced in the introduction, and then our register for transition monads.

Signatures registers.
In this section, we introduce signatures registers, which are a formalisation of the notion of signature, at least in the context of initial algebra semantics.
The idea is that each signature over a fixed category C should give rise to a particular category -alg, equipped with a "forgetful" functor to C, the specified object spec ( ) being the carrier of the initial object of -alg: Definition 5.1. An abstract signature over a category C consists of a category E with an initial object, equipped with a functor E → C. We denote by SemSig C the class of abstract signatures over C.
Notation 5.2. We denote the components of any abstract signature over a category C by -alg and U , so that is precisely U : -alg → C. Accordingly, we call objects of -alg -algebras, or models of .
Definition 5.3. A register R for a given category C consists of • a class Sig R of signatures, and • a semantics map − R : Sig R → SemSig C .
Terminology 5.4. We say that any ∈ Sig R is a signature for spec ( ) := U (0) (0 here denotes the initial object in -alg), or alternatively that specifies spec ( ). Finally, when we define our registers below, we first introduce signatures and associate a functor E → C to each signature. It then remains to prove that E has an initial object: as mentioned in §1, we call such proofs validity proofs.
Most of our registers will be monadic in the following sense.
Definition 5.5. A register R is monadic when the abstract signature E → C associated to any signature in Sig R is finitary and monadic.
Notation 5.7. When a register is monadic, we denote by ★ the monad induced by any signature , in the sense that we have an isomorphism -alg ★ -alg of categories over C (i.e., which commutes with forgetful functors). In such cases we have Let us now introduce a simple notion of morphism between registers.
Definition 5.8. A compilation from a register 1 on a category C to a register 2 on the same category is a map : Sig 1 → Sig 2 preserving the semantics up to isomorphism, in the sense that for any Σ ∈ Sig 1 , there is an isomorphism Σ 1 (Σ) 2 as objects of CAT/C. We say that 1 is a subregister of 2 if there exists a compilation of 1 to 2 .
Let us finish this subsection by recasting a well-known fact as the definition of a register. The well-known fact is the following.
And here comes the register: Definition 5.10. For a given cocomplete category C, we define the monadic register EF C , called the endofunctor register, as follows.
Signatures: A signature is a finitary endofunctor on C. Semantics: The abstract signature associated to any finitary endofunctor is the forgetful functor : -alg → C.
Remark 5.11. Let be any finitary endofunctor on a cocomplete category C. Please note the difference between ★ (0) and * (0): ★ (0) denotes the object specified by qua signature of EF C , while * (0) denotes the (carrier of the) initial -algebra. In this case, of course, the denotations coincide, but this will no longer be the case, for instance, in §7.3. There, ★ (0) will denote the initial -monoid, while * (0) will still denote the initial -algebra.
Let us conclude by naming all registers defined by compilation into EF C .
Definition 5.12. We call endofunctorial all subregisters of EF C .

A register for transition monads.
Our goal is to define a register for transition monads. Thus, we should at least organise them into a category in the first place: Definition 5.13. For any sets P and S, finitary monad over Set P , and finitary functors 1 , 2 : Set P → Set S , let TransStruct P,S ( , 1 , 2 ) = -Mod (Set S )/ 1 × 2 denote the slice of the category of finitary, Set S -valued -modules over 1 × 2 . And for any sets P and S, we let TransMnd P,S := , 1 , 2 TransStruct P,S ( , 1 , 2 ). Remark 5.14. Reduction monads [AHLM20] correspond to the case when 1 = 2 = Id, with P = S = 1, but contrary to the present work, morphisms there can live between reduction monads with different underlying monads. We don't need such morphisms in the present work because we enforce that models of a signature share the same underlying monad. This allows for a simpler notion of signature, at the cost of reducing the scope of the recursion principle.
In the coming sections, we will introduce • a register RegMnd (Set P ) for finitary monads on the category Set P , • a register Reg[Set P , Set S ] for finitary functors Set P → Set S , and • for any finitary monad and functors 1 and 2 , a register RegTransStruct P,S ( , 1 , 2 ) for transition structures over , 1 , and 2 . Assuming this is done, we may already give our register for transition monads: Definition 5.15. We define the register RegTransMnd P,S for the category TransMnd P,S as follows.
Signatures: A signature, which we call a transition signature, consists of • a signature Σ of RegMnd (Set P ), specifying a finitary monad on Set P , • signatures Σ 1 and Σ 2 of Reg[Set P , Set S ] , specifying functors 1 , 2 : Set P → Set S , and • a signature Σ Trans of RegTransStruct P,S ( , 1 , 2 ). Semantics: The abstract signature associated to a signature (Σ, Σ 1 , Σ 2 , Σ Trans ) is Validity proof: We need to prove that Σ Trans -alg has an initial object; but this follows from RegTransStruct P,S ( , 1 , 2 ) being a register, which will be proved below.
It remains to introduce the registers RegMnd (Set P ) for monads, Reg[Set P , Set S ] for functors, and RegTransStruct P,S ( , 1 , 2 ) for transition structures. The most novel is clearly the latter. It is furthermore independent from the others, so we introduce it first.
For the reader's convenience, we list our registers in Figure 1, together with corresponding categories.

Registers for transition structures
In this section, we define the register RegTransStruct P,S ( , 1 , 2 ) for transition structures on fixed , 1 , 2 . Since these are Set S -valued -modules over 1 × 2 , this register should specify objects of the slice category -Mod (Set S )/ 1 × 2 . We will in fact design a register for more general slice categories C/ , where C is a locally finitely presentable category and an object of C. The desired register RegTransStruct P,S ( , 1 , 2 ) will then be obtained as an instance by taking C = -Mod and = 1 × 2 .
In §6.1, we first present a basic register Reg 0 (C/ ) that would work for the untyped case without variable binding. Then, in §6.2, we extend Reg 0 (C/ ) to a more powerful register Reg 1 (C/ ) that deals with variable binding. Observing that this register is slightly heavy to use in the typed setting, we design a more convenient variant, called Reg(C/ ). Finally, in §6.4, we focus on instances of this register to categories of the form C = -Mod /( 1 × 2 ). In this case, we introduce special notation, which allows us to write signatures For R * , R is assumed to be an endofunctorial register (Definition 5.12). 6.1. Small register for slice categories. In this section, we introduce a first, limited register for slice categories.
Example 6.1. Let P denote the set of simple types over a given set of basic types, as in §4.1, and consider the arity for application, i.e., the endofunctor Σ app : Set P → Set P defined by Across the equivalence Set P Set/P, one way of presenting this endofunctor, which is perhaps closer to the syntactic inference rule for application, is as the span where arr( , ) = ( → ). Indeed, Σ app ( ) corresponds to • taking the product of → P with itself in the arrow category, • pulling back along arr, 2 , and • postcomposing with 1 . To see this, let us observe that after pulling back, we obtain a family over P 2 such that ( , ) = ( → ) × ( ). Postcomposing, we take the disjoint union over as desired. Generalising from this example, we obtain the following "small" register.
Definition 6.2. For any locally finitely presentable category C and object ∈ C, we define the endofunctorial register Reg 0 (C/ ) for the slice category C/ as follows.
Signatures: A signature consists of: • a metavariable object ; • a list of premise morphisms ( − → ) ∈ denoted by is an algebra for the endofunctor mapping any − → to → − → , where → denotes the following pullback.
ì Morphisms of models are morphisms of algebras.
Validity proof: All we have to show is that the induced endofunctor is finitary. But this functor is a composite of three functors Example 6.3. Let P = 1 so that Set P Set, and denote the monad for pure -calculus syntax. Taking C = -Mod (Set) and the product module 2 = × , let us consider the left congruence rule for application −→ −→ as a signature of Reg 0 (C/ ). For this, we take • as metavariable module = 3 , • a single premise given by 1 , 2 : 3 → 2 , and • as conclusion the morphism : 3 → 2 mapping any ( , , ) to ( , ). Let us now see what it means for a module morphism → 2 to be a model. In this case, the pullback along 1 , 2 yields × , and so a model structure amounts to a morphism × → making the following square commute. Unfolding the definition, such a map associates to any transition ∈ ( ) over ( , ) ∈ 2 ( ) and term ∈ ( ) a transition over ( , , ) = ( , ), as desired.
6.2. Binding register for slice categories. In this section, we observe that the register Reg 0 (C/ ) is not expressive enough in the presence of variable binding, hence we refine it.
Example 6.4. Let P = 1 so that Set P Set, and denote the monad for pure -calculus syntax. Taking C = -Mod and = 2 as in Example 6.3, let us consider the -rule → . → .

·
The natural metavariable module for this is (1) × (1) , because and have an additional, fresh variable, and the natural premise would be the identity map thereon. However, the register Reg 0 (C/ ) only allows premises to target powers of .
In order to rectify the situation, we refine Reg 0 (C/ ) to obtain the following more general register.
Definition 6.5. For any locally finitely presentable category C and object ∈ C, we define the endofunctorial register Reg 1 (C/ ) for the slice category C/ as follows. • We first take as metavariable module := (1) × (1) , as planned.
• We then take as unique premise the identity on . For this we should justify that does have the desired form ( 2 ). This is the case with ( ) = (1) since ( 2 ) (1) = ( (1) ) 2 . • Finally, we take as conclusion := (1) × (1) × − −− → × . Remark 6.7. We may generalise this register to permit a conclusion between terms with additional free variables, by having the conclusion morphism target rather than , for some finitary right adjoint functor . For example, exploiting the adjunction − (1) − × in the category of -modules [AHLM18, Proposition 13], the application of untyped -calculus can be viewed as an operation app : → (1) . Anticipating on §6.4, the corresponding modified -rule is app ( ( )) · The point here is that for any set and ∈ (1) ( ), both terms app ( ( )) and lie in (1) ( ).

Typed variant.
In this section, we observe that the medium register Reg 1 (C/ ) is slightly inconvenient in a typed setting, and propose our last register Reg(C/ ) for slice categories.
Example 6.8. As in §4.1, let P denote the set of simple types over a given set of ground types and : Set P → Set P denote the monad for simply-typed -calculus values. Furthermore, let us recall the first state functor 1 : Set P → Set P : 1 ( ) is the set of typed application binary trees with leaves in . Let us consider the -rule Implicitly, this is in fact a family of rules indexed over all pairs ( , ) ∈ P 2 of types. For any such ( , ), we have 1 ∈ 1 ( ) → , 2 ∈ 2 ( ) , and 1 2 ∈ 1 ( ) . But these are all Set-valued modules, while the transition module → 1 × 2 is Set P -valued. In order to work with Set-valued modules, we now want to introduce a refinement of the register Reg 1 (C/ ). Let us first sketch on this example how it should look like. First of all, because 1 2 and have type , we would like to replace the Set P -valued module 1 × 2 with the Set-valued ( 1 × 2 ) . We would then use as metavariable module the product = ( 1 ) → × ( 1 ) × ( 1 ) ( ) × × , whose elements are tuples ( 1 , 2 , 3 , , ) as in the rule. The conclusion of our rule should then consist of a morphism → ( 1 × 2 ) , and similarly for the premises (see Example 6.11 below). The crucial ingredient here is the functor (−) : -Mod (Set S ) → -Mod (Set). Furthermore, in order to prove the existence of an initial model, it is important that this functor has a left adjoint (−) · y , as in Proposition 2.29.
Abstracting over this situation, we are led to: Definition 6.9. For any locally finitely presentable category C and object ∈ C, we define the endofunctorial register Reg(C/ ) for the slice category C/ as follows.  where the first functor denotes transposition, we obtain an endofunctor Σ , and define the abstract signature associated to to be the forgetful functor Remark 6.10. Equivalently, a model is a morphism : → equipped with a map making the following triangle commute, Example 6.11. Let us now treat the big-step -rule, finishing Example 6.8. For any types and , we define the following rule: Vol. 18:3
Using the notation of §6.4 below, this will look much like the standard, syntactic rule.
Definition 6.12. Let RegTransStruct 0 P,S ( , 1 , 2 ) = Reg( -Mod (Set S )/ 1 × 2 ). Finally, we would like signatures to consist of families of rules. For this, we use the following generic construction of registers.
Definition 6.13. For any endofunctorial register R for a category with coproducts, we denote by R * the endofunctorial register whose signatures are families of signatures in Sig R , and whose semantics maps any family to the coproduct of associated endofunctors.

A format for displaying signatures in rule-based registers.
In all of our examples of signatures in RegTransStruct 0 P,S ( , 1 , 2 ), the metavariable object is a functor to Set, so the premises and conclusion are set-maps (which are in fact module morphisms). In this case, we adopt the following notational conventions. • For each premise or conclusion → ↦ → of a rule, we write : : .
Example 6.15. The big-step -rule from Example 6.11 reads as follows. Remark 6.16. The module is often a product and thus is a tuple.

A. Hirschowitz, T. Hirschowitz, and A. Lafont
Vol. 18:3 Remark 6.17 [AHLM20]. In practice, there are several choices for building the transition rule out of such a schematic presentation, depending on the order of metavariables. This order is irrelevant: all interpretations yield isomorphic semantics, in the obvious sense.
Remark 6.18. This format could be generalised to any metavariable object, by using the internal language of categories.
6.5. Proof-irrelevant variant. In this section, we introduce a register for the proofirrelevant variant of transition monads. The idea is very simple: we keep the same signatures as in the proof-relevant setting, and interpret each signature in a proof-irrelevant way. This is done by constructing a functor from proof-relevant transition monads to proof-irrelevant ones.
Let us now introduce the relevant register. For this, we first observe that postcomposition with a functor : C → D turns a register for C into one for D.
Definition 6.20 (Post-composition register). For any functor : C → D and register R on C, let ! (R) denote the register for D with Sig ! (R) = Sig R and ! (R) = • R . Definition 6.21. The register RegITransMnd P,S is defined as ! (RegTransMnd P,S ), where : TransMnd P,S → ITransMnd P,S denotes the reflection.

Registers for monads
In this section and the next, we design the missing registers, respectively for monads and state functors. The registers are mostly adapted from existing constructions and results in the literature [AHLM19, FPT99, Fio08, FH09]. The novelty here lies in our new explicit description of initial algebras. The basic idea for specifying operations in our register for monads is that the arity of an operation consists of Vol. 18:3
The role of parametric modules lies in specifying how capture-avoiding substitution should interact with operations. A similar role is played in [FPT99,Fio08] by "pointed strong" endofunctors; we explain the connection in §9.2.
In §7.1, we construct a first register RegMnd 0 (Set P ), which only allows to specify operations. We then deal with equations in §7.2. Finally, we characterise initial algebras in §7.3. All proofs are deferred to §10.
7.1. The register RegMnd 0 (Set P ) for specifying operations. This section is devoted to defining the monadic register RegMnd 0 (Set P ).
Signatures will rely on parametric modules, but these need to be restricted in order to ensure existence of an initial algebra (and even monadicity).
Definition 7.2. A parametric module is elementary if it is isomorphic to some finite product of parametric modules of the shape ( • Θ) ( 1 ,..., ) .
Example 7.4. Recall that the idea of our register is that an operation will be specified by two parametric modules, one for the source and another (very simple) for the target. Let us give the parametric modules for a few operations from our examples.
In the above table, p, s, and c are placetaker types, and the subscripts on Θ refer to the notation introduced in Example 2.28. Thus, e.g., Definition 7.5. Given any set P, a modular signature is a family of pairs ( , ) where • is an elementary parametric module, and • ∈ P. Given any modular signature = ( , ) ∈ , an -algebra is a finitary monad equipped with -module morphisms ( ) → for all ∈ . An -algebra morphism is a monad morphism commuting with these morphisms. We denote by -alg → Mnd (Set P ) the forgetful functor.
Definition 7.6. We define the monadic register RegMnd 0 (Set P ) for Mnd (Set P ) as follows, for any set P.

A. Hirschowitz, T. Hirschowitz, and A. Lafont
Vol. 18:3 Signatures: A signature is a modular signature. Semantics: The abstract signature associated to any signature is the forgetful functor -alg → Mnd (Set P ).
Validity proof: By Corollary 10.21 below.
7.2. The register RegMnd (Set P ). We now define our register RegMnd (Set P ), where a signature will consist of a signature of RegMnd 0 (Set P ), plus a family of "equations". An equation is essentially a pair of "derived operations" with a common "arity". The arity consists of an input arity, which intuitively models the metavariables of the equation, and an output arity, which models the output type. The input arity will be an elementary parametric module , and the output arity will be a placetaker type ∈ P. For a family of equations, the arity thus is a family of such pairs ( , ) i.e., a modular signature. An equation will then consist of two derived operations with the same arity, in the following sense.
Definition 7.7. Given any modular signatures and , an -derived operation of arity is a functor : -alg → -alg over Mnd (Set P ), i.e., making the following triangle commute.
-alg -alg Mnd (Set P ) We call operations of basic, by contrast with the derived operations of . More concretely, we may introduce derived operations in two stages, as follows: • an -module morphism → between parametric modules and is a natural family of morphisms ( : ( ) −→ ( )) ∈ -alg , such that is a -module morphism, for each -algebra ; • letting = ( , ) ∈ , an -derived operation of arity is a family of parametric module morphisms → Θ , for all ∈ .
Remark 7.8. Concretely, an -derived operation of arity associates to each -algebra a family of -module morphisms ( ) → , naturally in . Equivalently, by Proposition 2.29, an -derived operation of arity associates to each a single, Example 7.9. Consider associativity of parallel composition in the -calculus, |( | ) ≡ ( | )| : the metavariables are , , and . The corresponding input arity is Θ 3 p , and the output arity is p. Recalling §4.3, and anticipating on §11.3 below, the basic signature contains in particular an operation par : Θ 2 p → Θ p for parallel composition, and the derived operations for associativity respectively map any algebra ( , par : 2 p → p , . . .) to Returning to the general case, we now define our notion of signature for monads. • a modular signature called the modular signature for operations, or the operations modular signature, • a modular signature called the modular signature for equations, or the equations modular signature, together with • a pair of -derived operations of arity . For any equational modular signature = ( , , , ), an -algebra is an -algebra such that the -algebra structures ( ) and ( ) coincide, i.e., ( ) = ( ). A morphism of -algebras is a morphism of -algebras. We let -alg denote the category of -algebras and morphisms between them.
Let us at last define our register.
Definition 7.11. We define the monadic register RegMnd (Set P ) for Mnd (Set P ) as follows, for any set P. Signatures: A signature is an equational modular signature. Semantics: The abstract signature associated to any equational modular signature is the forgetful functor -alg → Mnd (Set P ).
Validity proof: This is Corollary 10.24(i) below.
Let us conclude this subsection by introducing some convenient notation for specifying equations.
Notation 7.12 (Format for equations). We write any equational modular signature whose equations modular signature is a singleton = ( , ), say with derived operations given by → Θ 2 ↦ → ( , ), as : ≡ : Θ (leaving the operations modular signature implicit), or even just ≡ when the rest may be inferred. Furthermore, given any common (implicit) operations modular signature , any family ( : ≡ : Θ ) ∈ will accordingly denote the equational modular signature • whose equations modular signature is = ( , ) ∈ , and • whose -derived operations of arity are given at any -algebra by the morphisms Example 7.13. We write associativity from Example 7.9 as just par( , par( , )) ≡ par(par( , ), ).
In this case, the argument is the triple ( , , ).

Explicit description of initial algebras.
In this final subsection, we provide an explicit description of the initial -algebra, for any equational modular signature . We first deal with the case without equations, recalling the standard identification of the initial -algebra as a free algebra for a suitable endofunctor. In the presence of equations, we then characterise the initial -algebra as a coequaliser of free algebras.
In order to compute the initial algebra for a modular signature , we first observe that the induced homogeneous parametric module H in fact comes from an endofunctor.
Let us now turn to the explicit description of the initial -algebra. The mathematical contents essentially date back to [FPT99].
Proposition 7.16. For any modular signature , the forgetful functor -alg → Mnd (Set P ) is monadic, and furthermore the free Σ -algebra Σ * (id) on the identity has a canonicalalgebra structure, which is initial.
Proof. This is Corollary 10.21 below.
We now seek an explicit description of the initial -algebra, for any equational modular signature .
• We could consider computing the coequaliser of a simpler parallel pair spec ( ) → spec ( ), (7.3) constructed similarly. Let us show on a simple example that this does not compute the desired functor. The intuition is that this coequaliser identifies terms modulo a relation which is not a congruence. Let P = 1, and consist of a single, binary operation, i.e., = {(Θ 2 , ★)}. Thus, analgebra is merely a monad on sets, equipped with a binary -module morphism : 2 → . Furthermore, let consist of a single, ternary operation . Finally, for any -algebra ( , ), let ( ) and ( ) denote the -module morphisms By Proposition 7.16, for any set , spec ( ) ( ) consists of binary trees with leaves in . Similarly, spec ( ) ( ) consists of ternary trees with leaves in . Now, the parallel pair (7.3) maps ternary trees to binary trees, replacing any ternary node ( 1 , 2 , 3 ), respectively with (( 1 , 2 ), 3 ) and ( 1 , ( 2 , 3 )). Thus, e.g., assuming ∈ , the binary trees ((( , ), ), ) and (( , ( , )), ), having an even number of leaves, are not in the image of the parallel pair, hence are not identified in the coequaliser. • A perhaps higher-level understanding of this, which will be developped in §10, is as follows.
The derived operations induce monad morphisms ( ) ★ → ★ , of which the desired monad ★ is the coequaliser in Mnd (Set P ). However, coequalisers of monads are generally not pointwise [AMBL12]. Fortunately, reflexive coequalisers are, so the desired monad may be computed as the pointwise coequaliser of the obvious parallel pair ★ + ( ) ★ → ★ . Finally, roughly because (−) ★ is a left adjoint in this case, we have ★ + ( ) ★ ( + ) ★ , which directly leads to our formula.

Registers for (state) functors
In this section, we define a register Reg[Set P , Set S ] , which is a variant of RegMnd (Set P ) for the case of state functors. Operations, equations, and models will be defined exactly as for monads, and a signature in Reg[Set P , Set S ] will again consist of families of operations and equations, the only difference being that instead of parametric modules, we will use facets. We start by presenting the auxiliary notion of facets, which is a simple variant of the parametric modules of §7. Next, we introduce a register Reg 0 [Set P , Set S ] for operations, and then a refinement Reg[Set P , Set S ] with equations. Again, validity proofs are deferred to §10.
8.1. Facets. We start in this section by introducing facets. Let us first explain how they naturally come up in the case of call-by-value, simply-typed -calculus. We have seen in §4.1 that the source state functor 1 for call-by-value, simply-typed -calculus consists of application binary trees. The goal now is to design a register for specifying such a functor 1 . Intuitively, it has two (type-indexed families of) operations: • a first operation for injecting values into application binary trees, of type → 1 ( ) for all ∈ Set P and ∈ P, and • a second operation for application, of type 1 ( ) → × 1 ( ) → 1 ( ) , for all ∈ Set P and , ∈ P. The type for application is really similar to what we had in §7: for any type ∈ P, denoting by Θ : • For any ∈ S, let I = Ψ ev .
Remark 8.4. Let Θ denote the identity endofunctor on [Set P , Set S ] , and the constant functor mapping anything to the identity endofunctor. Post-composing with evaluation at any ∈ P, resp. ∈ S, we recover the facets I and Θ .
Remark 8.5. The notation Θ introduced above for the identity endofunctor is compatible with the one denoting the parametric module mapping a monad on Set P to as a module over itself (Example 2.28) in the sense that, for example, the functor underlying the module coincides with the functor underlying the monad .
Example 8.6. The arities for application binary trees will be given by I → Θ and Θ → × Θ → Θ , for all types and .
8.2. The register Reg 0 [Set P , Set S ] for specifying operations. In order to adapt the notion of signature for operations from RegMnd 0 (Set P ), we merely need to adapt the notion of elementariness, which becomes the following: Definition 8.7. A facet for [Set P , Set S ] is elementary if it is isomorphic to some finite product of facets of the shape ( • I, Θ ) ( 1 ,..., ) for some 1 , . . . , ∈ P and finitary functor : Set P × Set S → Set. Example 8.9. Typically, any product of facets of the shape I ( 1 ,..., ) or Θ ( 1 ,..., ) , for some , 1 , . . . , ∈ P and ∈ S, is elementary.
Definition 8.10. A facet-based signature is a family of pairs ( , ) consisting of an elementary facet and a transition type ∈ S.
Definition 8.11. For any facet-based signature = ( , ) ∈ , an -algebra is a finitary functor : Set P → Set S , equipped with natural transformations ( ) → Θ ( ) for all ∈ . A morphism of -algebras is a natural transformation commuting with these morphisms. Let -alg denote the category of -algebras, and : -alg → [Set P , Set S ] the forgetful functor.
Definition 8.12. For any sets P and S, we define the monadic register Reg 0 [Set P , Set S ] as follows. Signatures: A signature is a facet-based signature. Semantics: The abstract signature associated to any facet-based signature is the forgetful functor -alg → [Set P , Set S ] .
Validity proof: By Proposition 10.25 below. Definition 8.13. Given any facet-based signatures and , an -derived operation of arity is a functor : -alg → -alg over [Set P , Set S ] , i.e., making the following triangle commute.
-alg -alg We call basic the operations of , by contrast with the derived operations of . More concretely, as in Definition 7.7, we may introduce derived operations in two stages, as follows: • an -facet morphism → between facets and is a natural family of natural transformations ( : ( ) −→ ( )) ∈ -alg ; • letting = ( , ) ∈ , an -derived operation of arity is a family of -facet morphisms → Θ , for all ∈ .
Remark 8.14. Concretely, an -derived operation of arity associates to each -algebra a family of -facet morphisms ( ) → , naturally in . For any equational facet-based signature = ( , , , ), an -algebra is an -algebra such that the -algebra structures ( ) and ( ) coincide, i.e., ( ) = ( ). A morphism of -algebras is a morphism of -algebras. We let -alg denote the category of -algebras and morphisms between them.
Definition 8.16. For any sets P and S, we define the monadic register Reg[Set P , Set S ] for [Set P , Set S ] as follows.
Signatures: A signature is an equational facet-based signature. Semantics: The abstract signature associated to any equational facet-based signature is the forgetful functor -alg → [Set P , Set S ] .
Validity proof: By Corollary 10.28 below.
Call-by-value, simply-typed 2 ( ) = : I → Θ (for all ) Notation 8. 18. In examples, we will present equational facet-based signatures as families of equations. For this, we will use Notation 7.12, which extends to facet-based equations. E.g., Example 7.13 applies verbatim for associativity of multiset union in the target state functor for differential -calculus.
8.4. Explicit description of initial algebras. In this section, we state monadicity of the register Reg[Set P , Set S ] of equational facet-based signatures, and give our explicit description of initial algebras. We first deal with facet-based signatures , identifying the initial -algebra as a free algebra for a suitable endofunctor. We then characterise the initial -algebra as a coequaliser of free algebras, for any equational facet-based signature .
Definition 8.19. For any facet-based signature , we define its associated endofunctor Σ on [Set P , Set S ] as follows.
Proposition 8.21. For any facet-based signature , the forgetful functor : -alg → [Set P , Set S ] is monadic. Furthermore, the free -algebra on a functor ∈ [Set P , Set S ] is the free Σ -algebra Σ * ( ), as characterised in Proposition 5.9. Proof. A direct consequence of Proposition 10.25 below.

General registers
We have now introduced all the needed registers for our register RegTransMnd P,S of Definition 5.15 to make sense, including two registers featuring equations, respectively for monads (Definition 7.11) and functors (Definition 8.16). In this section, in preparation for the missing validity proofs and the announced explicit descriptions of initial algebras, we introduce a fundamental register featuring equations, for a general category, ES C , whose signatures are Fiore and Hur's equational systems [FH09]. In order to deal more specifically with monads, we then introduce a second register, PSEF C , based on Fiore, Plotkin, and Turi's pointed strong endofunctors, which incorporates variable binding and substitution. We then "merge" both registers into a single register MES C , suited for syntax with variable binding, substitution, and equations. Proofs are again deferred to §10.
9.1. Equational systems. A general device for constructing monadic functors is Fiore and Hur's equational systems [FH09]. In this section, we view equational systems on a category C as the signatures of a register ES C for C, called the equational register, which refines with equations the endofunctorial register EF C (see Definition 5.10). Briefly, an equational system consists of two parts: • an endofunctor Σ on C, which intuitively specifies operations, • and equations.
We present them in a slightly non-standard way, and make the link with the original in Propositions 9.5 and 9.8 below.
Definition 9.1. For any endofunctor Γ and monad on a category C, a functorial -term of arity Γ is a natural transformation Γ → .

MODULES OVER MONADS AND OPERATIONAL SEMANTICS (EXPANDED VERSION) 3:43
Example 9.3. We will do this right in Example 9.26 below, but for illustrative purposes, let us describe a failed attempt at specifying pure -terms modulo by an equational system. We first take C = [Set, Set] to consist of finitary endofunctors on sets, and Σ( ) ( ) = + ( ) 2 + ( + 1). The first summand models variables, the second application, and the third, abstraction. Indeed, any algebra comes equipped with maps app : ( ) 2 → ( ) and : ( + 1) → ( ), for all . The first member of the -equation, app ( ( ), ), would be modelled by setting Γ( ) ( ) = ( +1) × ( ) and taking the natural transformation Γ → Σ * mapping any ( , ) ∈ ( + 1) × ( ) to app ( ( ), ) (omitting the monad unit : id → Σ * ). This works fine, but we have neglected to build substitution into the model, so we cannot define the right-hand side of . This will be rectified in Example 9.26, after observing that (part of) Σ is in fact pointed strong in Example 9.15.
The following should now look natural.
This differs slightly from Fiore and Hur's [FH09] definition, so let us readily bridge the gap.
Remark 9.6. The expert will have noticed that Fiore and Hur's equational systems use (iii), in a slightly more general setting: they do not assume C to be locally finitely presentable, nor Σ and Γ to be finitary.
Let us readily transfer this definition across the various correspondences of Proposition 9.5. which is further equivalent to equality of induced Γ-algebra structures. The rest follows similarly.
Remark 9.9. The equivalence of (a) and (c) entails that our notion of algebra coincides with Fiore and Hur's (apart from the differences noted in Remark 9.6).
Remark 9.10. Families ( = ) of equations are covered by taking the coproduct of all involved endofunctors, say Γ , and the pointwise copairing of functorial terms.
Definition 9.11. For a given locally finitely presentable category C, we define the monadic register ES C , called the equational register, as follows. Signatures: A signature is an equational system. Semantics: The abstract signature associated to any signature E is the forgetful functor E -alg → C.
Validity proof: By Theorem 10.14 below.
Example 9.12. Given a cocomplete category C, the endofunctor register EF C is a subregister of ES C , by mapping any finitary endofunctor Σ to the (finitary) equational system given by taking Γ = 0, and the unique and .
9.2. The register PSEF C for monoids. In the previous subsection, we reviewed a fundamental register available for general locally finitely presentable categories. Here, we review another fundamental register called PSEF C , available for the category of monoids in a convenient monoidal category. This register is essentially due to Fiore, Plotkin, and Turi [FPT99]. Signatures in the register PSEF C will be pointed strong endofunctors on the monoidal category C.
The point of the register PSEF C is to specify monads. In fact, monads may be specified by the previous register, ES C , but at the cost of including in the signature • operations for the monad multiplication and unit, and • equations for associativity and unitality.
Instead, the register PSEF C will directly specify monoids in any (sufficiently nice) monoidal category C, hence be more economical. This in particular covers the case of finitary monads on a locally finitely presentable category.
Let us first describe the announced monadic abstract signature. We start by recalling what a pointed strong endofunctor is, and showing how it yields a parametric module (in the sense of Definition 2.15) on C.
A monoid structure on any ∈ C thus amounts to • a substitution operation ⊗ → mapping any such explicit substitution ( ) ∈ ( ⊗ ) ( ) to some proper substitution, which we denote by [ ] ∈ ( ), • together with a morphism → , which, because ( ) = id( ) = , amounts to identifying available variables within each ( ). These data are required to satisfy the usual associativity and unitality conditions, which amount to standard substitution lemmas.
Definition 9.16. We define the parametric module Σ stmod on C as assigning to any monoid ∈ C, the object Σ( ), equipped with the action given by the composite The verification that this assignment indeed defines a parametric module is straightforward.
The category Σ -Mon of models We now introduce Σ-monoids. These are exactly the classical Σ-monoids, which we present from a point of view better suited to our purpose. They are monoids equipped with a "compatible" algebra structure: Definition 9.17. A Σ-monoid is a monoid , equipped with an -module morphism : Σ stmod ( ) → . A Σ-monoid morphism is a monoid morphism : → making the following square commute.
We let Σ -Mon denote the category of Σ-monoids and morphisms between them, while Σ : Σ -Mon → Mon(C) denotes the obvious forgetful functor.
Let us first prove that this agrees with the standard definition.
Proposition 9.18. The category Σ -Mon is isomorphic over Mon(C) to the following category. • Objects are monoids equipped with Σ-algebra structure : Σ( ) → making the diagram commute. • Morphisms are morphisms in C which are both monoid and Σ-algebra morphisms.
Proof. By definition of Σ stmod , it is equivalent for a morphism Σ( ) → to be an -module morphism, and for the condition (9.1) to hold.
Let us finally check that we have defined an abstract signature. We now want to recall a standard characterisation of the monad induced by the monadic functor Σ -Mon , but before that let us fix some notation.
Notation 9.20. Let us refine Notation 5.7 and Remark 5.11. For a pointed strong endofunctor Σ on a convenient monoidal category C, Σ ★ (0) might be read as different objects of C, according to whether Σ is viewed as a finitary endofunctor or a finitary pointed strong endofunctor. Since Σ-monoids are also monadic over monoids, it might even be understood as a monoid in C. We choose the following convention: • Σ ★ denotes the "free Σ-monoid" monad C, • Σ denotes the "free Σ-monoid" monad on Mon(C), • Σ * denotes the "free Σ-algebra" monad on C.
Definition 9.23. Given finitary, pointed strong endofunctors Σ and Γ on a convenient monoidal category C, a monoidal functorial Σ -term of arity Γ is a parametric module morphism Γ stmod → (Σ ) monmod , where we recall Γ stmod from Definition 9.16 and (Σ ) monmod from Notation 9.20 and Example 2.17. This indeed defines a morphism of the claimed type, by a simple diagram chasing, and furthermore this assignment is clearly natural in Γ and . • Conversely, given any : Γ stmod → monmod , let ↑ : -alg → Γ -Mon map any -algebra structure : ( ) → on a monoid to the Γ-algebra structure Again, a simple diagram chase shows that this Γ-algebra structure satisfies the coherence law of Γ-monoids. These two maps are easily checked to be mutually inverse, thus proving the claim. Let us now turn to defining algebras for a monoidal equational system.
Mimicking Proposition 9.8, we now transfer this definition across the various correspondences of Proposition 9.25. which is further equivalent to equality of induced Γ-algebra structures. The rest follows easily.
Definition 9.29. For a given convenient monoidal category C, we define the monadic register MES C , called the monoidal equational register, as follows. Signatures: A signature is a monoidal equational system. Semantics: The abstract signature associated to a signature E is the forgetful functor E -alg → Mon(C).
Validity proof: By Theorem 10.16 below.

Computing initial algebras in the presence of equations
In this section, we establish the announced explicit descriptions of initial algebras, thereby proving that the registers introduced in §7 and §8 are valid. For this, we in passing also prove the validity of the registers from §9, and establish useful explicit descriptions of initial algebras for them too. In order, we characterise the underlying monad and initial algebra for suitable signatures in our registers featuring equations, namely the registers • ES C of equational systems (Definition 9.11), • MES C of monoidal equational systems (Definition 9.29), • RegMnd (Set P ) of equational modular signatures (Definition 7.11), and • Reg 0 [Set P , Set S ] of equational facet-based signatures (Definition 8.12). But before doing this, in §10.1, we study a well-known [ARV10] refinement of finitariness, which we call friendliness, and prove the main foundational result about it. In §10.2-10.5, we then exploit this to characterise underlying monads and initial algebras for the announced registers.
10.1. Reflexive coequalisers of friendly monoids. Let us start from the announced result on monads (Theorem 7.18). The monads generated by our register RegMnd (Set P ) with equations are, almost by definition, coequalisers in Mnd (Set P ). We have announced in Theorem 7.18 that their underlying functors are coequalisers in [Set P , Set P ] . Technically, the goal is thus to delineate sufficient conditions for monad coequalisers E ⇒ D to be computed pointwise, in the sense that each E ( ) ⇒ D ( ) ( ) is a coequaliser, and the monad structure is entirely determined by the family ( ( )) ∈Set P (see [Mac98,Vol. 18 :3   MODULES OVER MONADS AND OPERATIONAL SEMANTICS (EXPANDED VERSION) 3:51 §V.3]). Roughly, this will work if both monads E and D preserve reflexive coequalisers. Because (finitary) monads are monoids in the category of (finitary) endofunctors, we can in fact generalise the result to monoids in a suitable category (see Proposition 10.17 below). Preservation of reflexive coequalisers plays a fundamental role in the study of algebraic theories [ARV10]. As we will use it a lot, let us give it a name.
• A reflexive pair of morphisms is a pair , : → of parallel morphisms, sharing a common section , i.e., : → such that = id = . • A reflexive coequaliser is a coequaliser of a reflexive pair.
• A functor is friendly when it is finitary and preserves reflexive coequalisers.
Remark 10.2. By [ARV10, Theorem 7.7], when the considered categories are cocomplete, this is equivalent to preserving all sifted colimits.
Definition 10.3. An object of a monoidal category is ⊗-friendly (pronounced "tensorfriendly") when the functor ⊗ − is friendly. Notation 10.5. By the proposition, in all of our use cases, ⊗-friendliness and friendliness are synonymous, hence we use the latter for simplicity.
Definition 10.6. A monoidal category is friendly when it is convenient and all objects are friendly.
• The composition monoidal structure on finitary endofunctors on any locally finitely presentable category is convenient, though not friendly in general. By Proposition 10.4, the friendly objects are precisely the endofunctors preserving reflexive coequalisers. • On categories of the form Set P for some set P, though, by [ARV10, Corollary 6.30], all finitary endofunctors are friendly, hence [Set P , Set P ] is friendly.
Proposition 10.8. For any convenient monoidal category C, the forgetful functor creates reflexive coequalisers of friendly objects. More concretely, given a reflexive pair ⇒ of monoid morphisms, if and are friendly, then the coequaliser in C lifts uniquely to a cocone of monoids, which is again a coequaliser.
Proof. Monoids are the algebras of the "free monoid" monad, which we denote by (−) ★ in this proof. Furthermore, a forgetful functor from monad algebras always creates those colimits that the monad preserves (Proposition 2.32). It thus suffices to show that (−) ★ preserves reflexive coequalisers of friendly objects.
Let thus 1 ⇒ 2 denote a reflexive coequaliser, with 1 and 2 friendly. Let us first show that is again friendly. For this, we consider any reflexive coequaliser 1 ⇒ 2 . Then, we have: as desired.
• The base case is trivial.
) By construction all columns are reflexive coequalisers, and by friendliness so are all rows. By [BW05,Lemma 8.4.2], the diagonal is thus again a (reflexive) coequaliser. Finally, by interchange of colimits, we obtain that ★ 1 ⇒ ★ 2 ★ is also a coequaliser, as desired.
Corollary 10.9. Reflexive coequalisers of friendly monads on a finitely presentable category C are computed pointwise.
Similarly, reflexive coequalisers of finitary monads on a category of the form Set P for some set P, are computed pointwise.
Proof. The first point follows directly from the proposition. For the second, we additionally use the fact that [Set P , Set P ] is friendly (Example 10.7).
10.2. Initial algebras for equational systems. In this section, we want to apply the previous corollary to characterise the induced monad and initial algebra for equational systems. For this, we should show that the monads D and E underlying the relevant parallel pair D ⇒ E in Monadic /C are indeed friendly. What helps us here is that these monads are free on a friendly endofunctor, as we now show. We again state this in the abstract context of a convenient monoidal category.
Proposition 10.10. In any convenient monoidal category, the free monoid on a friendly object is again friendly. Proof. We in fact prove the more general result that if ∈ C preserves D-colimits for a given category D, in the sense that ⊗ − preserves D-colimits, then so does ★ ⊗ −. By Corollary 2.34, it is enough to show that the forgetful functor from the category of algebras for the monad ★ ⊗ − creates D-colimits. But, by [Kel80, Proposition 23.2], this category of algebras is isomorphic (over C) to the category of algebras for the endofunctor ⊗ −. Thus, we are left with showing that the forgetful functor from this latter category creates D-colimits, which follows from the next lemma.
The following is analogous to Proposition 2.32, with an endofunctor instead of a monad.
Lemma 10.11. Let be an endofunctor on a category C. Then, the forgetful functor -alg → C creates any colimit that preserves. More specifically, given a category D such that preserves colimits of all diagrams : D → C, then the forgetful functor -alg → C creates colimits of all diagrams : D → -alg.
Corollary 10.12. The free monad on a friendly endofunctor on a finitely presentable category is friendly.
We now want to apply Corollary 10.9 to prove a first free+quotient explicit description of initial algebras for equational systems. The exact same technique will then be applied to other registers in the following subsections, namely to monoidal equational systems, equational modular signatures, and equational facet-based signatures.
Before giving the explicit description, we need to introduce the following. We may now state: Theorem 10.14. Let E = (C : Γ = : Σ) be any equational system. Then: (i) The forgetful functor E -alg → C is finitary monadic.
(ii) The finitary monad E * underlying the forgetful functor E -alg → C is the coequaliser (in Mnd (C)) of˜,˜: (Σ + Γ) * ⇒ Σ * . Furthermore, if Σ and Γ are friendly (which is in particular the case when C is [Set P , Set P ] for some set P), we have: (iii) The above coequaliser E * is created by the forgetful functor Mnd (C) → [C, C] , hence computed pointwise. (iv) The initial E-algebra is the coequaliser of 10.4. Initial algebras for RegMnd (Set P ). In this section, we characterise the underlying monad and initial algebra of equational modular signatures, i.e., signatures of the register RegMnd (Set P ), filling in the missing bits from §7.3. We first deal with the register RegMnd 0 (Set P ) without equations, by compiling (in the sense of Definition 5.8) to the register PSEF [Set P ,Set P ] of pointed strong endofunctors on [Set P , Set P ] . We then tackle the whole register RegMnd (Set P ), using friendliness. Let us first deal with the case without equations. Recalling from Definition 7.14 the endofunctor Σ on [Set P , Set P ] induced by a modular signature , the idea in this case is that the assignment ↦ → Σ may be viewed as mapping signatures of RegMnd 0 (Set P ) to signatures of PSEF [Set P ,Set P ] , i.e., pointed strong endofunctors. We first establish this by equipping Σ with a pointed strength, then use compilation to transport the problem, and conclude.
Proof. Any family of Set-valued module morphisms : ( ) → corresponds by the adjunction of Proposition 2.29 to a family˜: ( ) · y → of Set P -valued module morphisms, hence by copairing to one compatible module morphism Σ stmod ( ) → (recalling Definition 9.16), and thus to Σ -monoid structure on . This correspondence extends straightforwardly to morphisms, hence defining the desired functor -alg → Σ -Mon over Mnd (Set P ). Since it is bijective, the functor is an isomorphism.
Corollary 10.21. For any modular signature , the forgetful functor -alg → Mnd (Set P ) is monadic, and furthermore the free -algebra on an endofunctor ∈ [Set P , Set P ] is the free Σ -monoid Σ ★ ( ), as characterised in Proposition 9.21.
We now want to show that, for any equational facet-based signature , the forgetful functor -alg → [Set P , Set S ] is monadic, and to explicitly characterise the corresponding monad and initial algebra. For this, we can exhibit -alg as an equaliser of finitary monadic functors over [Set P , Set S ] and apply Corollary 2.48: Proposition 10.26. For any equational facet-based signature = ( , , , ), -alg is the equaliser in CAT of and .

Applications
In this section, we design a signature in RegTransMnd P,S for each of the announced languages. One exception is Positive GSOS systems: for them, we go further, by recasting them as the signatures of a subregister of RegTransMnd P,S .
11.1. The call-by-value, simply-typed, big-step -calculus. Recall from §4.1, that the simply-typed, call-by-value, big-step -calculus forms a transition monad, where we take P = S to be the set of types (generated from some fixed set of type constants). The monad over Set P is given by values, the source state functor 1 is given by application binary trees, and the second state functor 2 is the identity.
Let us now design a signature for this transition monad. Let : Set P → Set S be specified by the signature of Reg[Set P , Set S ] consisting of two families of operations app , : Θ → × Θ → Θ and val : I → Θ . Our signature for call-by-value, simplytyped, big-step -calculus is presented in the following table Monad and state functors In a bit more detail, the first rule is indexed by the type of . The second one is indexed by two types and . There are five metavariables, 1 , 2 , 3 , , and . We thus take := ( 1 ) → × ( 1 ) × ( 1 ) ( ) × × .
11.2. The¯-calculus. Recall from §4.2 that the -calculus [Her95,Vau07] forms a transition monad with P = 2 = {p, s}, where p stands for "programs" and s for "stacks". The placetaker monad on Set P is given by programs and stacks. The set of transition types is S = 3 = {c, p, s}, where c stands for "commands", and both state functors 1 , 2 : Set P → Set S are given by 1 ( ) = 2 ( ) = ( p × s , p , s ). Let us repeat the grammar for the reader's convenience.

| ·
Transitions are generated by the congruence rules and the following two rules . | · → [ ↦ → ] | . Let us see how to specify this transition monad using our register. We saw in Remark 8.17 that both state functors may be specified by operations −|− : I p × I s → Θ c p : I p → Θ p s : I s → Θ s .
The monad, say , is specified by operations Let us finish by listing the various congruence rules.