Scholarly article on topic 'Structured Transition Systems as Lax Coalgebras1 1Research partly supported by the EC TMR Network GETGRATS (General Theory of Graph Transformation Systems)'

Structured Transition Systems as Lax Coalgebras1 1Research partly supported by the EC TMR Network GETGRATS (General Theory of Graph Transformation Systems) Academic research paper on "Computer and information sciences"

CC BY-NC-ND
0
0
Share paper
Keywords
{}

Abstract of research paper on Computer and information sciences, author of scientific article — Andrea Corradini, Martin Große-Rhode, Reiko Heckel

Abstract This paper relates labeled transition systems and coalgebras with the motivation of comparing and combining their complementary contributions to the theory of concurrent systems. The well-known mismatch between these two notions for what concerns the morphisms is resolved by extending the coalgebraic framework by lax cohomomorphisms. Enriching both labeled transition systems and coalgebras with algebraic structure for an algebraic specification, the correspondence is lost again. This leads to the introduction of lax coalgebras, where the coalgebra structure is given by a lax homomorphism. The resulting category of lax coalgebras and lax cohomomorphisms for a suitable endofunctor is shown to be isomorphic to the category of structured transition systems, where both states and transitions form algebras. The framework is also presented on a more abstract categorical level using monads and comonads, extending the bialgebraic approach recently introduced by Turi and Plotkin.

Academic research paper on topic "Structured Transition Systems as Lax Coalgebras1 1Research partly supported by the EC TMR Network GETGRATS (General Theory of Graph Transformation Systems)"

URL: http://www.elsevier.nl/locate/entcs/volumeil.html 20 pages

Structured Transition Systems as Lax Coalgebras1

Andrea Corradini, Martin Grofie-Rhode, Reiko Heckel

Dipartimento di Informática, Universitá degli Studi di Pisa, Corso Italia, 4O, I - 56125 Pisa, Italia, {andrea, mgr, reiko}@di .unipi. it

Abstract

This paper relates labeled transition systems and coalgebras with the motivation of comparing and combining their complementary contributions to the theory of concurrent systems. The well-known mismatch between these two notions for what concerns the morphisms is resolved by extending the coalgebraic framework by lax cohomomorphisms.

Enriching both labeled transition systems and coalgebras with algebraic structure for an algebraic specification, the correspondence is lost again. This leads to the introduction of lax coalgebras, where the coalgebra structure is given by a lax homomorphism. The resulting category of lax coalgebras and lax cohomomorphisms for a suitable endofunctor is shown to be isomorphic to the category of structured transition systems, where both states and transitions form algebras.

The framework is also presented on a more abstract categorical level using monads and comonads, extending the bialgebraic approach recently introduced by Turi and Plotkin.

1 Introduction

Transition systems [7,12] are widely used in Computer Science for the operational semantics of computational formalisms. Many variations of such systems have been defined in the literature: Usually they are obtained by extending the basic structure (consisting of a set of states and a transition structure) with other features, like labeling functions, algebraic structure on states and/or transitions, an independence relation on transitions, and so on.

There are two main ways of representing a (standard) transition system as a mathematical structure. The first way is to regard it as a graph, i.e., a collection of nodes (the states) and of arcs (the transitions) among nodes.

1 Research partly supported by the EC TMR Network GETGRATS (General Theory of Graph Transformation Systems)

©1998 Published by Elsevier Science B. V.

Sometimes such a graph is required to be simple, i.e., there can be at most one transition relating two given states (therefore the transitions define a relation on states). The second way is to regard a transition system as a coalgehra (for a suitable endofunetor), by viewing the transition relation as a function from states to collections of states, mapping each state to its successors.

The representation of systems as (possibly simple) graphs has some advantages if one wants to equip states and transitions with algebraic structure. This is the case, for example, in the theory of structured transition systems as defined in [4]. It has been shown that programs of many computational formalisms (including, among others, P/T Petri nets in the sense of [9], term rewriting systems, term graph rewriting [3], graph rewriting [5], Horn Clause Logic [2]) can be encoded as heterogeneous graphs having as collection of nodes algebras with respect to a suitable algebraic specification,2 and usually a poorer structure on arcs (often they are just a set). Structured transition systems are defined instead as graphs having algebraic structure both on nodes and on arcs, A free construction associates with each program its induced structured transition system, from which a second free construction is used to generate the free model, i.e., a structured category which lifts the algebraic structure to the transition sequences. This induces an equivalence relation on the computations of a system, which is shown to capture some basic properties of true concurrency. Moreover, since the construction of the free model is a left adjoint functor, it is compositional with respect to operations on programs expressible as colimits.

The representation of transition systems as coalgebras has been used for example in [1], Interestingly, in this case the natural notion of morphism between systems turns out to be a functional hisimulation, and a final coalgebra (if it exists) provides canonical representatives for the equivalence classes of states w.r.t, bisimulation equivalence. Other topics based on the coalgebraic representation of transition systems have been recently addressed, including the relationship between the initial and final semantics [16], the use of final semantics for lazy applicative languages [18], and the definition of an abstract mathematical framework for structured operational semantics [17,19],

Summarizing, we can safely say that both representations of transition systems mentioned above (graphs and coalgebras) are at the basis of relevant theoretical results. However, in our view, the results obtained in the two approaches are complementary to each-other, and to our knowledge there is yet no clear way to relate them. This paper presents a contribution in this direction, Our main goal is to represent structured transition systems as some kind of coalgebras with algebraic structure. Briefly, we will introduce a category where the objects are such systems. As for arrows, many reasonable definitions exist, because one can require that both the algebraic and coalgebraic structure are strictly preserved, or that one of them (or even both) are pre-

2 Actually, for some of these formalisms a richer essentially algebraic structure is needed.

served just in a weak ("lax") way. This provides a flexible framework where the same systems can be analyzed from different perspectives, including the graph-theoretic and the coalgebraic ones, but also arbitrary mixtures of them. Interesting questions that can be considered in this new formal framework (but that we leave as future research topics) include the definition of observational mechanisms for structured transition systems, and the analysis of the corresponding bisimulation and congruence relations.

The paper is structured as follows. In Section 2, we recall for standard nondeterministic, labeled transition systems the definitions based on (simple) graphs and on coalgebras. The well-known mismatch between these two definitions for what concerns the morphisms is resolved by introducing lax cohomomorphisms, which are defined for any order-endowed functor, i.e., an endofunctor equipped with a family of preorders on arrows. In Section 3 essentially the same outline is followed for structured transition systems, where the algebraic structure of states is determined by an algebraic specification. As a running example, the transition system of a P/T Petri net is considered. We show that, unfortunately, such a system cannot be defined as a coalgebra for an endofunctor on the category of commutative monoids. This motivates the introduction of lax coalgebras, where the algebraic structure of the carrier is required to be preserved only in a lax way by the successor mapping. The category of lax coalgebras and lax cohomomorphisms is shown to be isomorphic to that of structured transition systems.

Next in Section 4 we establish a relationship between our approach and the related one due to Eutten, Turi, and Plotkin, started with [14,16] and further developed in [17,19], In particular, while we consider in Section 3 coalgebras for endofunctors on categories of algebras for an algebraic specification, in the abstract categorical setting of [17,19] the more general bialgebras are used, i.e., pairs of algebras and coalgebras for a monad and comonad, respectively. More fundamentally, however, the interpretation of the algebraic structure is different in the two approaches: In [17,19] it represents the structure of programs, the standard example being process algebras [10], and not the structure of states, as in our approach. It comes therefore of no surprise that the notions of bialgebras and of their morphisms as introduced in [19] are not adequate for our purposes. Thus in Section 5 we lift to the abstract level of bialgebras the lax notions introduced earlier, defining lax bialgebras and their lax cohomomorphisms. This more abstract framework makes easier the proof of interesting properties of our structures. As an example, we show that the well-known equivalence between the category of coalgebras for a functor and the category of coalgebras for its cofree comonad generalizes smoothly to the lax case. In the last section we conclude and briefly discuss some topics for future research.

2 Labeled Transition Systems as Coalgebras with Lax Cohomomorphism

In this section we define formally labeled transition systems both as a transition relation over a set of states and as a coalgebra for a suitable functor, and we stress that they differ for the class of morphisms among transition systems that are allowed. Next, we show that the two presentations can be reconciled by introducing lax cohomomorphisms. These are defined for an arbitrary order-endowed functor, a typical example of which is the (finite) powerset functor Vf equipped with the standard set-inclusion relation.

Definition 2.1 [labeled transition systems] Let L be a fixed set of labels, A (nondeterministic) labeled transition system (over L) is a structure TS = {S, —>ts), where S is a set of states, and —S x L x S is a labeled

transition relation. As usual, we write s -^ts s' for (s,l,s') e—>ts- System TS is finitely-branching if for each s e S, the set {(/, s') \ s -^ts s'} is finite, A transition system morphism f : TS —TS' is a function / : S —S' which "preserves" the transitions, i.e., such that s —.>ts t implies f(s) —.>Ts> f(t). We will denote by TSL the category of finitely-branching labeled transition systems over L and corresponding morphisms.

Notice that a more general definition would allow for transition systems over different sets of labels and, correspondingly, for more general morphisms. Here we stick to a fixed set of labels because this restriction corresponds in a natural way to the definition of systems as coalgebras for a fixed functor, as shown below.

It is well-known that labeled transition systems can be represented as coalgebras for a suitable functor [15], Let us first introduce the standard definition of coalgebras for a functor.

Definition 2.2 [coalgebras] Let B : C C be an endofunctor on a category C. A coalgebra for B or B-coalgebra is a pair (A, a) where A is an object of C and a : A BA is an arrow, A B-cohomomorphism f : (A, a) —(A', a') is an arrow / : A A' of C such that

(1) a'of = Bfoa.

The category of i?-eoalgebras and i?-eohomomorphisms will be denoted i?-Coalg, The underlying functor U : i?-Coalg C maps an object (A, a) to A and an arrow / to itself.

Proposition 2.3 (labeled transition systems as coalgebras) Let PL :

Set —Set be the functor defined as

X Vf(L x X)

where L is a fixed set of labels and Vf denotes the finite powerset functor. Category pL-Coalg is isomorphic to the sub-category o/TSl containing all its

objects, and all the morphisms f : TS —y TS" which also "reflect" transitions, i.e., such that if f(s) —.>ts> t then there is a state E s such that s -^ts s' and f(s') = t.

Proof. For objects, a transition system (S, —y) is mapped to the coalgebra

(S, a) where <r(s) = {(l,s') \ s —y s'}, and, vice versa, a coalgebra (S, a :

S —y Pl(S)) is mapped to the system (S, —y), with s -^y s' if (I, s') E cr(s). For arrows see the considerations below, □

The property of "reflecting behaviors" enjoyed by cohomomorphisms plays a fundamental role, for example, for the characterization of bisimulation relations as spans of cohomomorphisms, for the relevance of final coalgebras, and for various other results of the theory of coalgebras [15]. However in many situations the more general morphisms of Definition 2,1 are needed, like for example in the definition of a compositional proof system for labeled transition systems [20], We propose to generalize the notion of cohomomorphism, in order to accommodate also the more general definition of morphisms in a (lax) coalgebraic framework.

The following observation makes clear the intuition that we follow in the next definitions. Let TS = {s,a) and ts' = (S',a'} be two pL-eoalgebras, and let / : TS ts' be a cohomomorphism. If we split the cohomomorphism condition (1) for / in the conjunction of the two inclusions PL(f)oa C a' o / and a'ofC PL(f)oa, then it is easily shown that the first inclusion expresses "preservation" of transitions, while the second one corresponds to "reflection". Therefore to accommodate plain morphisms as those of Definition 2,1 in this framework, one should replace the equality in (1) with a suitable inclusion. Even if all the examples that we will consider use the powerset functors, the next definitions are slightly more general.

Definition 2.4 [order-endowed functors] An order-endowed (endo)functor over a category C is a pair (B, C) where B : C C is a functor and ¡Zx yC Hornc(X, BY) x Hornc(X, BY) is a family of preorders such that for all / Qx,v 9 X —y BY

(2) / o h Qw,y 9 ° h for each h : W X

(3) Bk o / Qx,z Bk o g for each k : Y —y Z We usually drop the indices of these preorder relations.

As a typical example, the finite powerset functor Vf : Set Set equipped with the partial orders / Cx,y 9 X —y Vf(Y) iff for all x E X, f(x) C g(x) is an order-endowed functor. Quite obviously, to the same functor in general one can associate different preorders: this justifies the fact that the preorder is part of the name of an order-endowed functor. For instance, also {Vf, D), where / Dx,y 9 iff 9 /, and ('Vf, =) are order-endowed functors.

Definition 2.5 [lax cohomomorphisms] Let {B, □) : C —y C be an order-

endowed functor, and let {A, a) and (A', a') be two iJ-eoalgebras, A lax coho-momorphism f : {A, a) —(A', o') is an arrow f : A ^ A' such that

(4) BfoaQa'of.

The category of .B-coalgebras with lax cohomomorphisms is denoted by (B, C )-Coalgia.

The following fact follows directly from Proposition 2,3 and the above considerations.

Proposition 2.6 The categories of transition systems TS^ (as for Definition 2.1) and of coalgebras with lax cohomomorphisms (Pl, C)-Coalgte are isomorphic.

3 Structured Transition Systems as Lax Coalgebras

Following essentially the same outline of the previous section, we show here how to represent structured transition systems, i.e. transition systems with algebraic structure, in a corresponding coalgebraic framework. As indicated in the introduction we will consider systems where the structure is determined by an equational one-sorted algebraic specification T = (£, E). We denote by Alg(T) the category of total T-algebras and -homomorphisms. If h : T —T' is a specification morphism Vh : Alg(T') Alg(T) denotes the associated forgetful functor and Fh : Alg(T) —Alg(T') its left adjoint generating the free T'-algebra over a given T-algebra, In particular Vr : Alg(T) —Set and Fr : Set Alg(T) denote the forgetful and the free functor with the category of sets.

As running example we consider Petri nets and a description of their behavior by structured transition systems. According to [9], the relevant algebraic structure of (transition systems of) Petri nets is that of commutative monoids, presented in the following algebraic specification,

C(ommutative) M(onoid) = sorts monoid opns e : monoid

© : monoid, monoid —monoid eqns for all x, y, z : monoid

(x © y) © 2 = X © (y © z) X © y = y © X e © x = x

It defines the category Alg{CM) of commutative monoids and monoid homomorphisms,3 the forgetful functor VCM : Alg{CM) ^ Set, mapping a monoid M = (M,e,©) to the set VCM(M) = M , and the free functor FCM : Set Alg(CM), that maps a set S to the set of (finite) multisets over

3 The category Alg(CM) is often denoted CMon.

aab a®b®b

iai IpJ a® b a®b®b a

e b ...

Fig. 1. A simple Petri net and its transition system

S, with empty set as unit and sum as monoid operation. In the following we denote by S® the set of multisets over S, i.e. S® = VCM o FCM(S).

Example 3.1 [Petri net transition systems] We consider Place/Transition nets [13] PN = (P,T, pre, post), given by a set P of places, a set T of transitions, and functions pre, post : T —y P®, that define for each transition t E T its pre- and post-conditions. The small net SN = ({o, b}, {t}, {t a © b}, {t i—Y e}) shown in Fig. 1 suffices as example for our purposes.

The structured transition sy

stem LTSCM (PN) of a Petri net PN = (P, T, pre, post) is given as follows. Its monoid of states is the free commutative monoid FCM(P) with carrier the set of markings P®. The labels are given by the free commutative monoid FCM(P U T) over the places P and transitions T of PN. The transition relation contains the elementary steps pre(t) post(t) for each t E T, the idle transitions m m for all m, E P®, and the closure under sums: if rrii ^^ rn'j (i = 1,2) are transitions in LTSCM(PN), then their parallel composition, given by the sum mi © m2 m[ © rn'2 is also in LTSCM(PN). Firing in context is modeled by parallel composition with idle transitions. Hence, the transitions of LTSCM(PN) represent the steps (i.e., parallel firings) of PN. The transition system LTSCM (SN) is sketched in the right of Fig. 1.

In LTSCM(PN) the states and labels are commutative monoids. Since the idle transition e e on the empty marking e E P® is a unit of the transition relation, also the transition relation —y is a commutative monoid, and a subalgebra of P® x T® x P®. Commutative monoids are the relevant algebraic structure of Petri nets, as they deliver the necessary framework to obtain the above construction as a free construction [9].

The example of the Petri net transition system can immediately be generalized to transition systems with arbitrary algebraic structure.

Definition 3.2 [structured transition systems] Let T be an algebraic specification and L be a T-algebra of labels. A structured transition system (over T and L) is a pair ST S = {A, —Ysts) where A is a T-algebra of states and —>stsÇ A x L x A is a labeled transition relation, i.e., a subalgebra of the product A x L x A in Alg(T). For {a, I, b) E—Ysts we write a —ySTs b.

A morphism / : STS STS' of structured transition systems over T and L is a T-homomorphism / : A A' such that a —Ysts b implies that

/(a) —ysts1 f(b). The category of structured transition systems over T and L is denoted TS£,

To carry over the coalgebraic presentation of labeled transition systems to the structured case, we have to look for an appropriate endofunctor on the category of T-algebras, that lifts the functor PL : Set —Set to Alg{T). In Proposition 2,3, PL is defined using products and finite powersets. Since Alg{T) has all products, and they are preserved by the forgetful functor Vr to Set, it remains to lift the finite powerset functor to a power algebra functor on Alg(T), i.e., to define for each algebra A in Alg(T) a T-algebra structure on the powerset Vf{VT(A)) over the carrier of A.

For a simple example, consider first the construction of power monoids, that shall be used in the following to present Petri net transition systems as coalgebras. Given a commutative monoid M = (M. e, ©) its power monoid VfM(M) = (Vf(M), {e}, ©PM) is given by the finite powerset of the carrier of M. the singleton {e} as unit, and the element-wise sum m, ©PM n = {x © y | x e m, y e n}. Each monoid morphism / : M —N is mapped to a monoid morphism VfM(f) = Vf(f) : VfM(M) VfM(N) which makes VfM : Alg(CM) Alg(CM) a functor.

Then, define, for a monoid L of labels, the endofunctor w : Alg{CM) — AlgiCM) by X i—¥ VfM{L x X). Since VCM(L x X) = VCM(L) x VCM(X) and Vf o VCM = VCM o VfM, it follows that

Vf(VCM(L) x VCM(X)) = Vf(VCM(L x X)) = VCM(VfM(L x X)), i.e., on the underlying sets Pvcml and w coincide.

Example 3.3 Consider again the LTS of the small Petri net SN. Taking the successor sets a(rn) = {{t, m!) \ m —> rn'} in order to construct the coalgebra corresponding to a transition system, we see that a (a) = {(a, a)} and a(b) = {(b, 6)}, whereas a (a © b) = {(a © 6, a © 6), (t, e)} which is clearly different from {(o, a)} © {(a, a)}. Thus (FCM(P),a} is not a Pf"M-coalgebra, because a is not a CM-homomorphism. However, a still satisfies the relaxed homomorphism property a (a) © a(b) C a (a © b).

The last observation leads to the definition of lax coalgebras, similar to the definition of lax cohomomorphisms in the preceding section. The following definition of lifting functors and orders establishes the relationship between (order-endowed) endofunctors on algebras and carrier sets.

Definition 3.4 [lifting] Given endofunctors B : C —t C, B' : C' —t C' and a functor V : C' —>■ C, B' is called a lifting of B along V, if V o B' = B o V.

Let (B, C) : C C be an order-endowed functor and B' : C C a lifting of B along V, then B' is order-endowed by via

fQ'g & Vf C Vg : VX VB'Y = BVY.

for all f,g:X B'Y in C.

We call the lifting of □ to B' and (II'. □') a lifting of (B, C) along V.

If Br : Alg(T) Alg(T) is a lifting of an endofunetor B : Set Set along a forgetful functor Vr and B is order-endowed by C, then the lifting of C to BT is the same as □ on T-homomorphisms (which are mappings). Therefore we will use the same symbol □ for both orderings in this case.

Definition 3.5 [lax coalgebra] Let (BT, C) : Alg{T) —Alg{T) be a lifting of an order-endowed endofunetor (B, C) on Set along Vr. A lax T-homomorphism f : A —BTA' is a mapping / : VrA —VrBrA' such that for all op E

(5) opBFA' o fn C / o 0pA

A lax (BT, C)-coalgebra (in Alg(T)) is a pair {A, a), where A is a T-algebra and a : A ^ BTA is a lax T-homomorphism,

A lax cohomomorphism of lax {Br, C)-eoalgebras / : (A, a) {A1, a'} is a T-homomorphism / : A A' such that Br f o a C a' o /, The category of lax (i?r, C)-coalgebras with lax (i?r, C)-cohomomorphisms is denoted {BT, C )-LaxCoalgjx ,

Coming back to the general presentation of T-struetured transition systems as lax coalgebras we still have to lift the functor PL : Set —Set, X Vf(Lx X) to Alg(T) for arbitrary specifications T, As for monoids we first construct power algebras. Since the finite powerset of a set M is a free semilattice, power algebras can be obtained generieallv by the following algebraic specification PA(T), that combines T with a semilattice specification and corresponding distributivity equations,

P(ower) A(lgebra) (r) = sorts p-s

opns all operations of T, and

_L : p-s U : p-s, p-s p-s eqns all equations of T,

for all x,y,z : p-s (x U y) U z = x U (y U z) x U y = y U x 1Ui = 1

xUx = x

and the distributivity equations: for all xi,... ,xn,yi,... ,yn : p-s op(a;i U yi, x2,..., xn) = op(a;i,.

») u op(yi,x2, ...,xn)

op(xi,

.1, xn U yn) = op(a;i,..., xn) U op(a;i,..., xn-U y„)

for all operations op in Hr,

Let s '. r —y PA(T) be the inclusion of specifications (that maps the sole sort

of r to p-s). Then the carrier set of a free algebra FS(A) is the finite powerset Vf{VTA) of the carrier VrA of A, the semi lattice operations are the ones of the free semi lattice over \/rA, i.e., empty set and union. The ^-operations of FS(A) are defined, as for the power monoid, by all possible combinations

opFS(A)(rni,.. ,,m,n) = {opA(xi,... ,xn) | Xi e m,i,i = 1,... ,n}.

Composition of the free functor Fs : Alg(T) —Alg(PA(T)) and the forgetful functor Vs : Alg(PA(V)) —Alg{T) yields the power algebra endo-functor VTt : Alg(r) —Alg{T). Given furthermore a T-algebra L the endo-functor P[ is defined by X Vj(L x X), It is order-endowed by the natural ordering on powersets by inclusion, i.e., ./' C g : A —P[(A') iff for all aeVr(A),f(a)Cg(a).

Example 3.6 The Petri net transition system LTSCM (SN) in Figure 1 is a lax (Pf-M, C)-coalgebra, with L = FCM(T U P). Let M = FCM(P) be the free commutative monoid of places of SN, I'M = P^M(M) the power monoid over L x M, and a : P® Vf((T U P)® x P®), m ^ {{t, m'} \ m m'}. Then

ePM = {(eL,eM)} =<7{eM)

a(an) ©PM a(bk) = 0 C

{(tm © a" © bk-m, a" © bk-m) | 0 < rn < rmn(n, k)} = a(an ©M bk)

Furthermore let DN = ({o, 6}, 0, 0, 0) be the disconnected subnet of SN, and j : DN SN the inclusion. This induces an inclusion of the transition systems i : LTSCM (DN) LTSCM(SN). Both have the same monoid of states, but the only transitions in LTSCM (DN) are the idle transitions. Since i is the identity on markings the lax cohomomorphism property reduces to odn ^ ®sn- Notice that i is a (strictly) lax cohomomorphism, because we have aDN(a © b) = {(a © b, a © b)} and o-Sjv(a © b) = {(a © b, a © b), (t, eM)}.

Proposition 3.7 The categories of lax coalgebras (P[, C)-LaxCoalg|2, and of finitely branching transition systems TS^ are isomorphic.

4 Coalgebras with Algebraic Structure as Bialgebras

In this section we establish the relationship of our presentation of coalgebras over T-algebras to the more abstract categorical setting of [17,19], Thereby, we also prepare the ground for a more abstract presentation of the lax notions introduced in Section 3,

The main categorical tool of [17,19] may be rephrased in our setting as the following proposition.

Proposition 4.1 (lifting adjunctions) Let T be a specification, B : Set — Set be a functor, and BT : Alg(T) ^ Alg(T) be a lifting of B along VT. Then, the forgetful functor Vg : BT-Coalg —B-Coalg defined on objects

and arrows by

(a: A-y BT A) (VTa : 1 1 ,1 ^ VT BT A = BVT A) and f ^ Vr f

has a left adjoint Fg : iJ-Coalg —BT-Coalg where IJT o Fg = Fr o U, denoting by U : iJ-Coalg —Set and Ur : BT-Coalg —y Alg{T) the obvious underlying functors.

Moreover, if U : iJ-Coalg —Set has a right adjoint R : Set —iJ-Coalg this lifts to a right adjoint Rr : Alg(T) —/?' -Coalg for Ur with R o Vr =

Since Rr and Vg are both right adjoints, BT-Coalg inherits a final object Rr(l) from Alg(T) which is then preserved by Vg. Hence, the maximal bisimulation equivalence induced by the final morphism to iir(l) in BT-Coalg is determined by the underlying sets and functions, that is, its definition doesn't use the algebraic structure of states and transitions. Nevertheless, since the final morphisms in BT-Coalg are T-homomorphisms, it follows that the coarsest bisimulation equivalence is in fact a congruence. Now it is quite easy to see that this very general result does not hold, for example, for Petri net transition systems. Consider, for example, the simple net in Figure 1, and assume that we disregard the idle transitions in the observations. Then, both markings a and b would produce empty observations, that is, they are bisimilar (o « b). Clearly, also b « 6, but a © b 96 b © b because from a © b we could observe the transition t. This shows that our example does not fit in this framework and justifies the lax notions that we introduced.

In the rest of this section we prove Proposition 4,1 by presenting the above category BT-Coalg of coalgebras over T-algebras as a category of bialgebras in the sense of [19] and applying the corresponding results of that paper.

First, T-algebras are represented more abstractly as algebras for the monad of the adjunction F H V4 (see, e.g. [8], Section III): Let T = (T,rj,n} be the monad on Set defined by T = VF : Set Set, // : Idset =>■ / the unit of the adjunction, and // = \ (/. : T2 =$> T with e : FY =$> If/.4/,;;n being the counit of the adjunction. In this case we call T the free monad ofV.

A T-algebra is a pair (X, h) of a set X and a mapping h : TX X such that

(6) h o Th = h c // v h o r]x = idx

4 From now on we skip the superscript F.

.Br-Coalg

.B-Coalg

A T-homomorphism / : (X, h) {X', h') is a mapping / : X —X' such that

(7) foh = h'oTf

In particular, the free T-algebra over a set X is (TX, fix}- The category SetT of T-algebras and T-homomorphisms is isomorphic to Alg(T).

Dually, coalgebras for an endofunctor B : Set —Set can be represented as coalgebras for a comonad D = (D, e, 5} provided that the underlying functor U : /i-C'oalg —Set has a right adjoint R : Set —/i-C'oalg: Let in this case the cofree comonad of B be given by D = UR : Set —Set. r : D =$- Idset, and S = i'l/n : I) D2 with r] and e the unit and counit of U H R, respectively.

The coalgebras for this comonad are pairs (X, k : X DX) of a set X and a mapping k such that

(8) Sx ° k = Dk ok ex ° k = idx

and a £>-eohomomorphism / : (X, k) —y {X', k'} is a mapping / : X X' such that

(9) k! o / = k o Df

The cofree D-eoalgebra over X is (DX,ax)■ The category SetD of D-coalgebras is isomorphic to the category i?-Coalg of coalgebras for the endofunctor B (see e.g., [17]),

Bialgebras [19] are algebra-eoalgebra pairs over a common carrier.

Definition 4.2 [A-bialgebras] A distributive law A : TD DT of a monad T = (T,rj,n} over a comonad D = {D,e,a} [19] is a natural transformation such that

(10) Ao r]n = Dr] X o fj,D = Dfj, o Xt °TX

(11) l< = < r ° A DXo Xd °TS = ST ° X

The category A-Bialg of X-bialgebras has as objects pairs TX —> X —> DX of T-algebras and D-eoalgebras with common carrier X satisfying the pentagonal law

(12) koh = DhoXxoTk

which makes h a coalgebra morphism and k an algebra homomorphism. The morphisms / : (X, h, k) —(X', h', k') of A-Bialg are those morphisms / : X X' which are both T-algebra and D-eoalgebra morphisms.

Hence, in order to define a category of bialgebras we have to provide a monad T and a comonad D, specifying respectively the algebraic and coalge-braic structure, and a distributive law relating the two structures. Letting T and D be given as above, it remains to derive the distributive law.

By assumption B o V = V o Br, the endofunctor Br is a lifting of B to the category Alg(T) and thus to the isomorphic category SetT, By [6,17] such liftings are equivalent to distributive laws of T over the endofunctor B, i.e.,

natural transformations 7 : TB BT satisfying

(13) 70 r]B = Br] 7 o (xB = Bfj, o 7T o T7

This is defined by

7.4 = V((Br]A)*) : VF(BA) ^ BVF(A) = VBTF(A)

where (Bt]a)# : F{BA) —BTF(A) is induced by the free construction on iM from

Br]a : BA ^ BVF(A) = VBrF(A)

We can extend 7 to a distributive law A : TD =$> DT of the monad T over the comonad D by letting Ax : TDX —DTX be the unique arrow induced by the universal property of the cofree coalgebra {DTX, ztx) over TX: I X' TV m~X-z'tx-~B(DTX)

Tex A v B Ax

^TDX-Tzx-TB{DX)-1dx-B{TDX)

Using the above isomorphisms of categories Alg(T) ^ SetT and /i-C'oalg = SetD it can be shown that the categories A-Bialg and BT-Coalg are isomorphic. Proposition 4,1 follows then directly from Theorem 7,2 and 7.3 of [19].

5 Lax Coalgebras as Lax Bialgebras

Using the presentation of algebras and coalgebras based on monads and comonads developed in the previous section, we lift to the more abstract setting the lax notions of cohomomorphism and coalgebra of Section 2 and 3, respectively. Thereby we hope to clarify the relation between algebra and coalgebra structure in the more symmetric bialgebra presentation, and to benefit from general proof techniques that exist for these categorical notions.

We first provide a comonad presentation of coalgebras with lax eohomo-morphisms (introduced in Section 2) which extends the well-known isomorphism i?-Coalg = Set£>. This is applied afterwards for representing the category {BT, C)-LaxCoalgix of lax coalgebras in Alg(T) with lax eohomomor-phisms (defined in Section 3) as category of lax bialgebras, thus extending the correspondence developed in the previous section in the strict case,

5.1 Lax Cohomomorphisms

In analogy to lax cohomomorphisms for an (order-endowed) endofunctor (cf. Definition 2,5) we define the lax cohomomorphisms for a comonad:

Definition 5.1 [lax (D, C)-eohomomorphism] Let D = {D,e,a) be a comonad on a category C with order-endowed endofunctor (D, □). A lax

(D, C)-cohomomorphism / : (X, k) —{X', k') is a mapping / : X —X' such that

The category of (D, C)-coalgebras with lax (D, C)-cohomomorphisms is denoted by C{d5c).

In the case of a cofree comonad D for an (order-endowed) endofunctor B, an order-endowment of (the endofunctor of) D may be derived as follows:

Lemma 5.2 Assume an order-endowed endofunctor (B, C) on a category C and let D = (D,e,a) be the cofree comonad of B. Then, (D, QD) is an order-endowed endofunctor with preorder defined by

f QD 9 X —DY iff Bey ° Zy o / C Bey o zy o g : X BY

where DY ^ B(DY) is the structure of the cofree B-coalgebra RY.

The idea is, of course, that with this order-endowment of D the categories (B, C)-Coalgix and C{d,cd) are isomorphic.

Proposition 5.3 Let (B, C) be an order-endowed endofunctor with cofree comonad D. Then, the categories (B, □)-Coalg/a. andC^^D) are isomorphic.

Proof. The mapping (X, k) (X, Bey o zy o k) is the object part of the isomorphism from Cd to i?-Coalg (see e.g. [17]), Then, Proposition 5,3 follows immediately from the definition of QD in Lemma 5,2, □

Thus, in particular (PL, C)-Coalgix is isomorphic to Set(DyCo) with D the cofree comonad over PL and CD derived from C by Lemma 5,2, Hence, altogether, we provided three equivalent representations of finitely branching nondeterministic labeled transition systems: The category TSl of transition systems itself, the category (PL, C)-Coalgix of coalgebras and lax eohomo-morphisms for the endofunctor PL, and the category Set(DyCo) of coalgebras and lax cohomomorphisms for the cofree comonad D over PL.

5.2 Lax Bialgebras with Lax Cohomomorphisms

Like it is done in Section 3 for coalgebras for an endofunctor B, we enrich coalgebras for a comonad D with a lax algebraic structure thus providing a bialgebra presentation of the category (BT, C)-LaxCoalgix,

Definition 5.4 [lax bialgebras with lax cohomomorphisms] Let A : TD DT be a distributive law of a monad T over a comonad D with order-endowed endofunctor (I). C), A lax (A, C)-bialgebra is a pair TX —^ X —^ DX of a T-algebra h and a D-eoalgebra k with common carrier X, satisfying the lax pentagonal law

DfokQk'of

T~~\ 7 A rji 7 i— 7 7

Dh o Ax olKlZkon 14

A lax cohomomorphism f : {X, h, к) —{X', h', k') of (lax) bialgebras is a mor-phisms / : X —X' which is both a T-algebra morphism and a lax D-coalgebra morphism. The category of lax (A, Q)-bialgebras and lax cohomomorphisms is denoted by (A, C)-LaxBialgjx,

Proposition 5.5 Assume a specification Г with free monad T, an order-endowed endofunctor (B, □) on Set with cofree comonad D, and a lifting BT of В to the Г-algebras with corresponding distributive law A. Let QD be the derived preorder of Lemma 5.2. Then, the categories (Вг, C)-LaxCoalg^ and (A, C£))-LaxBialg|2, are isomorphic.

Proof (Sketch) Let 7 : ТВ =>■ ВТ be the distributive law of the monad T over the endofunctor В that was used in Section 4 to derive A : TD =Ф-DT, and define as intermediate step the category (7, C)-LaxBialg|x of lax 7-bialgebras by replacing D with В, A with 7, and QD with С in Definition 5,4, Using Proposition 5,3 and the construction of A in Section 4 it can be shown that this category is isomorphic to (А, С' ')-LaxBialg|x.

A lax T-homomorphism f : (X,h) ->• BT(X',h') = {BX',Bti о yx,) is a mapping / : X —X' such that ВЫ о jx, о Tf С / о h. Since TX is a construction of (equivalence classes of) terms over X, one can show inductively that this is equivalent to f \ A BTA' being a lax Г-homomorphism (cf. Definition 3,5), where A,BTA' are the corresponding Г-algebras of (X, h), BT{X', h'). Using this fact, (7, C)-LaxBialgix is shown to be isomorphic to {Br, C)-LaxCoalgix, On objects this amounts to observe that (X, k,h) is a lax 7-bialgebra (that is Bh о jx о Tk С к о h) iff к : (X, h) —t {BX, Bh о уx) is a lax T-homomorphism which in turn is equivalent to the lax Г-homomorphism к : A —t BT(A). The morphisms of (7, C)-LaxBialgjx and (Hv. С) - Lax Coalg | x are related by the isomorphism SetT = Alg(T), and their lax cohomomorphism properties are expressed by the same preorder С in the common underlying category Set, □

Like for labeled transition systems, this provides us with three equivalent presentations of structured transition systems with Г-algebra structure: The category of structured transition systems TS^ of Definition 3,2, the category (P[, C)-LaxCoalgix of lax coalgebras with lax cohomomorphisms for the endofunctor P[ (cf. Definition 3,5), and the corresponding category (А, С'')-LaxBialg|x of lax bialgebras with D cofree over PL and A as derived in Section 4,

6 Conclusion

This paper relates transition systems and coalgebras, both in their plain and structured versions, with the motivation of comparing and combining their complementary contributions to the theory of concurrent systems. In the unstructured case, the enrichment of the coalgebraic framework by lax cohomomorphisms extends the well-known correspondence of labeled transition

systems and eoalgebras from objects to morphisms. This leads to the isomorphism of categories TS/. = {/'/.• C)-Coalg|x.

It turns out that, enriching transition systems and eoalgebras with T-algebra structure, this isomorphism is lost, since due to the different representation of nondeterminism in both frameworks, also the compatibility conditions imposed by the algebra structure on the transitions of the systems are different. This leads to the introduction of lax eoalgebras, where the coalgebra structure is given by a lax T-homomorphism, and to the corresponding category {P[, C)-LaxCoalgjx which now is isomorphic to the category TS^ of T-structured transition systems. Hence this category may be used as an interface between eoalgebras and structured transition systems.

Below we discuss two further points that are of relevance for our general aim but beyond the scope of the present paper.

6.1 On two Notions of (Structured) Transition Systems

As mentioned in the introduction, there are two natural notions of transition system corresponding to two different notions of graph: The one used in this paper is based on simple edge-labeled graphs, that is, with transition relation as subset of the product SxLxS (cf. Definition 3,2), Its relation to eoalgebras is given by regarding labels as observations and encoding the transition relation as a mapping into a power set. We will refer to this notion as simple graph version of (structured) transition systems.

Instead, the notion of structured transition systems in [4] is based on multi graphs {V, E, s,t : E —V) where transitions form a set E (i.e., they have no label but an identity) and two mappings s, t give the corresponding source and target state. The relation of such multi graph (structured) transition systems with eoalgebras is less obvious. However, as stressed in the introduction, this framework accommodates a free construction of structured transition systems from heterogeneous graphs (representing programs) that does not always exist in the "simple" framework since in general free constructions do not preserve subobjects.

Hence, a question of interest that we didn't discuss so far is the relation of the simple graph and the multi graph notion of (structured) transition systems. In fact, every edge-labeled simple graph can be seen as multi graph by defining the source and target functions by the first and third projection, i.e.,

(16) {S,L,—y) ^ (s,—y,7Ti,7T3) Vice verse, we may regard the identity of an edge as a label

(17) (V,E,s,t)^(V,E,^)

with s(e) -^-y t(e) for all e E E. Notice that, unlike in Definition 2,1, in the simple graphs above we explicitly include the collection of labels L as a second component. In fact, in order to extend mapping (17) from objects to

morphisms we have to move to a more general category of simple transition systems TSr where the set of labels is not fixed and morphisms are pairs (fs, fi) of mappings for states and labels with the obvious preservation of transitions. Then, it can be shown that the functor defined by (16) has a left adjoint given by (17),

Generalizing this adjunction to structured transition systems these functors can be used in the comparison of the two frameworks. For example, the free construction of structured transition systems from programs developed in the multi graph framework in [4] can be extended to the category of simple structured transition systems TSr by composing it with the left adjoint (17), In order to pass to the coalgebraic framework via the isomorphism TS£ = (P[, C)-LaxCoalgjx we could restrict again to transition systems over a fixed set of labels L. It seems more natural, however, to generalize instead the category (P[, C)-LaxCoalgix, In fact, the categories of lax (P[, C)-eoalgebras for a generic L form a (covariant) indexed category over the category of (label) algebras Alg(T), whose flattening corresponds to the more general category of transition systems TSr,

6.2 Bisimulation, Congruence, and Bialgehras

Another interesting question is the general relationship of bisimulation and congruence for structured transition systems. For transition systems of Petri nets it has been observed in Section 4 that Observational Equivalence, the maximal bisimulation [10], is not a congruence w.r.t, the monoidal structure. Accepting this, on could ask if Observational Congruence, the coarsest congruence contained in Observational Equivalence, is still a bisimulation. This is not the case, for example, for CCS weak bisimulation, and this motivated the notion of dynamic bisimulation (which is both bisimulation and congruence) in [11], When Observational Congruence is interpreted as the compositional part of Observational Equivalence, then being still a bisimulation means that this eompositionalitv is preserved by the transitions of the system.

One can show for Petri nets that Observational Congruence is a bisimulation, The argument is based on the fact that transitions are closed under

context, that is, if m —> m! is a transition of a net and c is a marking, then

there is also a transition m © c —> m' © c. Since the same is true for general structured transition systems, one may expect a corresponding result for any algebraic structure T,

The notions of congruence and bisimulation are directly related to the properties of (strict) homomorphisms and cohomomorphisms. E.g., congruences are exactly those equivalences that are induced by homomorphisms, and a dual fact holds for bisimulations. Hence, relaxing the homomorphism and cohomomorphism properties we obtain a categorical framework where we can discuss questions like the one above whether Observational Congruence is a bisimulation.

We employ the concept of bialgebras in order to explain this idea since, in our view, their definition of morphisms provides the most explicit representation of the homomorphism and cohomomorphism properties (by means of the commutativitv of the respective subdiagrams (1) and (2) below),

TX—h—-k—-DX

Tf (1) / (2) Df

TX'—h!—'X'-k'—DX'

According to the above intuition, the strict framework of [19] where both diagrams commute characterizes the notion of dynamic bisimulation [11], A framework where to represent e.g., congruences that are not bisimulations (like CCS Observational Congruence) is obtained by weakening the commutativitv (2) so that / : (X, k) —(X', k') becomes a lax cohomomorphism (cf. Definition 5,1),

In order to describe bisimulations that are not necessarily congruences (like CCS weak bisimulation) we have to relax on the algebraic side instead. However, it doesn't make sense to require the lax commutativitv of (1) above, since the ordering C we use is only given for arrows of type X —DY. A way out is to replace the commutativitv of (1) by a lax commutativitv of the outer diagram, that is,

(18) k'oh'oTf C Dfo koh

Denote by (A, C)-LaxBialg'x the category having lax (A, C)-bialgebras as objects and as arrows / : (X, h, k) —(X', h', k') arrows / : X —X' which are strict D-eoalgebra morphism and satisfy (18),

The resulting framework is again "strictly coalgebraic", that is, forgetting the algebraic structure we obtain coalgebras and (strict) cohomomorphisms for the comonad D. The relaxed homomorphism property on morphisms allows us to recover the final bialgebras of A-Bialg as final objects in (A, C)-LaxBialg'x. as shown in the following proposition.

Proposition 6.1 IfC has a final object 1, then (A, C) LaxBialg'' has a final object given by TD1 DTI D1 D21 with carrier D1.

Proof (Sketch) The final morphism from a lax bialgebra (X, h, k) is given by Dlx ° k where lx '■ X —1 is the unique final morphism in C. Uniqueness of Dlx ° k follows from its uniqueness as D-eoalgebra morphism, and the lax homomorphism property from the lax bialgebra property of (X, h, k), the D-eoalgebra law for k and some naturalitv conditions, □

The final bialgebra of (A, C)-LaxBialg'x is mapped to the final D-coalgebra by disregarding its algebraic structure. Thus, if D is the cofree comonad of an endofunctor P[, the unique final morphisms in (A, C

)-LaxBialg'x characterize maximal bisimulations on structured transition systems in TS^, In contrast to the strict framework [19], this does not imply that such bisimulations are congruences since morphisms of (A, C)-LaxBialg'x are only lax T-homomorphisms,

References

[1] P. Aczel. Non-Well-Founded Sets. CSLI Lecture Notes 14, Stanford, 1988.

[2] A. Corradini and A. Asperti. A categorical model for logic programs: Indexed monoidal categories. In Proceedings REX Workshop, Beekbergen, The Netherlands, June 1992, volume 666 of LNCS. Springer Verlag, 1993.

[3] A. Corradini and F. Gadducci. A 2-categorical presentation of term graph rewriting. In Proceedings CTCS'97, volume 1290 of LNCS. Springer Verlag, 1997.

[4] A. Corradini and U. Montanari. An algebraic semantics for structured transition systems and its application to logic programs. Theoret. Comput. Sci., 103:51-106, 1992.

[5] F. Gadducci and R. Heckel. An inductive view of graph transformation. In F. Parisi-Presicce, editor, Proc. of WADT'97, LNCS. Springer-Verlag, 1998. To appear.

[6] P.T. Johnstone. Adjoint lifting theorems for categories of algebras. Bull. London Math. Soc., 7:294-297, 1975.

[7] R. Keller. Formal verifications of parallel programs. Communications of the ACM, 7:371-384, 1976.

[8] S. Mac Lane. Categories for the Working Mathematician, volume 5 of Graduate Texts in Mathematics. Springer, New York, 1971.

[9] J. Meseguer and U. Montanari. Petri nets are monoids. Information and Computation, 88:105-155, 1990.

[10] R. Milner. A Calculus of Communicating Systems, volume 92 of LNCS. Springer Verlag, 1980.

[11] U Montanari and V. Sassone. Dynamic congruence vs. progressing bisimulation for CCS. Fundamenta Informaticae, XVI: 171 199. 1992.

[12] G. Plotkin. A structural approach to operational semantics. Technical Report DAIMI I X-19. Aarhus University, Computer Science Department, 1981.

[13] W. Reisig. Petri Nets: An Introduction. EACTS Monographs on Theoretical Computer Science. Springer Verlag, 1985.

[14] J.J.M.M. Rutten. Processes as terms: non-well-founded models for bisimulation. Mathematical Structures in Computer Science, 2:257-275, 1992.

[15] J. J.M.M. Rutten. Universal coalgebra: a theory of systems. Technical Report CS-R9652, CWI, 1996.

[16] J. J.M.M. Rutten and D. Turi. Initial algebra and final co-algebra semantics for concurrency. In J.W. de Bakker, W.-P. de Roever, and G. Rozenberg, editors, Proceedings of the REX School/Symposium A decade of concurrency', volume 803 of LNCS. Springer Verlag, 1994.

[17] D. Turi. Functorial Operational Semantics and its Denotational Dual. PhD thesis, Free University, Amsterdam, 1996.

[18] D. Turi and B. Jacobs. On final semantics for applicative and non-deterministic languages. In Proceedings 5th Biennial Meeting on Category Theory in Computer Science, 1993.

[19] D. Turi and G. Plotkin. Towards a mathematical operational semantics. In Proc. of LICS'97, pages 280-305, 1997.

[20] G. Winskel. A compositional proof system on a category of labelled transition systems. Information and Computation, 87:2-57, 1990.