Scholarly article on topic 'Modularity of Behaviours for Mathematical Operational Semantics'

Modularity of Behaviours for Mathematical Operational Semantics Academic research paper on "Computer and information sciences"

CC BY-NC-ND
0
0
Share paper
Keywords
{"Mathematical operational semantics" / modularity / "timed transition systems" / comonads / "distributive laws"}

Abstract of research paper on Computer and information sciences, author of scientific article — Marco Kick, John Power

Abstract Some years ago, Turi and Plotkin gave a precise mathematical formulation of a notion of structural operational semantics: their formulation is equivalent to a distributive law of the free monad on a signature over the cofree copointed endofunctor on a behaviour endofunctor. From such a distributive law, one can readily induce a distributive law of the monad over the cofree comonad on the behaviour endofunctor, and much of their analysis can be carried out in the latter terms, adding a little more generality that proves to be vital here. Here, largely at the latter level of generality, we investigate the situation in which one has two sorts of behaviours, with operational semantics possibly interacting with each other. Our leading examples are given by combining action and timing, with a modular account of the operational semantics for the combination induced by that of each of the two components. Our study necessitates investigation and new results about products of comonads and liftings of monads to categories of coalgebras for the product of comonads, providing constructions with which one can readily calculate.

Academic research paper on topic "Modularity of Behaviours for Mathematical Operational Semantics"

Available online at www.sciencedirect.com

SCIENCE DIRECT®

ELSEVIER Electronic Notes in Theoretical Computer Science 106 (2004) 185-200

www.elsevier.com/locate/entcs

Modularity of Behaviours for Mathematical Operational Semantics

Marco Kick and John Power1 '2

Laboratory for the Foundations of Computer Science, School of Informatics University of Edinburgh King's Buildings, Edinburgh EH9 3JZ, SCOTLAND

Abstract

Some years ago, Turi and Plotkin gave a precise mathematical formulation of a notion of structural operational semantics: their formulation is equivalent to a distributive law of the free monad on a signature over the cofree copointed endofunctor on a behaviour endofunctor. From such a distributive law, one can readily induce a distributive law of the monad over the cofree comonad on the behaviour endofunctor, and much of their analysis can be carried out in the latter terms, adding a little more generality that proves to be vital here. Here, largely at the latter level of generality, we investigate the situation in which one has two sorts of behaviours, with operational semantics possibly interacting with each other. Our leading examples are given by combining action and timing, with a modular account of the operational semantics for the combination induced by that of each of the two components. Our study necessitates investigation and new results about products of comonads and liftings of monads to categories of coalgebras for the product of comonads, providing constructions with which one can readily calculate.

Keywords: Mathematical operational semantics, modularity, timed transition systems, comonads, distributive laws.

1 Introduction

Turi and Plotkin, in their paper "Towards a mathematical operational semantics" [17], gave a precise general mathematical formulation of a notion of structural operational semantics, modelling GSOS, more precisely image-finite Generalised Structural Operational Semantics. They started with a

1 This work is supported by EPSRC grants GR/N64571, GR/R67842/01, GR/N23141 and GR/586372/01, and EC grant IST-1999-29082

2 Email: mailto:ajp@inf.ed.ac.uk

1571-0661/$ - see front matter © 2004 Elsevier B.V. All rights reserved. doi:10.1016/j.entcs.2004.02.030

base category C with finite products, a "syntax" endofunctor £ on C, and a "behaviour" endofunctor B on C, and they modelled a GSOS rule by an abstract operational rule, which they defined to be a natural transformation £(B x Id) ^ BT, where T is the free monad on £, which they assumed exists. Under mild conditions, they showed that each abstract operational rule gave rise to a distributive law of the monad T over the cofree comonad D on B, allowing them to model the combination of operational and denotational semantics. More delicately, it was shown in [11] and further explained and exploited in [14] that to give an abstract operational rule is actually equivalent to giving a distributive law of the free monad T on £ over the cofree copointed endofunctor on an endofunctor B, from which one can deduce Turi and Plotkin's distributive law of T over D. Here, we investigate modularity at the level of generality proposed by Turi and Plotkin in the precise sense of trying to combine two sorts of behaviour, i.e., start with endofunctors B and B' or more generally with comonads D and D' and try, using more primitive data, to induce a distributive law of T over the cofree copointed endofunctor on B x B' or more generally over the comonad D x D' if the latter exists.

Our leading example involves timing. A time domain is a monoid (T, +, 0) subject to two conditions (see Definition 2.1). A leading example is given by the set of natural numbers with addition. A timed transition system is a labelled transition system (P, T, where P is a set of processes, T is a time domain, and ^C P xT x P is a time transition relation, i.e., it satisfies axioms of determinacy, zero-delay, and continuity (see Definition 2.2. The concept of timed transition system was at the heart of the first author's thesis [10], was summarised in [9], and was synthesised from various accounts of time in the literature, such as [6,13,18]. Given a finite set A of actions, a time domain T and a set P, a heterogeneous transition system (P,A,T, on P is given

• an image-finite transition system (P, A, and

• a timed transition system (P,T,

To the coalgebra cognoscenti, this situation begs for analysis: the first transition systems amounts to a coalgebra for an endofunctor B on Set [5]. The timed transition system is more complex, but we can prove that it amounts to a coalgebra for a comonad ET on Set, where ET is generated by the time domain T and has a natural and succinct description (see Definition 2.5 and Theorems 2.4 and 2.6). When the time domain is the set of natural numbers with addition, the comonad ET is the cofree comonad on an endofunctor (see Theorem 2.7), but that is atypical. So we always have a pair of monads D and D' on Set together with a D-coalgebra structure and a D'-coalgebra structure

on the same set. Moreover, we can assume that D is the cofree comonad on an endofunctor B and there is an important special case in which D' is also a cofree comonad on an endofunctor B'. We analyse time in Section 2 and we analyse the combination of transition systems in Section 3.

In order to give a unified operational semantics, we first need to replace the pair of comonads D and D' by a combined comonad G for which a G-coalgebra amounts to a set, more generally an object of a category, together with both a D-coalgebra structure and a D'-coalgebra structure on it. We can readily prove that, if the product D x D' of comonads exists, that is the combined comonad we require. But products of comonads do not always exist, and when they do exist, they are typically awkward to calculate. So, in Section 3, we prove that the product does the job we want, we give simple and general sufficient conditions that imply the existence of such a product, and, taking the dual of a result for monads in [2], we characterise the product in terms with which one can readily calculate, providing that one of the comonads is cofree on an endofunctor, which is true of all the examples we study. If both comonads are cofree on endofunctors, life becomes much simpler, as the product of comonads is then the cofree comonad on the product of endofunctors, which in turn is given pointwise.

Turning to the combination of operational semantics for two behaviours, a further delicacy arises [10]: it is not always the case that one has independent pairs of behaviour, i.e., one might not have distributive laws

TD ^ DT

TD' ^ D'T that one seeks to combine into one of the form

T(D x D') ^ (D x D')T

That situation sometimes appears in practice, and we readily deal with it in Section 4. But more generally, the time behaviour typically interacts with the action behaviour: one most generally might start with data of the form

T(D x D') ^ DT

T(D x D') ^ D'T

So the bulk of Section 4, which is devoted to the derivation of a combined operational semantics, gives necessary and sufficient conditions for the combination, necessarily allowing for the possibility of parametrised starting data.

We regard the work of this paper as a natural development of [14], which was a first attempt to take Turi and Plotkin's definition of a mathematical operational semantics and start to develop a theory of mathematical operational semantics, i.e., a body of constructions and theorems at the level of generality of their definition that reflect and suggest computational practice in examples.

2 Timed transition systems

The aim of this paper is to model the combination of behaviours in operational semantics. In our leading class of examples, one of the behaviours is given by time. So in this section, we briefly develop an account of timed processes as explained more fully in the first author's thesis [10] and in a paper summarising part of the thesis [9]. Our analysis is consistent with and generalises much of the literature on time, for instance [6,13,18].

Definition 2.1 [10, Definition 3.1] A time domain is a monoid (T, +, 0) satisfying axioms of anti-symmetry and left-cancellation as follows:

(Vt, ueT).t + u = 0 ^ t = u = 0

(Vs, t, ueT).s +1 = s + u ^ t = u.

There is a range of obvious examples, leading ones given by the set of natural numbers and by the set of non-negative real numbers, each with monoid structure given by sum. There is, of course, an abundance of other examples in the literature: see [9,10] for a list of references.

Definition 2.2 [10, Definition 3.5] A timed transition system is a labelled transition system (P, T, where P is a set of processes, T is a time domain, and ^C P x T x P is called the time transition relation, satisfying axioms of determinacy, zero-delay and continuity, which, respectively, are given by

it. tit ; a

p ^ p A p ^ p ^ p = p 0

t+U / /—i //\ t // U /

p ^ p ^ (dp ).p ^ p ^ p

We call (P, T, a timed transition system over T. The reasons for the axioms are explained in [9,10]. The key point to observe here is that this is only about time: it does not involve any other possible behaviour. It has proved to be useful to isolate the time behaviour from all the other possible

behaviour of a process [9,10], but in this paper, we want to recombine two such sorts of behaviour with theoretical support.

One of the basic results of [9,10] is that timed transition systems over T are exactly equivalent to partial actions of the monoid T. To make this precise, we proceed as follows.

Definition 2.3 Given a monoid (M, +, 0) and a set X, a partial (right) monoid action of M on X is a partial function a : X x M —► X such that for all x in X and m, n in M, with ~ being Kleene equality,

a(x, 0) ~ x

a(a(x, m),n) ~ a(x, m + n)

There are several possible ways to make partial M-actions into a category M-pAct, but the one that proves most useful in this setting is by defining a map from (X, a) to (X', a') to be a total function f : X —► X' such that for all x in X and m in M

f (a(x, m)) ~ a'(f (x),m)

Theorem 2.4 To give a timed transition system (P, T, is to give a partial T-action on P, the equivalence given by

p ^ p' ^ p' ~ a(p, t)

The central result of [10] is Theorem 4.1, which asserts that for a time domain T, the category T-pAct, which, by Theorem 2.4, amounts to a category of timed transition systems, is comonadic over Set with comonad given as follows.

Definition 2.5 Given a time domain (T, +, 0) and a set X, a T-evolution is partial function e : T ^ X satisfying the following two axioms:

e(0) I

(Vt,ueT).e(t + u) e(t) |

We denote the set of all T-evolutions on X by ETX or, if T is clear from the context, simply by EX.

Theorem 2.6 [10, Theorem 4-1] For any time domain (T, +, 0), the forgetful functor from T-pAct to Set is comonadic, with comonad given by ET.

Observe that, in general, ET is a comonad that is not the cofree comonad on an endofunctor: see [10] for some examples. But in one leading example, i.e., the case where T is the set of natural numbers, it is.

Theorem 2.7 [10, Theorem 4-2] cf [3] Let N denote the monoid of natural numbers with sum- Then EN is the cofree comonad on the endofunctor on Set given by 1 +—.

Theorems 2.6 and 2.7, together with their development in [9,10] mean that the study of timed operational behaviour alone reduces to the study of a distributive law of the free monad T on a signature over a behaviour comonad ET, with one leading example given by the cofree comonad on a behaviour endofunctor. This provides the backdrop for the analysis of combinations of behaviours that we develop in further sections here. We need just one more result from [10] in order to proceed.

Proposition 2.8 [10, Proposition 4-8] For any time domain T, the functor ET is accessible, with rank given by any infinite regular cardinal greater than the cardinality of T.

3 The product of comonads

In this section, we wish to consider the combination of timed behaviour, as described in Section 2, with the ordinary behaviour relative to actions as studied extensively in the coalgebra literature [5]. This allows us, in the succeeding section, to study operational semantics for the combination. For reasons of elegance, we shall make our theoretical analysis in terms of a pair of comonads, with one or possibly both given cofreely on an endofunctor.

Definition 3.1 [10, Definition 7.1] Let A be a finite set of actions, let T be a time domain, and let P be a set. A heterogeneous transition system (P, A, T, on P consists of

• an image-finite labelled transition system (P, A, and

• a timed transition system (P,T,

We have seen in the previous section that a timed transition system amounts to a ET-coalgebra for the comonad ET defined previously. And we have long known that an image-finite labelled transition system is given by a B-coalgebra for an endofunctor B, and, moreover, we may regard it as a D-coalgebra for the cofree comonad D on B, which exists in all the leading examples [5]. So a heterogeneous transition system amounts to a set together with a pair of coalgebra structures for comonads D and D', the former given by the cofree

comonad on an endofunctor B. So, given comonads D and D', we seek to exhibit a heterogeneous transition system as a coalgebra for a comonad derived from D and D'. In fact, if it exists, that combined comonad must be the product D x D' of comonads: be warned that that product is not given pointwise in general, i.e., it is not given by the product of endofunctors. Moreover, it need not always exist.

Definition 3.2 Given comonads D and D' on a category C, define the category (D, D')-Coalg to be the pullback in the large category of categories given by

(£>, £>') - C'oalg —*£>'- C'oalg

D - C'oalg-- C

where UD and UD are the forgetful functors.

Proposition 3.3 If the forgetful functor U : (D,D')-Coalg —► C has a right adjoint G, then (D,D')-Coalg is comonadic over C with comonad given by G.

Proof. By the dual of Beck's monadicity theorem [1], it suffices to prove that U reflects isomorphisms and that (D, D')-Coalg has and U preserves the equalisers of U-split equaliser pairs. Reflection of isomorphisms is trivial: a map in (D,D')-Coalg is simply a map in C that preserves both coalgebra structures, and if that map in C is an isomorphism, its inverse must preserve both coalgebra structures. And for the second condition, any U-split equaliser pair is sent to a UD-split equaliser pair in D-Coalg and a UD-split equaliser pair in D'-Coalg. So the split equaliser in C must lift, by the converse (easy) part of Beck's theorem to an equaliser in both D-Coalg and D'-Coalg, and so the equalising map in C is a map in (D, D')-Coalg and satisfies the equalising property there. The functor U preserves it by construction. □

It is not easy to give a direct proof of the existence of a right adjoint to the forgetful functor U : (D, D')-Coalg —► C, thus yielding comonadicity by the proposition, under general conditions. But an indirect route is readily available to us via a slightly subtle use of results about accessible categories [12],

cf [4].

Theorem 3.4 If C is a locally presentable category and D and D' are accessible, the category (D,D')-Coalg is locally presentable and the forgetful functor

to C has a right adjoint.

Proof. First observe that coalgebra structure transports along isomorphism, i.e., given a D-coalgebra (X, d) and an isomorphism f : X —► X' in C, it follows that X' possesses a (unique) D-structure making f an isomorphism in D-Coalg. It follows that the category (D, D')-Coalg is equivalent to the following category: an object consists of a D-coalgebra (X, d), a D'-coalgebra (X', d'), and an isomorphism in C between X and X'. This latter category is an iso-comma object

P-- D' - C'oalg

D - C'oalg —-- C

in the large category of categories. But the large category of accessible categories is closed under taking the category of coalgebras for an accessible comonad (see [4]), and under iso-comma objects [12], and under equivalence of categories. So (D, D')-Coalg is an accessible category. Moreover, since D and D' are both accessible, D-Coalg and D'-Coalg are cocomplete and UD and UDr preserve colimits. So (D, D')-Coalg is also cocomplete and the forgetful functor to C preserves colimits. Thus (D, D')-Coalg is a locally presentable category and the forgetful functor to C preserves colimits; so the latter has a right adjoint. □

Thus, for all examples of primary interest to us, e.g. for C = Set and D and D' being any of our leading examples, we do have a comonad. Much more analysis of the significance of accessibility and the fact that it includes all examples of substantial interest to us appears in [4]. Unusually, but fortunately, the fact that we know we have a comonad allows us to characterise it as the product of D and D'.

Assume we have an arbitrary category C. Given an object X of C, consider the functor ]JC(X X : C —► C. It sends an object Y to the coproduct of C (X,Y) copies of X. For an arbitrary endofunctor H : C —► C, it follows from the Yoneda lemma that to give a natural transformation

X : n X ^ H

C(X,_)

is equivalent to giving a map x : X —► HX. One can readily prove that

the functor ]JC(X X possesses a natural comonad structure, and one has the following equivalence, as used extensively for instance in the dual setting in [8].

Proposition 3.5 For a comonad D on C, to give a map of comonads

X : n X ^ D

C(X,_)

is equivalent to giving a D-coalgebra structure (X, x) on the object X.

Using that proposition, one can immediately prove the following.

Proposition 3.6 For comonads D and D' on C, if the product of comonads D x D' exists, the category of coalgebras (D x D')-Coalg is canonically isomorphic to the pullback

(£>, D') - Coalg —- D — Coalg

D - Coalg-- C

Proof. To give a D x D'-coalgebra is equivalent to giving a map of comonads of the form

X : n X ^ D x D'

C(X,_)

but that, by definition of product, is equivalent to giving a pair of maps X : ¡J X ^ D x' ^ X ^ D'

C(X,_) C(X,_)

which in turn is equivalent to giving an object of (D, D')-Coalg. All these equivalences are natural, yielding the result. □

Comonads are characterised by their categories of coalgebras, and the canonical isomorphism of the proposition commutes with the underlying functors to C. So the proposition has a dual as follows.

Theorem 3.7 If the forgetful functor from (D,D')-Coalg to C is comonadic with comonad G, then the product of comonads D x D' exists and is given by G.

Proof. The canonical functor

(D, D') — Coalg —► D — Coalg

commutes with the forgetful functors to C. So, if (D, D')-Coalg is of the form G-Coalg, the functor must be of the form

8 — Coalg : G — Coalg —► D — Coalg

for a map of comonads 8 : G ^ D (see [1] for the dual result). Thus we have projections 8 and 8'. Now, given a comonad W, to give a comonad map u : W ^ D is equivalent to giving a functor from W-Coalg to D-Coalg that commutes with the forgetful functors. Using the definition of (D, D')-Coalg as a pullback, we obtain a unique functor from S-Coalg to G-Coalg that commutes with the forgetful functors and with 8-Coalg and 8'-Coalg, and hence the desired unique map of comonads. □

Combining Proposition 3.3, Theorem 3.4, and Theorem 3.7, we can now deduce the result we seek.

Corollary 3.8 If C is a locally presentable category and D and D' are accessible comonads on C, the product D xD' exists and is given by the right adjoint to the forgetful functor from (D, D')-Coalg to C, exhibiting (D, D')-Coalg as (D x D')-Coalg.

This corollary includes all examples that are likely to be of much interest to us. But it does not give us a construction of the product D x D' that we can readily calculate. However, in the cases of primary interest to us, one of the comonads, that given by the action behaviour, is the cofree comonad on an endofunctor. And in that case, the dual of a result for monads in [2] does give us a reasonable construction as follows.

Theorem 3.9 For any category C and any endofunctor B and comonad D for which the cofree comonads Band (BD)TO on B and BD exist, the product x D also exists and is given by the functor D(BD)TO with a canonical comonad structure.

The dual of this theorem appears in [2], and this theorem directly appears in [10, Theorem 7.1]. We shall not include the detailed derivation here, although it does contain results of independent interest here. We simply refer to the development of Chapter 7 of the first author's thesis [10]. Constructions of cofree comonads on endofunctors abound in the coalgebraic literature, for instance in [19] but see also [7,14]. In particular, if C is locally presentable

and B and D are accessible, the cofree comonads Band (BD)TO exist [4], and so the theorem holds.

More specifically still, recall that our leading example of a time domain is given by that for natural numbers, and for that particular case, the comonad ET is itself the cofree comonad on an endofunctor, namely 1 +—. So there is some interest in the situation in which both D and D' are cofree comonads on endofunctors, B and B'. But that is a particularly simple case, because then, the category B-coalg of coalgebras for the endofunctor B is isomorphic to the category D-Coalg of coalgebras for the comonad D, and so, by a variant of the above analysis, we have the following result.

Corollary 3.10 Given endofunctors B and B' on a category C with finite products such that the cofree comonads Band B'TO exist, the product of comonads x B'TO exists and is given by (B x B')TO, where B x B' is the pointwise product of endofunctors, providing the cofree comonad on B x B' exists.

4 Structural operational semantics for a combination of behaviours

In this section, we reach the heart of the paper. We know, from Section 3, how to characterise the category of coalgebras for a product of comonads under mild conditions on the comonads and on the base category. We can further characterise the product itself, under mild conditions, providing one of the components is cofree on an endofunctor, as is the case for our leading examples. We further have, from Section 2, a class of examples of why we would want such a product of possible behaviours. But now we combine that analysis with the Turi and Plotkin idea to model structural operational semantics in terms of what are provably distributive laws [17,11,14]. The central facts for us are our characterisation in Section 3 of the category (D x D')-Coalg as (D,D')-Coalg together with the characterisation in [15] of a distributive law of a monad T over a comonad D as a lifting of T to D-Coalg, further explored in [11].

Theorem 4.1 Given a monad T, comonads D and D', and distributive laws A : TD ^ DT and A' : T'D ^ DT', there is a canonical distributive law of T over D x D' if the product of comonads D x D' exists.

Proof. This follows from [15] together with Proposition 3.6. By the former, the two distributive laws give liftings of T to D-Coalg and D'-Coalg respectively. By the latter, these liftings yield a monad on (D x D')-Coalg, as it is the

pullback category P. So by the converse part of [15], we have the distributive law of T over D x D' that we seek. □

But this result is less general than one would like because one does not always start with distributive laws A : TD ^ DT and A' : T'D ^ DT' or with anything that induces them [10]. The reason is that, in the leading examples, the time information and the action information typically interact with each other [10, Section 7.3.2]. So we consider the following question: given a monad T and comonads D and D', what are necessary and sufficient data that separate D and D' to some extent yet yield a lifting of the monad T to the category (D, D')-Coalg?

The following result was not explicitly stated in [15], but does follow from the analysis therein, which in turn was based on the characterisation of D-Coalg as a limit in [16].

Proposition 4.2 Given comonads (D,8d,eD) and (E,8e,eE) on a category C and a functor H : C —► C, to give a lifting of H to a functor from E-Coalg to D-Coalg is equivalent to giving a natural transformation

a : HE=> DH

subject to commutativity of the following two diagrams:

HSE HEE

5dH DDE

Using two copies of this proposition and our characterisation of (D x D')-Coalg as (D,D')-Coalg in Proposition 3.6, we can readily deduce the following.

Proposition 4.3 Given comonads D and D' on a category C such that the product D x D' exists, and given a functor T : C —► C, to give a lifting of T to an endofunctor on (D x D')-Coalg is equivalent to giving natural transformations

X : T (D x D') ^ DT X' : T (D x D') ^ D'T

subject to the following four axioms:

T (D x D')

(DxD>)

T{D ■ D'){D ■ D')

-к DT(D ■ D') -1

\{D ■ D) У ' DX

► DT

5dT DDT

T (D x D')

T (D x D')

(DxD>)

T(D ■ D'){D ■ D')

Л'(D x D')

D'T(D x D')

D'T T (D x D')

5d,T D'D'T

Now suppose one has not just an endofunctor T but a pointed endofunctor (T, n) that one wants to lift.

Proposition 4.4 Given comonads D and D' on a category C such that the product D x D' exists, and given a pointed endofunctor (T, n) on C together with a lifting of the endofunctor T to (D x D')-Coalg (or equivalently with the data of Proposition 4-5 subject to the axioms of the proposition), the unit n of T lifts if and only if the following two diagrams commute:

D x D'

n(D x D')

n(D x D')

T (D x D')

T (D x D')

Proof. We already have the data for the unit, and the naturality condition is trivial. The only question is of finding necessary and sufficient conditions for each component of the natural transformation to be a map in (D, D')-Coalg; but we know that the maps in (D,D')-Coa1g are given by maps in C that respect both coalgebra structures, so it is a routine matter to check a necessary and sufficient condition for that condition: such a result appears in [15], which is essentially gleaned from [16], but it is also easy to see directly, given as in the statement. □

Finally, given a monad (T, n), we seek necessary and sufficient conditions for the multiplication to lift. This is the one point that is not so easy:

the lifting of the functor part of the monad, as in Proposition 4.3, yields a distributive law t : T(D x D') ^ (D x D')T. And one needs to use that induced distributive law in the diagrams required to commute in order to make the multiplication lift. The conditions are easy to write if one is willing to use that distributive law, but it does make for potentially tricky calculation in verifying that examples satisfy the condition, as that distributive law is induced by more primitive data. Fortunately, in particular cases, commutativity of the diagrams is fairly routine to verify.

Proposition 4.5 Given comonads D and D' on a category C such that the product D x D' exists, and given a monad (T, ^, rj) on C together with a lifting of the pointed endofunctor (T,rj) to (D x D')-Coalg (or equivalently with the data of Propositions 4-5 and 4-4 subject to the axioms of the propositions), the multiplication ^ of T lifts if and only if the following two diagrams commute:

TT(D x D') S T(D x D')T --- DTT

V(D x D')

T(D x D')

T a't TT(D x D') S T(D x D')T --- D'TT

p(D x D')

T(D x D')---- D'T

Proof. The proof is similar to that for Proposition 4.4, using the universal property of the pullback (D, D')-Coalg and giving a necessary and sufficient condition for the components of a natural transformation to lift from C to each of D-Coalg and D'-Coalg. The above diagrams emerge fairly routinely, but one does need to think directly in terms of liftings, as the use of t in both diagrams implies. □

The presence of t in Proposition 4.5 but not in Proposition 4.4 means that the lifting of multiplication, as opposed to the lifting of the unit of a monad, depends upon both A and A' for each lifting, i.e., for lifting to each of D-Coalg and D'-Coalg.

Evidently, Propositions 4.3, 4.4 and 4.5 can be combined to yield one theorem involving eight diagrams. But it is obvious how to do that, so we leave that to any interested reader.

There are special cases of Proposition 4.5. It is common to start with a distributive law of the form

TD ^ DT

for the action behaviour while only having a natural transformation of the form

T (D x D') ^ D'T

for the time behaviour. That reduces the complexity of some of the diagrams a little, with the distributive law above often coming via the well-trodden paths of [17,11,14], but one still needs the second of our two diagrams in Proposition 4.5 involving t.

In a slightly different direction, one can consider cases in which one or both of D and D' is the cofree comonad on an endofunctor, say D cofree on B. Then D-Coalg is determined by the simpler universal property that characterises B-coalg, and so one can avoid the coherence axioms required for the lifting of a functor. Life is also simpler because one can use our characterisation of the product of comonads. So, to lift a functor T to B-coalg, one merely needs any natural transformation, subject to no axioms at all, of the form

a : TD'(BD')™ ^ BT

and such can be readily constructed, for instance, from any natural transformation of the form

f : T(Id x B)D' ^ BD'T

For applying D' to the counit (BD')TO ^ Id yields a natural transformation D'(BD')™ ^ D'. And one has the canonical composite

D'(BD')~ ^ (BD')~ ^ BD'

and thus a natural transformation of the form D'(BD')^ ^ (Id x B)D', as products of endofunctors are given pointwise (assuming of course that C has products), and so applying T to this, and composing with f and with another embedded counit yields a natural transformation of the form a as above: TD'(BD')^ ^ T(Id x B)D' ^ BD'T ^ BT.

References

[1] Barr, M., and C. Wells, "Toposes, Triples, and Theories," Grundlehren der math. Wissenschaften 278, 1985.

Hyland, M., G.D. Plotkin, and A.J. Power, Combining effects: sum and tensor, Theoretical Computer Science, to appear.

Jacobs, B., Monocongruences and cofree coalgebras, "Proceedings AMAST 95," Lecture Notes in Computer Science 936, 1995, 245-260.

[4] Johnstone, P., A.J. Power, T. Tsujishita, H. Watanabe, and J. Worrell, The structure of categories of coalgebras, Theoretical Computer Science 260 (2001) 87-117.

[5] Jacobs, B., and J. Rutten. A tutorial on (co)algebras and (co)induction, Bulletin of the European Association of Theoretical Computer Science 62 (1997), 222-259.

Jeffrey, A.S.A., S.A. Schneider, and F.W. Vaandrager, "A comparison of additivity axioms in timed transition systems," CWI Technical Report CS-R9366, 1993.

Kelly, G.M., A unified treatment of transfinite constructions for free algebras, free monoids, colimits, associated sheaves, and so on, Bulletin Australian Mathematical Society 22 (1980), 1-83.

Kelly, G.M., and A.J. Power, Adjunctions whose counits are coequalizers, and presentations of finitary monads, Journal of Pure and Applied Algebra 89 (1993), 163-179.

Kick, M., Bialgebraic 'modelling of timed processes, "Proceedings of ICALP 2002," Lecture Notes in Computer Science 2380, 2002, 525-536.

10] Kick, M., "A Mathematical Model of Timed Processes" Ph.D. dissertation, University of Edinburgh, 2003.

11] Lenisa, M., A.J. Power, and H. Watanabe, Distributivity for endofunctors, pointed and co-pointed endofunctors, monads and comonads, Electronic Notes in Theoretical Computer Science 33 (2000).

12] Makkai, M., and R. Pare, "Accessible categories: the foundations of categorical model theory," Contemporary Mathematics 104, 1989.

13] Nicollin, X., and J. Sifakis, An overview and synthesis of timed process algebras, "Proceedings CAV 1991", Lecture Notes in Computer Science 575, 1991, 376-398.

14] Power, A.J., Towards a theory of mathematical operational semantics, Electronic Notes in Theoretical Computer Science 82.1 (2003).

15] Power, A.J., and H. Watanabe, Combining a monad and a comonad,, Theoretical Computer Science 280 (2002), 137-162.

16] Street, R., The formal theory of monads, Journal of Pure and Applied Algebra 2 (1972), 149-168.

17] Turi, D., and G.D. Plotkin, Towards a mathematical operational semantics, "Proceedings of 12th Symposium on Logic in Computer Science," IEEE Computer Science Press, 1997, 280291.

18] Wang, Y., Real-time behaviour of asynchronous agents, "Proceedings of CONCUR 1990", Lecture Notes in Computer Science 458, 1990, 502-520.

19] Worell, James, Terminal sequences for accessible endofunctors, Electronic Notes in Theoretical Computer Science 19 (1999).