Electronic Notes in Theoretical Computer Science 65 No. 1 (2002) URL: http://www.elsevier.nl/locate/entcs/volume65.html 21 pages

Well-behaved Translations between Structural Operational Semantics

Hiroshi Watanabe1,2

Information Technology Research Institute National Institute of Advanced Industrial Science and Technology (AIST) AIST Kansai, Amagasaki 661-0974, Japan.

Abstract

We examine two versions of maps between distributive laws as candidates for well-behaved translations between structural operational semantics, and validate that by using simple coalgebraic arguments. We give some concrete examples of well-behaved translations that are maps between distributive laws. The modelling of structural operational semantics uses Turi and Plotkin's categorical models of GSOS. These maps between distributive laws come from the previous work on 2-categories of distributive laws.

1 Introduction

Structural Operational Semantics [8] is a fundamental tool to provide operational semantics which describes formally the behaviour of programs, that is indispensable for designing languages and verification of programs. The structural operational semantics is given by collection of operational rules, which inductively generate state transition systems describing the behaviour of programs. For the semantics to be well-behaved, one requires the property that bisimulation equivalence is a congruence. In the field of process algebras, there are various rule formats (see [1]) specifying rules, that guarantee the bisimulation equivalence is a congruence. GSOS rules are one of the most well known rule format in them.

As an abstraction of the GSOS format, a categorical format is introduced by Turi and Plotkin [12,13]. This consists of a natural transformation of type

E(Id x B) BT (1)

1 The author gratefully acknowledges the support of British Council. Research carried out within a project supported by EPSRC grant R34723.

2 Email: hirowataQni.aist.go.jp

©2002 Published by Elsevier Science B. V.

on some cartesian category C, where £ is an endofunctor which models the signature, T the monad freely generated by £, and B the behaviour endofunctor modelling the type of behaviour, GSOS rules can be modelled by a natural transformation of type (1), This, in turn, implies a distributive law of the monad T over the comonad D cofreelv generated by B. The distributive law automatically provides well-behaved operational semantics which respects both syntax and semantics [12]. The categorical format (1) is general and flexible as you can see in the recent extension for name and value passing calculus [3] and for probabilistic systems [2].

In Turi and Plotkin's work, the distributive laws play an important role in giving the well-behaved semantics. To give systematic treatment of those distributive laws, a 2-eategorieal framework was investigated by Power and Watanabe [9,10]. Lenisa et al. applied the framework to distributive laws of more weakened structures such as pointed or co-pointed endofunctors, or endofunctors [7], and showed the equivalence between natural transformation of type (1) and the distributive laws of a monad over a co-pointed endofunctor. Hence we can model any categorical rules of type (1) by a distributive law of a monad over a co-pointed endofunctor.

In 2-eategories of distributive laws [9,10,7], each distributive law is a 0-eell, the building block of the 2-eategory, Higher structures, the 1-eells which give the maps between distributive laws, and the 2-eells the maps between the 1-cells, were defined simultaneously. But any concrete examples were not given.

In this note, we examine two versions of map between distributive laws of a monad over a co-pointed endofunctors as candidates for translations between two structural operational semantics, and validate that. We show some concrete examples of well-behaved translations of operational semantics which are maps. These examples are classified as follows:

• Operational Conservative Extensions (Section 4)

Operational conservative extensions are maps between distributive laws.

• Translations between two operational semantics of languages (Section 5 ) Given two languages with operational rules respectively, we show a map between distributive laws which are modelling their operational rules.

• Compatibility of two operational semantics for one language (Section 6) The maps between distributive laws assures the compatibility between trace equivalence semantics and bisimulation equivalence semantics.

More examples of maps between distributive laws will be found in [14].

This paper is separated into two parts. The first half recalls the technical material of map between distributive laws and the second half shows examples.

Section 2 introduces the notion of distributive laws of a monad over a co-pointed endofunctor, and we recall the equivalence result of abstract operational rules given by a natural transformation of type (1) and a distributive law of the monad T over the co-pointed endofunctor Id x B in [7]. Section

3 recalls two version of maps between distributive laws, and shows that the maps between distributive laws give well-behaved translations of operational semantics. We show that the map implies the translation between induced models describing the behaviour of programs.

The Examples start from Section 4, The first one is an abstract example of operational conservative extension. The terminology operational conservative extension is from [1].

Section 5 is an example in process algebra. The translation from a language with parallel operator to that with left merge and choice operator is a map between distributive laws.

In Section 6, We show a map between the distributive law modelling abstract operational rules, given in [13], for trace equivalence semantics, and the distributive law for usual bisimulation equivalence semantics. We give some technical Lemmas in Appendix,

2 Abstract operational rules and distributive laws

We recall the fact that the Turi and Plotkin's abstract models (1) of GSOS are equivalent to distributive laws of a monad over a co-pointed endofunctor

2.1 Categorical rules

Structural operational semantics [8] of language is given by collection of operational rules, which inductively generates state transition systems describing the behaviour of the programs. We use the categorical rules, the natural transformation of type (1), as abstract models of structural operational rules, Turi and Plotkin investigated the categorical rule format [12] as a generalization of GSOS (see [1]), and Turi and Fiore illustrated in [13,3] that various concrete structural operational rules are modelled by the categorical format (1),

Concrete examples of categorical rules will also be found in Sections 5,1,

5.2 and 6,1,

2.2 Co-pointed endofunctor, Distributive law We give some preliminaries.

Definition 2.1 A co-pointed endofunctor (H,e) on category C consists of an endofunctor H : C —► C with a natural transformation : : II ==> Id.

Example 2.2 When the category C has binary products, the endofunctor Id x B for any B : C —► C with projection prx : Id x B => Id is a co-pointed endofunctor (cf, [7]),

Definition 2.3 A category (H, e)-coalg of coalgebra for co-pointed endofunctor (H, e) is defined as follows:

• Each object is a (H, e)-coalgebra which is a iï-coalgebra (X, k : X HX) satisfying ex ok = idv•

• Arrows are morphisms of iï-eoalgebras.

The following is a well-known observation.

Proposition 2.4 (Part of Proposition 5.1 [7]) Let C be a category with binary products, and B an endofunctor on it. Then the isomorphism (Id x B, pr1)-coalg = B-coalg holds.

Definition 2.5 Given a monad (T, p, rj) and a co-pointed endofunctor (H, e) on a category C, a distributive law of monad T over co-pointed endofunctor H is a natural transformation À : TH HT which satisfies the three conditions À • fiH = H fi • XT ■ TA, À • rjH = Hrj and eT • A = Te.

2.3 Equivalence of categorical rule formats and Distributive laws

We recall the equivalence result in [7].

Assume £ be an endofunctor on category C which freely generates a monad T, B an endofunctor on C and (H,e) a co-pointed endofunctor C.

Definition 2.6 We say a natural transformation g : Eiï =>■ HT respects the structure of co-pointed endofunctor (H, e) if the following diagram commutes:

EH=^HT

where 9 is the unit exhibiting T as the free monad on the endofunctor E,

Proposition 2.7 ([7] Proposition 5.2) Suppose the category C has products. Giving a natural transformation of type p : £(Id x B) BT is equivalent to give a natural transformation g : £(Id x B) (Id x B)T respecting the structure of co-pointed endofunctor (Id x i^prj.

Proof. For each natural transformation g : £(Id x B) (Id x B)T, since the codomain is product form, it consists of two natural transformations £(Id x B) T and £(Id x B) BT. If g respects the structure of co-pointed endofunctor (Id x prt), the first component must be

E(Id x

Hence the result follows, □

Proposition 2.8 ([7] Proposition 5.3) Giving a natural transformation g : Eiï HT which respects the structure of co-pointed endofunctor (H, e) is equivalent to a distributive law of a monad T over a co-pointed endofunctor (H,e).

Outline of Proof For given a natural transformation q, we can show that the eo-pointed endofunetor (H, e) lifts to a eo-pointed endofunetor on T-Alg. Using the argument of adjoint lifting by Johnstone [5] (or see [10,7]), we have a distributive law A : TH HT of a monad over a eo-pointed endofunetor.

Conversely, for given a distributive law A : TH HT, we have a natural transformation of type q by taking composition of A and 6H : T,H TH, where 9 : £ =>■ T is the unit exhibiting T as the free monad on the endofunetor E.

Justification of bijeetive correspondence is given by using the structural recursion (Proposition 6,3), where the component Ax : THX —► HTX is characterised as a unique arrow which commutes the following two diagrams:

IIX ^THX^T2HX^TjTHX

HTX^ HT'X VHTX.

From Propositions 2,7 and 2,8, we conclude:

Theorem 2.9 ([7] Theorem 5-4) Giving a natural transformation of type £(Id x B) BT is equivalent to a distributive law A : T(Id x B) (Id x B)T of the monad (T,/x,i]) over the co-pointed endofunetor (Id x i^pi^).

Since the categorical rule format of Turi and Plotkin [12] are given by natural transformations of type E(Id x B) BT, the distributive laws of a monad over a co-pointed endofunetor provides another representations of categorical rule format by Theorem 2,9,

2-4 Induced Operational model

The distributive laws of a monad over a co-pointed endofunetor induce eoal-gebras which describe the behaviour of the programs.

Proposition 2.10 (see Proposition 3-4 in [7]) Any distributive law A : TH => HT of the monad T over the co-pointed endofunetor (H, e) implies a lifting monad T\ on (H,e)-coalg, which sends each (H,e)-coalgebra k : X HX to XxoTk: TX HTX.

Remark 2.11 Since the unit of monad also lift on (H, e)-coalg, for any (H, e)-coalgebra k : X —► HX, the (H, e)-coalgebra Txk = Xx ° Tk is a conservative extension [12] of k, i.e., the component rjx of the unit is a map of (H,e)-coalgebras from k : X IIX to Txk : TX ^ HTX.

Remark 2.12 If we apply Theorem 2,10 to a distributive law A : T(ldxB) (Id x B)T which models some language with operational rules, we have an induced monad T\ on (Id x B, pr1)-coalg. Since (Id x B, pr1)-coalg = B-coalg

holds by Proposition 2,4, the monad T\ is equivalent to a monad on B-coalg which is the operational monad in [12,13], The operational monad sends each .B-eoalgebra k : X —► BX to TX —► BTX which is induced operational model with premise k generated by the given operational rules. In other words, the i?-eoalgebra TX —► BTX is the state transition system generated by the operational rules with premise k. In particular, the image of initial B-coalgebra under the operational monad becomes intended operational model which describes the behaviour of closed terms,

3 Maps between Distributive Laws

In the work [7], we introduced three versions of map between distributive laws of a monad over a co-pointed endofunctor. Here we recall two versions out of the three as candidates for well-behaved translations between structural operational semantics.

We leave the notations Mnd(copEndo(Cai)) and Mnd*(copEndo(Cai)) given in [7] in order to distinguish and tidy up the things. For details about 2-eategorv and 2-eategorieal framework for distributive laws, refer [6,7,9,10],

3.1 A wiap between distributive laws

Let A : TH => HT be a distributive law of a monad (T, p, rj) over a co-pointed endofunctor (H,e) on a category C, and A' : T'H' H'T' be a distributive law of a monad (T", //, rf) over a co-pointed endofunctor (H', e') on C'.

Definition 3.1 (in [7]) A map (F,t,h) of distributive laws from A to A' in Mnd*(copEndo(Cai)) consists of a functor F : C —► C', together with a natural transformation t : FT T'F subject to the monad laws t • Frj = rj'F and t • Fp = ¡jl'F • T't • tT, together with a natural transformation h : FH H'F subject to a law of co-pointed endofunctors e'F • h = Fe, all subject to one coherence condition given by a hexagon:

I I II I 'll !

I 'll'l- ^f - H'l 'F.

Any distributive law A : TH => HT of a monad over a co-pointed endofunctor lift the monad T to a monad T\ on (H, e)-coalg by Proposition 2,10, Similarly, any natural transformation h : FH H'F subject to laws of co-pointed endofunctor lifts the endofunctor F to Fh : (H,e)-coalg —► (H',e')-coalg. These are easy and direct consequences of maps between distributive laws,

which express well-behaved translations between structural operational semantics:

Theorem 3.2 Any map (F : C - C'.l : II T'F, h : 111 //'/•') of distributive laws from A : TH => HT to A' : T'H' => H'T' in Mnd*(copEndo(Cat)) implies the following lifting natural transformation t of t : FT =>■ T'F on coalgebras for co-pointed endofunctors, which subject to laws of 'monads T\ and T' ■

(H, e) -coalg —^ (H', e') -coa Ig

(H, e)-coalg—^(H', e')-coalg.

Outline of Proof The X component I \ : FTX —► T'FX of I gives a mor-phism of (H', e')-coalgebras from FhT\k to T'x>Fhk for each (H, e)-coalgebra k : X —► HX since the following diagrams commute:

FTX FT HX FHTX H'FIX

rj^-jf j^p J J ' ^ f j fj^-j f 1 i"I I"

H'T' FX,

The left hand side follows from the naturalitv of t. The right hand side is the X component of the coherence diagram in the Definition 3,1, So we define t : FhT\ => T'x>Fh by tk = tx for k:X^HX. □

3.2 Maps and Well-behaved Translations

If we have a map between distributive laws that model some abstract operational rules (1), Theorem 3,2 states that the map is a well-behaved translation of structural operational semantics.

Let A : T(Id x B) =i> (Id x B)T on category C and A' : T'(Id x B') => (Id x B')T' on category C be distributive laws of a monad over a co-pointed endofunctor that model some operational rules respectively (Theorem 2,9, Suppose we have a map (/•' : C — C'.l : II ==■ T'F, h : F( Id x If) (Id x B')F) from A to A' in Mnd*(copEndo(Cat)). Then the Theorem 3.2 implies the following lifted natural transformation t of t:

(Id x B,

prj-coalg —^(Id x B'

pr'J-coalg

(Id x BjprJ-coalg—^(Id x B', pr'J-coalg.

This diagram states the well-behaved translation of structural operational semantics, in the following sense:

• Both T\ and T'\> are equivalent to operational monads (see Remark 2,12), So they produce induced models describing the behaviour of programs, which are generated by operational rules for A and A' respectively,

• The endofunctor Fh : (Id x B)-coalg —► (Id x B')-coalg, which is equivalent to an endofunctor from B-c oalg to B'-c oalg, changes the behaviour type of coalgebras from B to B'.

• The component of natural transformation t : FT T'F, providing a translation of programs from T to T', becomes a morphism of coalgebras from induced model of A to that of A', So the translation t preserves the behaviour of programs in coalgebraic sense.

Moreover

Remark 3.3 Any span of (Id x B, pr1)-coalgebra morphisms on Txk : TX —► TX x BTX for any k : X X x BX, is extended to a span of (Id x B', pr'J-coalgebra morphisms on T'x,Fhk : T'FX T'FX x B'T'FX by the translation tx ■ FTX T'FX. This only holds for maps in MncT(copEndo(Cat)).

Example 3.4 When the case C = C = Set, B = B' = Vf(A x _) : Set —► Set

and h is given by identity natural transformation on the co-pointed endofunctor (Id x B, prx), the diagram (2) implies that the component tx '■ TX —► T'X of the natural transformation t is a functional bisimulation from coalgebra Txk to T\'k for any (Id x i?)-eoalgebra k : X —► X x BX. Hence the program p E TX and its image tx{p) E T'X are bisimilar for any program p E TX.

Remark 3.5 When both endofunctor B and IV cofreelv generates comonad D and D' respectively, since (IdxB, pr1)-coalg = D-Coalg and (Idxi?', pr'1)-coalg = D'-Coalg hold for categories of Eilenberg-Moore coalgebras for comonads, the diagram (2) turns out to be a lifting diagram on categories of coalgebras for comonads, which is equivalent to a map between distributive laws of a monad over a comonad, i.e., a 1-eell of Mnd*(Cmd(Cai)) in [9,10],

3.3 The other version of map

By reversing the direction of the natural transformation t in Definition 3,1, we have the other version of map.

Definition 3.6 (in [7]) A map (F,t,h) of distributive laws from A to X' in Mnd(copEndo(Cai)) consists of a functor F : C —► C', together with a natural transformation t : T'F => FT subject to the monad laws, together with a natural transformation h : FH H'F subject to laws of co-pointed endo-

functors, all subject to one coherence condition given by a hexagon:

1111=^111 r

I'll'F^fll'I'F

We have the following for this version:

Theorem 3.7 The map (F : C - C'.l : T'F ==■ II. h : 111 //'/•') of distributive laws from A : TH => HT to X' : T'H' => H'T' in Mnd(copEndo(Cat)) implies the following lifting natural transformation t of t : T'F => FT on coalgebras for co-pointed endofunctors, which subject to laws of 'monads T\ and T'

(H, e)-coalg—^(H', e')-coalg

(H, e)-coalg—^(H', e')-coalg

For a similar reason to section 3,2, the map of distributive laws from A to A' in Mnd(copEndo(Cai)) is also a well-behaved translation of structural operational semantics by Theorem 3,7, But this time, the direction of natural transformation t is from T'F to FT, so it becomes a morphism of coalgebras from induced model of A' to that of A,

3-4 Technical Lemmas

We start giving some examples of well-behaved translations which are maps between distributive laws from next section. But it is usually difficult to check the eommutativity of the hexagons (in Definition 3,1 and 3,6) directly for distributive laws which are induced from abstract operational rules. So we give some technical Lemmas 6,6, 6,7, 6,8 and 6,9 for natural transformations of type Eii HT to imply maps between distributive laws.

4 Operational Conservative Extension

We show an abstract example about an operational conservative extensions. Suppose we are given a language with operational rules, which specify the behaviour of the programs. We often add new operators and operational rules to the original language, and have an extended language with extended operational rules. In this situation, we say the extension is operational conservative [1], if for any program which belongs to the original language (and also to the extended), the behaviour of the program induced from original rules and the one induced from extended rules are same.

Generally, we expect the extension to be operational conservative if the extended rules respect the original rules. In our framework, this circumstance is modelled like this:

Given a language with operational rules, we can model them as a categorical rules p : S(Id x B) =>■ BT. The signature of extended language with new operators, is modelled by an endofunctor £' = £ + £+, where £+ corresponds to added new operators. There is a canonical natural transformation a : £ =>■ whose each component is given by inclusion, and a natural transformation t : T => T' implied from 9' • a : £ T' by Lemma 6,4, representing the extension of the language.

Suppose we can also model the extended language with extended operational rules by a categorical rules p' : £'(Id x B) BT' with same behaviour endofunctor B as previous p.

Proposition 4.1 Under the above condition. If the extended rules p' satisfies the following diagram, then (Id, t, id^x^) is a map of distributive laws of a monad over a co-pointed endofunctor from A modelling p, to A' modelling p' in Mnd*(copEndo(Cai)). Especially, the extension is operational conservative in the sense of [1].

E(Id x B) =^=> BT

a(ldxB)

E'(Id x B)=^BT'

Outline of Proof We apply the Lemma 6,7 to have the map between distributive laws. Especially, the component of natural transformation t for initial coalgebra 0 gives a morphism of coalgebras from intended operational model of original language to that of extended language. Hence the extension is operational conservative, □

We conclude that the maps between the distributive laws capture the operational conservative extensions.

5 Translation of Parallel into Left merge and Choice

The following equation between parallel operator and left merge and choice operator is often used as an axiom in equational reasoning:

hlh^hlh + tilh

In this section, we consider the left to right translation on above equation, and show this take part in a map of distributive laws between two languages below.

5.1 Language 1

Consider the language consisting of a constant symbol '0', a set of unary action prefixing operators indexed by a finite set Act of actions ranged over by a, and a binary parallel composition operator i.e., the language with following grammar:

t ::= 0 | a.t \ t\t, and the collection of operational rules given as follows:

a , o-i

X —► X V —► V . ,

a.x —► x x\y —► x'\y x\y —► y'\x. 5.1.1 Categorical rules for Language 1

The syntax of the language above is modelled by an endofunctor E : Set —► Set defined by

EX = 1 + Act ■ X + X x X, where Act • X is Act copower of set X, i.e., \Act\ coproducts of the set X. Then the endofunctor E freely generates a monad T. In order to model the nondeterministic behaviour of the program, we adopt the endofunctor B : Set —► Set defined by

BX = Vf{Act x X), the finite power set of Act x X.

Let the natural transformation p : E(Id x B) BT be a categorical rules modelling the operational rules above. The component px ■ E(X x BX) —► BTX for set X is given by its components

(X x BXflHy(T) —► BTX (4)

for each operator r. Each component for operator r is defined as follows:

0 * ^ 0 (5) a. (x, a) {(a, x)} (6)

1 {{x,a),(y,p))^{(a,x'\y)\(a,x')ea}u{(a,y'\x)\(a,y')ep} (7)

5.2 Language 2

Next consider a similar language as previous, which is given by adding two new binary operators, the left merge operator '[' and the choice operator '+', but getting rid of the parallel operator, i.e., the language with following grammar:

t ::= 0 | a.t | t[t \ t +1.

The operational rules for new operators are given as follows:

a, , o-i o, i

X —► X X —► x y —► y ^

X [y (x' Ly) + (y\x') X + y A x' X + y A y'.

5.2.1 Categorical rules for Language 2

The categorical rules for this language is given as follows: The syntax of the language is modelled by an endofunctor £' : Set —► Set defined by

YlX = 1 + Act-X+XxX+Xx X,

which freely generates a monad T on Set, We also adopt same behaviour functor B as previous.

Let p' : £'(Id x B) BT' be a categorical rules. The component p'x : T,'(X x BX) —► BT'X for set X is given by its components (4) for each operator r. The components for constant symbol and action prefixing operators are same as previous (5) and (6), The components (4) for new operators are given as follows:

L {(a,(x'[y) + (y[x')) | {a,x')ea}

+ ((x,a),(y,/3))^a U/3.

5.3 Translation

Both categorical rules p and p' imply distributive laws A and A' of a monad over a co-pointed endofunctor respectively by Proposition 2,8, We now show that there is a map of distributive laws between them.

Let a : £ =>■ V be a natural transformation whose component EX(= 1 + Act ■ X + X x X) T'X for a set X is defined by

x i—> a.x for a(e Act) component of Act • X (x,y) ^ (x[y) + (y[x).

Then the natural transformation a implies a natural transformation t : T => T' subject to laws of monads by Lemma 6,4,

Let q : £(Id x B) (Id x B)T be a natural transformation obtained from the rules p by Proposition 2,7, and A' : T"(Id x B) (Id x B)T' a distributive law obtained from p' : £'(Id x B) BT' by Proposition 2,9, We claim:

Proposition 5.1 The following diagram commutes for g and A':

£(Id x Id x B)T

<j(IdxB)

(IdxB)t

T'(Id x S)—Id x B)T'.

And this implies a map (Id : Set —► Set. I : T => T',klldxB) : A —^ A' of distributive laws in Mnd*(copEndo(Cai)).

Proof. The commutativity of the diagram follows from easy calculation. By applying the Proposition 6,6, the result follows, □

Hence this gives a well-behaved translation of operational semantics between languages 2 and 3, The argument of Section 3,2 assures that transformation t preserves the behaviour of programs.

Remark 5.2 We can also apply the Proposition 6,8 to the diagram in the statement of Proposition 5,1, which implies a map from A' to A in Mnd(copEndo(Cai)),

6 Compatibility of two operational semantics

We consider a language with a collection of operational rules, but model them into two categorical rules; one is a natural transformation on Set which generates the usual transition systems; the other is a natural transformation on the category SL of join semi-lattices, generating linear transition systems for trace equivalence semantics [11].

The categorical rules for trace equivalence semantics was the one given by Turi [13], Here we show the existence of maps between two distributive laws generated by those categorical rules, and assure the compatibility of these two apparently different semantics.

6.1 Language 3

Consider the following language:

t ::= nil | a.t \ t + t | t\t,

where a ranges over the finite set of actions Act, with the operational rules which have explicit termination s/

nil —► y/ a-X A x

a , a/ / /

X ^ X y —► y X ^ yf y ^ V

x + y ^ x' x y —> y1 x + y ^ ^ x + y ^ ^

a , a i / /

X X y y x V y V

x\y ^ x'\y x\y ^ x\y' x\y ^ \/

6.2 Usual Bisimulation Semantics

Let £ : Set —► Set be an endofunctor, which model the signature of the language 3, defined by

EX = 1 + Act ■ X + X x X + X x X,

where Act • X is the Act copower of set X, i.e., \Act\ coproducts of the set X, and T be a monad freely generated by the endofunctor E, We adopt behaviour

endofunctor B : Set —► Set defined by

B = V( 1 + Act • _) : Set Set,

which sends a set X to the set of non-empty finite subsets of 1 + Act • X. Here the singleton set 1 has an explicit termination state s/.

Let p : E(Id x B) BT be a natural transformation modelling the operational rules. The component px ■ E(X x BX) —► BTX for set X is given by its components (4) for each operator r, that are defined as follows:

nil * i—^

a. (x, a) i—> {(a, x)}

+ ((x,a),(y,[3))^aU[3

'W} U {(a, x'\y) I (a, x') e a} U {(a,x\y') | (a, y') e ¡3}

if a 3 y/ e (3 {(a, x'\y) | (a, x') e a} U {(a, x\y') \ (a, y') e /3}

otherwise.

((x,a),(y,/3)) ^

6.3 Trace Equivalence Semantics

In trace equivalence semantics (see [11]), the behaviours of programs are modelled by linear transition systems, whose final semantics assigns traces to each program. We can also model the Language 3 with the operational rules into a categorical rules which generates linear transition systems for trace equivalence semantics. For that purpose we model the signature and behaviour on the category SL of join semi-lattices [4], not on Set, This section recalls the modelling given by Turi [13],

We use the following properties of the category SL of join semi-lattices (see [11])

• The forgetful functor Z7 : SL —^ Set is monadic, i.e., it has a left adjoint F : Set —► SL which sends a set X to the nonempty finite powerset semi-lattice, so UF(X) = P(X) holds.

• The category SL is complete and cocomplete.

• The tensor product ® is given by the classifier of bilinear maps [4].

Let : SL —► SL be an endofunctor defined by

E'X = 1 + Act -X + X®X + X® X,

where Act-X is again Act copower of X. This endofunctor £' freely generates a monad T' on SL.

We adopt the behaviour endofunctor B' : SL —► SL defined for each semi-lattice X by

B'X = 1 + Act • X.

The collection of operational rules in Section 6,1 is linearly modelled by a categorical rules p' : £'(Id x B') B'T' on SL, The X-component T,'(X x B'X) —► B'T'X of p' for semi-lattice X is defined by its components for each operator. The component (X x B'x)®anty(T) _► B'T'X for operator r is given as a classifying map of bilinear maps (X x B'X)mty^ —► B'T'X. Here, the bilinear maps for each operator is given as follows:

nil * h^ *

a. (x,a) i—> a • x

+ ((x,a),(y,P))»aV /3

x'<a 11 ' (x'\y) V Va-?/'</? 11 ' ix\y') I ((x,a),(y,P)) ^ < ifn > * < i.

I Va.,'<a a-(x'\y)y \f a-y'<0 a ■ W) otherwise,

where a • x E Act • X is the element x in X corresponding to a E Act, and V is the join on semi-lattice, and a.x < a stands for largest element x, in the X corresponding to a, such that x V a = a.

6.4 Trace Equivalence Semantics and Bisimulation Semantics

In previous sections, we modelled the language with operational rules into two natural transformations, p on Set for usual bisimulation semantics, and p' on SL for trace equivalence semantics. Both rules p and p' implies, by applying Proposition 2,9, distributive laws A and A' of a monad over a co-pointed endofunctor respectively.

We show that there are maps between these two distributive laws. Define a natural isomorphism a : F£ = E'F by giving X-eomponent for each set X as follows:

I = /••( 1 + Act ■ X + X x X + X x X)

= F1 + Act ■ FX + F(X x X) + F(X x X) since F preserves colimit ^ 1 + Act • FX + F(X) ® F(X) + F(X) ® F(X)

since F(X x X) ^ F(X) ® F(X) holds

= E'FX

Since F preserves colimits, this induces a natural isomorphism t : FT = T'F subject to laws of monads.

Next define a natural transformation h : F(Id x B) (Id x B')F whose

F( prx)

X-component is given by the pair of following:

F(Id x B)X = F(X x UF( 1 + Act ■ X)) F(Id x B)X = F(X x UF( 1 + Act • X))

^ FUF( 1 + Act ■ X)

epv+Act-x) F(1 + + Mt . = B,FX

where e : FU Id is eounit of the adjunction F H U : SL — Set, Then the natural transformation h subjects to the laws of co-pointed endofunctors (Id x I^prJ and (Id x B', pr'J,

Proposition 6.1 With the data given above, the following diagram commutes for the natural transformations g : £(Id x B) (Id x B)T and g' : £'(Id x B') (Id x B')T' obtained from p and p' respectively by Proposition 2.1:

F£(Id x B)=^F(Id x B)T

Id x B')FT

E'(Id x B')F=f>(U x B')T'F,

where a(Id x B) and (Id x B)t are natural isomorphisms. This implies two maps between distributive laws; (F,t,h) : A —► A' in Mnd*(copEndo(Cai)) and (F,t-\h) : A A' in Mnd(copEndo(Cat)).

Proof. The commutativitv is checked by calculation. We use the Lemma 6,7 and 6,9 and the fact that F : Set —► SL preserves colimit to imply the inaps.r

Hence the categorical rules p for bisimulation semantics and p' for trace equivalence semantics in this example are compatible in the sense that there is a map between their distributive laws.

We can observe the following for this example: Using Theorem 3,2 and 3,7, we can show that there is a natural isomorphism t between these two functors:

(Id x B,

prj-coalg

*-(Id x B',

-coalg

(Id x BjprJ-coalg—Id x B', pr'J-coalg

This implies (Id x B', pr'J-coalgebras T'x,Fhk : T'FX ^ T'FX x B'T'FX and FhTxk : FTX FTX x B'FTX are isomorphic for any (Id x ^prj-coalgebra k : X —^ X x BX. If we first generate the Txk state transition systems from the operational rules and then linearlise it by functor Fh, we can

obtain up to isomorphism the induced behaviour model for trace equivalence semantics. So both distributive laws generate essentially same models.

Remark 6.2 By applying the argument in Remark 3,3 for the map (F, t, h) : A —► A' in Mnd*(copEndo(Cai)) and final semantics, we can say that two bisimilar programs are trace equivalence.

Acknowledgement

I would like to express my sincere thanks to Daniele Turi for valuable suggestions, I also whould like to thank members in LFCS,

References

[1] L. Aceto, W.J. Fokkink and C. Verhoef, Structural operational semantics, in (J.A. Bergstra, A. Ponse and S.A. Smolka, eds) Handbook of Process Algebra, Elsevier (2001), 197-292.

[2] F. Bartels, GSOS for Probabilistic Systems, Electronic Notes in Theoretical Computer Science 65.1 (2002).

[3] M. Fiore, and D. Turi, Semantics of Name and Value Passing, Proc. LICS 01 (2001), 93-104.

[4] M.C.B. Hennessy and G.D. Plotkin, Full abstraction for a simple programming language, Lecture Notes in Computer Science 74 (1979), 108— 120.

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

[6] G.M. Kelly and R. Street, Review of the elements of 2-categories, Sydney Category Seminar, Lecture Notes in Mathematics 420 (1974), 75-103.

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

http://www.elsevier.nl/locate/entcs/volume33.html

[8] G.D. Plotkin, A structural Approach to Operational Semantics, Technical Report DAIMI FX-19. Computer Science Department, Aarhus University, 1981.

[9] J. Power and H. Watanabe, Distributivity of a monad and a comonad, Electronic Notes in Theoretical Computer Science 19 (1999).

http://www.elsevier.nl/locate/entcs/volumel9.html

[10] J. Power and H. Watanabe, Combining monads and comonads, to appear in Theoretical Computer Science.

[11] J. Rutten and D. Turi, Initial algebra and final coalgebra semantics for concurrency, Lecture Notes in Computer Science 803 (1994), 530-582.

[12] D. Turi and G.D. Plotkin, Towards a mathematical operational semantics, Proc. LICS 97 (1997), 280-291.

[13] D. Turi, Categorical Modelling of Structural Operational Rules: Case Studies, Lecture Notes in Computer Science 1290 (1997), 127-146.

[14] H. Watanabe, Well-behaved Translations between Structural Operational Semantics (Long version), in preparation.

Appendix

We give some technical lemmas that we use in previous sections.

6.5 Structural Recursion

Proposition 6.3 Let T he a monad freely generated by an endofunctor E on a cartesian category C, and í¡jx ■ ETX —► TX the structure of the free E-algebra over an object X on C. For any morphisms f : X Y and h : —► Y in

C, there exists a unique morphism f* : TX —► Y in C such that the following diagrams commute:

X-^TX-^ETX

Proof. We remark that the coproduct pair (rjx\i¡)X) : X + Ei X —► TX is the initial X + E-coalgebra. So, there is a unique arrow p : TX —► Y to X + E-algebra (f\h) : X + EF —^ Y. Hence the result follows. □

6.6 Syntactic Translations

This is a weakened claim of Proposition 2.8.

Lemma 6.4 Suppose the endofunctor freely generates a monad T', and let T be a monad. Any natural transformation of type a : E'J JT for arbitrary J is equivalent to a natural transformation T'J => JT subject to laws of monads.

Lemma 6.5 Suppose the endofunctors E and E' freely generate 'monads T and T' respectively, and the functor F : C —► C has a right adjoint G. Then any natural transformation of type FE => T'F generates a natural transformation t : FT T'F subject to the laws of monads.

Proof. By using the adjunction, the natural transformation FE T'F is equivalent to a natural transformation E GT'F, where the endofunctor

GT'F is a monad. Using the Lemma 6,4, we have yet another equivalent natural transformation T => GT'F subject to the laws of monads T and GT'F. Taking the adjunct back, we have a natural transformation FT => T'F subject to the laws of monads, □

6.7 Lemmas for map in Mnd*(copEndo(Cai))

We suppose both the natural transformations g : T,H HT on C and g' : T!H' H'T' on C respect the structures of co-pointed endofunctors (H, e) and (H',e') respectively, and hence generate distributive laws A : TH => HT and A' : T'H' H'T' respectively, of a monad over a co-pointed endofunctor.

Proposition 6.6 Let F : C —► C be a functor with a right adjoint, h : FH H'F a natural transformation which subject to laws of co-pointed endofunctors, and a : FT, => T'F a natural transformation, and t : FT T'F a natural transformation generated by Lemma 6.5. If these data commutes the diagram below, then (F,t,h) is a map of distributive laws in Mnd*(copEndo(Cai)).

FEH=^FHT

I'lI'l-^f-H'l'F

Outline of Proof We first remark that the natural transformation t subject to the laws of monads. In order to show the eommutativity of hexagon in Definition 3,1, we show these two components of natural transformations equals for any object X in C.

FTHX ^ FHTX H'FTX H'T'FX (9)

FTHX ^ T'FHX T'H'FX H'T'FX (10)

We take the transpose (—)" of both (9) and (10) by adjunction F H G : C —► C, then we have these two arrows in C:

THX HTX GH'FTX GH'T'FX, (11)

THX GT'FHX GT'H'FX GH'T'FX. (12)

It is routine to show that both arrows (11) and (12) commute the following diagrams of structural recursion (Proposition 6,3):

Il X THX--mxo0THX-V/ //.V

(H'ri'FXohx

GH'T'FX ■*---;-;-:-rr TGH'T'FX,

GH ¡x fxOGX t,fxOGT eH'T'FX0(aGH'T'FX)

where e is the counit of the adjunction F H G. So we have (11) = (12), which implies (9) = (10) by transposing back. Hence we have

//'/ • hT ■ FX = X'F • T'h • HI.

the map of distributive laws in 3,1, □

Corollary 6.7 Let F and, h he same as Proposition 6.6 above, (Jq : FT, => T'F a natural transformation, t : FT T'F a natural transformation generated from 9'F -gq : FT, => T'F by Lemma 6-4- If these data commutes the diagram below, then (F,t,h) is a map of distributive laws in Mnd*(copEndo(Cai)).

FTH =J^> F HT

T'FH H'FT

T'H'F H'T'F

Proof. The naturalitv of 9' and the equality A' • 9'H' = g' implies the com-mutativitv of the diagram in Proposition 6,6, Hence the result follows, □

6.8 Lemmas for map in Mnd(copEndo(Cai))

Similarly to the previous section 6,7, we have the following.

Proposition 6.8 Let F : C —► C be a functor, h : FH H'F a natural transformation which subject to laws of co-pointed endofunctors, a : T'F => FT a natural transformation, and t : T'F => FT a natural transformation generated from a by Lemma 6.4- If these data commutes the diagram below, then (F,t,h) is a map of distributive laws in Mnd(copEndo(Cai)).

FTH ==> F HT

(jRx^ ^WiT

T'FH H'FT

T'H'F H'T'F

Outline of Proof Similar to the Proof of Proposition 6,6, we use structural recursion for T' without adjunction, □

Corollary 6.9 Let F and h be same as Proposition above, and : T'F => FT, be natural transformations, and t : T'F => FT a natural transformation generated by F0-(j$ : T'F => FT by Lemma 6.4- If these data commutes the diagram below, then (F, t, h) is a map of distributive laws in Mnd(copEndo(Cai)).

FTH =J^> FHT

T'FH H'FT

T'H'F =rf> H'T'F

Proof. Since X-9H = q holds, we can show the commutativity of the diagram in Proposition 6,8, □