Generic Forward and Backward Simulations?
Ichiro Hasuo??
Institute for Computing and Information Sciences
Radboud University Nijmegen, the Netherlands
http://www.cs.ru.nl/~ichiro

Abstract. The technique of forward/backward simulations has been
applied successfully in many distributed and concurrent applications.
In this paper, however, we claim that the technique can actually havemore genericity and mathematical clarity. We do so by identifying forward/backward simulations as lax/oplax morphisms of coalgebras. Starting from this observation, we present a systematic study of this genericnotion of simulations. It is meant to be a generic version of the study by
Lynch and Vaandrager, covering both non-deterministic and probabilistic systems. In particular we prove soundness and completeness resultswith respect to trace inclusion: the proof is by coinduction using thegeneric theory of traces developed by Jacobs, Sokolova and the author.
By suitably instantiating our generic framework, one obtains the appropriate definition of forward/backward simulations for various kinds ofsystems, for which soundness and completeness come for free.

1

Introduction

The theory of forward/backward simulations for non-deterministic automata has
been extensively studied, notably by Lynch and Vaandrager [12]. It has been
applied successfully in many distributed and concurrent applications, described
as transition systems. For example, in [9] trace-based anonymity properties for
network protocols are proved by building backward simulations. The notions offorward/backward simulations are also extended to different kinds of state-based
systems such as probabilistic ones [15].
In this paper we claim that this theory of forward/backward simulations canactually have more genericity and mathematical clarity. We do so by revealinga simple mathematical structure hidden behind various notions of simulations
defined for different kinds of systems. The slogan is:
Forward/backward simulations are lax/oplax morphismsof coalgebras in Kleisli categories.
?
??

An extended version of this paper appears as [6].
Part of this work was done during the author’s stay at Research Center for Verification and Semantics, National Institute of Advanced Industrial Science and Technology (AIST), Japan. The author is grateful for the hospitality.

Based on this observation, we aim at presenting a generic version of thesystematic study [12]. The outcome is satisfactory. We employ the generic theoryof traces in [5] and show:– Soundness. Existence of a forward or backward simulation implies trace inclusion.
– Completeness. Trace inclusion implies existence of a certain kind of hybrid
simulation, namely a backward-forward simulation.
The important point is that all these definitions and proofs are stated in abstract coalgebraic terms, hence come with ample genericity. In fact they areparametrized by:– The type of branching. It can be either non-determinism (with a set of possible transitions) or probabilism (with a distribution over possible transitions).
– The type of transitions. For example, a context-free grammar can be considered as a state-based system—non-terminals as states—with non-deterministic
branching. It has a different transition type from, say, LTS’s: a CFG transits to a word over symbols and states, while an LTS transits to a pair ofa symbol and a (next) state. Our result covers a wide variety of transition
types.
Hence for each application from such a wide variety, one can obtain a definitionof forward/backward simulations by instantiating our general framework withsuitable parameters. Moreover one is assured that this definition is the right one:good properties such as soundness and completeness come for free. Therefore we
expect abundant practical implication of this work.
Now let us take a completely different standpoint, namely that of a coalgebratheorist. This work cultivates a new field of coalgebraic methods in computerscience: coalgebras in a Kleisli category. The standard theory of coalgebras (e.g.
[14]) is based in Sets, establishing the (successful) second row of the table. This
paper, following the previous work [5], extends this table downwards.
base category
Sets
Kleislimorphisms of coalgebras
coinduction gives
functional bisimulation
bisimilarity
lax · · · forward simulation
trace semantics[this paper]oplax · · · backward simulation[5]

The paper is organized as follows. In Section 2 our basic (coalgebraic) setting
is presented. State-based systems are formulated as coalgebras with explicit start
states in Section 3. The key notion of generic forward/backward simulations ispresented in Section 4. In Section 5 we recall the generic theory of coalgebraic
traces from [5]. The materials of the previous two sections are combined in
Section 6 to prove soundness and completeness. We conclude in Section 7.

2

Preliminaries

This section presents preliminaries from category theory and theory of coalgebras. They are put in an elementary and descriptive manner. For more details
the reader is referred to [5].

In this paper we identify forward/backward simulations as lax/oplax morphisms of coalgebras in a Kleisli category K`(T ) for a monad T on Sets. Thisobservation is inspired by a series of work (stemming from [13]) on trace semantics for/via coalgebras: a Kleisli category is a suitable base category there. Ourbasic story is as follows.
We model a state-based system as a coalgebra X → T F X in Sets, with T amonad, F a functor and a distributive law F T ⇒ T F implicit. The intuition is:– a monad T describes the type of branching (non-determinism, probabilism,etc.) of the system;– a functor F describes the transition type of the system, which determines
the type of linear-time behavior (e.g. words over action symbols);– a distributive law F T ⇒ T F describes the way how T ’s effect of branchingis distributed over the transition type represented by F .
It turns out that having X → T F X in Sets is equivalent to having a coalgebra
X → F X in the Kleisli category K`(T ), where F : K`(T ) → K`(T ) is a canonicallifting of F : Sets → Sets with F X = F X. This lifting F is induced by the
distributive law. To summarize:– In modeling a system as a coalgebra X → T F X, we separate the type ofbranching T from the transition type F .
– By moving from Sets to K`(T ), this coalgebra becomes a coalgebra X → F X
for a functor F —instead of a combination T F . Then we can start the usual
coalgebraic business such as morphisms, final coalgebras and coinduction.
2.1

Monads for types of branching

A monad T on Sets is an endofunctor on Sets equipped with two kinds ofµX
ηXfunctions: for each set X, the unit X → T X and the multiplication T T X → T X.
These functions must satisfy certain coherence conditions.
In coalgebraic settings, it is shown in [5] that monads with a certain order
structure are suitable for modeling state-based systems with branching, especially for analyzing their trace semantics. We are interested in such monads inthis paper. We have two examples:– The powerset monad P, modeling the non-deterministic branching.
– The subdistribution monad D, modeling the probabilistic
branching. For aP
set X, DX is given by: DX = { ξ : X → [0, 1] |ξ(x)≤ 1 } . Here ξx∈X
is called a probability subdistribution over X. It is “sub” because the sum of
all probabilities is not necessarily equal to 1.
We take
P the subdistribution monad D, instead of the distribution monad D=1 X ={ξ | x ξ(x) = 1}, since the latter lacks a suitable order structure. This point iselaborated in Section 2.3.

2.2

Kleisli categories for monads

For each monad T on Sets, we construct the Kleisli category for T , denoted by
K`(T ), in the following way. The crucial part is that an arrow X → Y in K`(T )is actually a function X → T Y in Sets.
– Objects in K`(T ) are the same as in Sets: they are just sets.
– An arrow X → Y in K`(T ) is a function X → T Y in Sets.
– Composition of arrows is defined using multiplication µX : T T X → T X.
ηX
id
– The identity arrow X → X in K`(T ) is the unit X → T X in Sets.
This K`(T ) will be our base category. Notice that when we write X → Y in
K`(T ), a branching nature of this arrow is implicit because it is a function
X → TY .
For the monads P and D of our interest, we shall describe more details of
their Kleisli categories.
The category K`(P) is in fact isomorphic to the category Rel of sets andrelations. That is, an arrow X → Y in K`(P) is a relation between X and Y
via the standard “relation-into-function” trick: given a function f : X → PY in
Sets we obtain a relation Rf = {(x, y) | y ∈ f (x)}. In particular, compositionof arrows in K`(P) is given by the relational composition S ◦ R = {(x, z) |∃y. xRy ∧ ySz} of the corresponding relations. The identity arrow idX is the
diagonal relation {(x, x) | x ∈ X}.
In K`(D) an arrow X → Y assigns to each x ∈ X a probability subdistriid
bution over Y . The identity arrow X → X maps x ∈ X to the so-called Diracfg

distribution for x. The composition of arrows
P X → Y → Z in K`(D) is suchthat: for x ∈ X and z ∈ Z, (g ◦ f )(x)(z) = y∈Y f (x)(y) · g(y)(z) .
2.3

Order-enriched structure of Kleisli categories

The notion of branching—such as non-determinism and probabilism—come withnatural notions of order. For non-determinism we have the inclusion order between sets of possible transitions. For probabilism a subdistribution ξ is bigger
than ψ if, to each possible transition, ξ assigns bigger probability than ψ does.
These natural orders accompanying the notion of branching appear in our
setting as a DCpo⊥ -enriched structure of Kleisli categories. This order structure
is fully exploited in the definition of forward/backward simulations: a systemsimulates another one if it has more behavior.
For T = P or D, the Kleisli category K`(T ) is DCpo⊥ -enriched. This means:– For any pair of sets X and Y , the set HomK`(T ) (X, Y ) of the arrows fromX to Y hasFa dcpo structure v with bottom. In particular we can take thesupremum n<ω fn of an increasing chain f0 v f1 v · · · of arrows, and thereis the minimum arrow ⊥X,Y : X → Y . F
FF– Compositionof arrows is continuous: g ◦ ( n fn ) = n (g ◦ fn ) and ( n fn ) ◦F
h = n (fn ◦ h). In particular composition is monotone.

Indeed, for T = P or D, a set T Y has a DCpo⊥ structure vT Y . This extends
to the order between arrows in K`(T ) in a pointwise manner: for f, g : X ⇒ Y ,f v g if for each x ∈ X, f (x) vT Y g(x).
We need the minimum arrow ⊥X,Y : X → Y in K`(T ) for the trace semantics
results in Section 5. It is not available for the distribution monad D=1 : that is
why we use the subdistribution monad D instead.
2.4

Shapely functors for transition types

We restrict a functor F —which models the transition type of a system—to be
shapely. The reason to do so is: we know the results on coalgebraic trace semantics in Section 5 hold for shapely functors,1 and also in most of the interesting
examples we can take as F a shapely functor. The family of shapely functors isalmost as broad as that of polynomial functors: it is defined inductively by thefollowing BNF notation.
`
F, G, Fi ::= id | Σ | F × G | i∈I Fi ,where Σ denotes the constant functor into an arbitrary set Σ, and I is anarbitrary index set. Here are some virtue of shapely functors which we will
exploit.

– An initial F -algebra exists, obtained via the initial sequence of length ω.
– For T = P or D, there is a canonical distributive law F T ⇒ T F . Equivalently, F has a canonical lifting F on K`(T ). On objects F X = F X, and onarrows F ’s action is what one might think of at first sight.

3

Coalgebraic modeling of systems

In this section we model a wide variety of branching state-based systems as
what we call (T, F )-systems. A (T, F )-system is a F -coalgebra in the Kleisli
category K`(T ) plus explicit start states. This definition of (T, F )-systems will
be motivated by several illustrating examples.
Two parameters in the notion of (T, F )-systems are: T is a monad, being
either P or D, representing the branching type; F is a shapely functor describing
the transition type. In the sequel we assume that T and F are such.
Definition 3.1 ((T, F )-systems) A (T, F )-system is a pair of arrows
1

s

X

c

FX

in the Kleisli category K`(T ).

That is, a pair of functions (s : 1 → T X, c : X → T F X) in Sets, recalling thatF X = F X. The arrow s is called the start states map, and the F -coalgebra c
is called the dynamics. The set X is called the state space. The only element of
the singleton 1 appearing here2 is denoted by ∗.
1
2

This does not say that those results hold exclusively for shapely functors.
In this paper we will have singletons with different computational meanings. Accordingly, their only elements will be denoted by different symbols.

In most literature on coalgebras the start state (or the set of start states) is left
implicit. However in our setting we need to have them explicit. See [6, Appendix
1] for further discussion.
Example 3.2 (Non-deterministic automata) Let us take the powerset monad
P for T , hence non-deterministic branching. For an endofunctor F we take1 + Σ × , where 1 = {X} is a singleton and Σ is a non-empty set of symbols. A (T, F )-system then is a pair of functions in Sets,
s

1

PX,

X

c

P(1 + Σ × X),which should be interpreted as follows. The subset s(∗) of X is the set of possible
start states. For a state x ∈ X, the set c(x) contains X if x is an accepting state;ait contains a tuple (a, x0 ) if there is a (possible) transition x → x0 . In this way a(T, F )-system for these T and F is thought of as a non-deterministic automaton.
Example 3.3 (Probabilistic automata) Let us take T = D instead of P in
the previous example. A (T, F )-system is a pair of functions in Sets:
s

1

DX,

X

c

D(1 + Σ × X)

.

This is understood as follows. The subdistribution s(∗) over X represents theprobability with which each state x ∈ X is chosen as a starting state. An execution successfully terminates at x with the probability c(x)(X); a transitionax → x0 is made with the probability c(x)(a, x0 ). Such a system is called a generative probabilistic transition system [17,16]: in this paper we shall call it simply
a probabilistic automaton. Here is an example of a probabilistic automaton.
x(a, 31 )(a, 1)

z(a, 31 )1
3(a, 21 )y
12with start states:

x 7→ 1/3.
y 7→ 2/3

X

This is modeled as the following (D, 1 + Σ × )-system.

x 7→ 1/3s– The start state map 1 → DX is such that s(∗) =, andy 7→ 2/3c– the dynamics coalgebra X → D(1 + Σ × X) is such thatc(x) = [ (a, y) 7→ 1/3, (a, z) 7→ 1/3, X 7→ 1/3 ], etc.
Remark 3.4 (Systems with both non-determ./probabilistic branching)
Probabilistic I/O automata [18] are another kind of well-studied models for statebased systems. One of their features is that they are equipped with both nondeterministic and probabilistic branching. Unfortunately, we are yet to find asuitable monad to model this combined branching: that is why probabilistic I/O
automata are currently out of the scope of our generic framework.

Context-free grammars (without finiteness assumptions) can be also modeledas (T, F )-systems with T = P and a suitable F (see [4]).
The notion of morphisms of coalgebras extends to (T, F )-systems in an obvious manner [6].

4Forward/backward simulations, coalgebraicallyThis section presents the key notions of this paper: generic forward, backward
and backward-forward simulations. The intuition about order accompanying thenotion of “branching”—now substantiated as the DCpo⊥ -enriched structure ofa Kleisli category—is fully exploited here.
In this section again T = P or D, and F is a shapely functor.
s

c

t

d

Definition 4.1 (Forward simulation) Let 1 → X → F X and 1 → Y → F Y
be (T, F )-systems, presented in K`(T ). A forward simulation from (t, d) to (s, c)
is an arrow f : X → Y in K`(T ) such that:t v f ◦ s and d ◦ f v F f ◦ c ,where v refers to the order available due to the DCpo⊥ -enriched structure of
the Kleisli category. Diagrammatically presented,
Ff

FX
c
X
s

w
f
w
1

FY
d
Y
t

(1)

.

In other words, a forward simulation is a lax morphism from (s, c) to (t, d).
We write (t, d) vF (s, c) if there is a forward simulation from (t, d) to (s, c).
The use of lax morphisms in categorical accounts of simulation/refinement isfound in [10]. In a coalgebraic setting, [2] uses lax morphisms to investigate
order-enriched version of bisimulation. However, to the best of our knowledge,
we are the first to notice the significance of lax morphisms in Kleisli categories.
The dual notion, with the order of arrows opposed, has also a significant
computational meaning.
s

c

t

d

Definition 4.2 (Backward simulation) Let 1 → X → F X and 1 → Y →F Y be (T, F )-systems, presented in K`(T ). A backward simulation from (s, c) to(t, d) is an arrow f : X → Y in K`(T ) such that: f ◦ s v t and F f ◦ c v d ◦ f .
Ff

FX
c
X
s

v
f
v
1

FY
d
Y
t

(2)

Hence a backward simulation is an oplax morphism of systems.
We write (s, c) vB (t, d) if there is a backward simulation from (s, c) to (t, d).
Remark 4.3 Note the direction of forward/backward simulations and lax/oplax
morphisms. In general, the system which appears on the smaller sides of inequalities is simulated by the other one. For example, a lax morphism from (s, c) to(t, d) in Diagram (1) is a forward simulation from (t, d) to (s, c), through which(s, c) forward-simulates (t, d); hence (t, d) vF (s, c).
Let us be convinced of these abstract definitions by looking at examples.
Example 4.4 (Non-deterministic automata) In the setting of Example 3.2,
an arrow X → Y in K`(T ) is a relation R from X to Y since K`(P) ∼= Rel. The
previous definitions boil down as follows: R is a forward simulation from (t, d)to (s, c) if and only if it satisfies the following conditions.
y ∈ start(t,d)
xRy ∧ y →d XaxRy ∧ y →d y 0

=⇒
=⇒
=⇒

∃x ∈ start(s,c) . xRy ,x →c X ,
a∃x0 ∈ X.
x →c x0 ∧ x0 Ry 0 ,where start(s,c) denotes the set s(∗). These conditions are much like those in thestandard literature [12]. Notice in particular that the third condition is of thefollowing familiar form, working “forwards”.
xxRy a y0

=⇒

a

∃x0
R
R
y a y0Similarly, a relation R from X to Y is a backward simulation from (s, c) to(t, d) if and only if:
x ∈ start(s,c) ∧ xRy
x →c Xax →c x0 ∧ x0 Ry 0

=⇒
=⇒
=⇒

y ∈ start(t,d) ,
xRy ∧ y →d X ,∃y ∈ Y.
a∃y ∈ Y.
xRy ∧ y →d y 0 .

The third condition here works “backwards” in the following way.
x

a

x0
R
0
y

x

=⇒

a

x0
R
R
a 0
∃y
y

Example 4.5 (Probabilistic automata) In the setting of Example 3.3, theabstract Definition 4.1 is instantiated as follows: a function f : X → DY in Sets
is a forward simulation from (t, d) to (s, c) if and only if:Pt(∗)(y) ≤x∈X s(∗)(x) · f (x)(y) ,Pf (x)(y) · d(y)(X) ≤ c(x)(X) ,
(3)
P
P y∈Y
0
0
0
0
≤
x0 ∈X c(x)(a, x ) · f (x )(y ) .
y∈Y f (x)(y) · d(y)(a, y )It is also straightforward to instantiate Definition 4.2 of backward simulations.
One may wonder why we can call such f a forward simulation, although one
can notice that a “forward” argument similar to the previous example is goingon. The point is that, however, by the abstract theorems in the following sections
we know that this definition (3) of forward simulations—derived from the coalgebraic definition—satisfies desirable properties such as soundness/completenesswith respect to trace inclusion.
We define a simulation from one probabilistic system to another to be afunction X → DY . This is different from the approach in [7]: there a simulationis always a relation between state spaces X and Y .
By suitably instantiating the generic definitions, we also obtain appropriate notions of simulations for context-free grammars.
Forward and backward simulations will be shown to be sound with respect totrace inclusion. But they in general fail to be complete. Instead, a completenessresult is proved for a certain combination of forward and backward simulations(hybrid simulations), as is done in [12].
Definition 4.6 (Backward-forward simulations) Let (s, c) and (t, d) be (T, F )systems. A backward-forward simulation from (s, c) to (t, d) is a pair of– a backward simulation f from (s, c) to an intermediate system (r, b), and– a forward simulation g from the intermediate system (r, b) to (t, d).
Diagrammatically presented in K`(T ) (note the direction of arrows),
FX
c
X

Ff

Fg
FU
v
v
b
g
f
U
v r
v
s
1
t

FY
d
Y

(4)

.

We write (s, c) vBF (t, d) if there is a backward-forward simulation from(s, c) to (t, d). Obviously,(s, c) vBF (t, d)⇐⇒∃(r, b).

(s, c) vB (r, b) ∧ (r, b) vF (t, d).

Remark 4.7 (Forward-backward simulations) It is straightforward to define the notion of forward-backward simulations and the relation vFB , as a suitable dual of Definition 4.6. This is done in [12] for a restricted class of nondeterministic systems. In the same paper vBF and vFB are shown to coincide.
However we have not yet found the coincidence of vBF and vFB in general:in the light of Theorem 6.2, it seems that vBF is the more fundamental notion.
The coincidence for non-deterministic systems in [12] may be because K`(P) is
self-dual, i.e. K`(P) ∼= K`(P)op . Details are yet to be elaborated.

5

Finite trace semantics via coinduction

In this paper we take (finite) traces as our semantics for systems. It is withrespect to trace semantics that soundness and completeness of forward/backward
simulations are shown. This section establishes the basics of trace semantics for
systems by revisiting our previous work [5]. The main points are:– a final coalgebra in the Kleisli category K`(T ) is (interestingly) induced byan initial algebra in Sets;– the principle of coinduction, when employed in K`(T ), yields finite trace
semantics for branching systems.
We also cite a fact from [2] about an order-theoretic property of a final coalgebra.
Again in this section a monad T is P or D and F is a shapely functor.
The following result identifies a final coalgebra in the Kleisli categories.
∼=
Theorem 5.1 (Main theorem of [5]) Let α : F A →A be an initial F -algebrain Sets.
∼=
1. An initial F -algebra in K`(T ) is induced by α as ηA ◦ α : F A →A in K`(T ).
2. In K`(T ), an initial F -algebra and a final F -coalgebra coincide. The latteris given as follows. We shall denote this coalgebraic structure map by ζ.

ζ = (ηA ◦ α)−1 = ηF A ◦ α−1 : A

∼
=

FA

in K`(T ) .

tu

As a corollary we obtain the final coalgebra semantics for an F -coalgebra.
Recall that such a coalgebra is a dynamics of a (T, F )-system.
Corollary 5.2 (Trace semantics for coalgebras, [5]) Given an F -coalgebrac
X → F X in K`(T ), there exists a unique morphism trc which makes the follow∼=
ing diagram commute. Here α : F A →A is an initial F -algebra in Sets.
FXcX

F (trc )trcFA∼ ζ (final)
=
A

(5)
t
u

The induced map trc : X → A in K`(T ), i.e. trc : X → T A in Sets, in fact
becomes what is usually called the finite trace map: it assigns to each state its“trace” in a suitable sense. The following examples show that the commutationof Diagram (5) actually amounts to standard and natural recursive definition offinite trace maps.
Example 5.3 (Non-deterministic automata) In the setting of Example 3.2,
an initial F -algebra in Sets is carried by finite lists, or words, over Σ.
1 + Σ × Σ∗

[nil, cons]∼=Σ∗Now Diagram (5) commutes if and only if the function tr c : X → P(Σ ∗ ) satisfies
the following conditions. For each a ∈ Σ and σ ∈ Σ ∗ .
hi ∈ trc (x)a · σ ∈ trc (x)

⇐⇒
⇐⇒

x→X ,
∃x0 ∈ X.

`ax → x0 ∧ σ ∈ trc (x0 )´.

This is the standard recursive (or corecursive, if you like) definition of the accepted languages of non-deterministic automata. The language tr c (x) ⊆ Σ ∗ isthe set of all the linear-time behavior of x which eventually terminates within afinite number of steps (hence the name finite trace).
Example 5.4 (Probabilistic automata) Let us look at the example of a probabilistic automaton in Example 3.3. What is the “trace” of the state x of thissystem? A natural answer, as suggested in [8], is the probability subdistribution
over lists on Σ:
hi 7→

1
,
3

a 7→

1 1
· ,
3 2

aa 7→

1 1 1
· · ,
3 2 2

··· ,

an 7→

1
·
3

„ «n−1
1
1
· ,
2
2

···

(6)

This is explained as follows. For the state x to output the list aa, it has to takeaathe path of transitions: x → y → y → X. This path occurs with the probability
1 1 1
3 · 2 · 2.
This notion of “probabilistic trace” is again obtained via coinduction in the
Kleisli category. Let us instantiate Diagram (5) with T and F in Example 3.3.
The commutativity of the diagram amounts to the following (co)recursive definition of a function trc : X → D(Σ ∗ ):
hi 7→ c(x)(X).
trc (x) =P
a · σ 7→y∈X c(x)(a, y) · tr c (y)(σ)

Here the probability c(x)(a, y) · tr c (y)(σ) is for the event that x makes an a-moveto y and then y yields the list σ as its trace. Taking the sum over all the possible
successors y of x, we get a natural recursive definition of the probability withwhich x yields a · σ as its trace.
As an additional remark we point out that the subdistribution (6) sumsaaaup only to 2/3. The remaining 1/3 is for the path x → z → z → · · · : theωωprobability for a , or livelock. This entry a 7→ 1/3 is absent in trc (x) because
trc : X → D(Σ ∗ ) is the finite trace. This also demonstrates why we use thesubdistribution monad D instead of the distribution monad D=1 : although thesystem can be described using D=1 , we do not get trc of the type X → D=1 (Σ ∗ ).
Example 5.5 (Context-free grammar, [4]) Take T = P and a suitable F
for context-free grammars. Then the trace map tr c assigns to each non-terminal
x the set of finite-depth parse trees generated by the context-free grammar cstarting from x.
From a different point of view, the previous examples are seen as proofs thatstandard recursive definitions uniquely determine trace maps, due to the finality
result in Corollary 5.2.

The trace map trc , being a morphism of coalgebras, automatically becomesa lax morphism of coalgebras. It is in fact characterized as the biggest one.
Proposition 5.6 (Trace map as the biggest lax morphism) In the situation of Diagram (5), the trace map trc is the biggest one among the lax coalgebramorphisms from c to the final ζ.
Dually, the trace map trc is the smallest one among the oplax coalgebra morphisms from c to the final ζ.
Proof. Although the proposition follows from a general result [2, Proposition
6.7], in this specific setting of a Kleisli category we can give another proof. It
does not depend on the local continuity of F but only on its local monotonicity.
This alternative proof is found in [6, Appendix 2].
tu
So far the trace map induced by coinduction gives the semantics for a single
state of a coalgebra. This is extended to the semantics of a (T, F )-system—acoalgebra with explicit start states—in the obvious way.
Definition 5.7 (Finite trace semantics of (T, F )-systems) Given a (T, F )scsystem 1
X
F X in K`(T ), its finite trace (or just trace) tr(s,c) is thefollowing composite in K`(T ).
FX
c
X
s
1

F (trc )
trc

FA
∼
= ζ
A

tr(s,c)One can readily show that a morphism of systems preserves trace semantics.

6

Soundness and completeness theorems

In the last two sections we have built up the notions of (and some results on) forward/backward simulations and trace semantics, with a high level of genericity
and abstraction. In this section we relate those materials—with the same genericity and abstraction—by proving soundness of vF , vB , vBF and completenessof vBF with respect to trace inclusion. This is the main technical result of thispaper.
sctd
In the rest of this section we assume 1 → X → F X and 1 → Y → F Y to be(T, F )-systems, where T = P or D and F is shapely.
Theorem 6.1 (Soundness of vF , vB , vBF )
1.
2.
3.

(s, c) vF (t, d)(s, c) vB (t, d)(s, c) vBF (t, d)

=⇒
=⇒
=⇒

tr(s,c) v tr(t,d) ,tr(s,c) v tr(t,d) ,tr(s,c) v tr(t,d) .

Proof. 1. By definition of vF we have a forward simulation f : Y → X. In
particular we have in K`(T ),
FY
d
Y

Ff

F (trc )

FX
c
X

w
f

=
trc

FA
∼
= ζ (final)A

where the coinduction diagram appears on the right. This shows that the arrowtrc ◦ f is a lax coalgebra morphism from d to the final coalgebra. Since thetrace map is the biggest lax coalgebra morphism (Proposition 5.6), we havetrc ◦ f v trd . This inequality is combined with f ’s condition on start states.
tr(s,c) = trc ◦ s v trc ◦ f ◦ t v trd ◦ t = tr(t,d)
This proves 1. Similar arguments prove 2.
3. The relation vBF is a relational composition vF ◦vB . We use 1. and 2. ofthe theorem and transitivity of the order v between arrows 1 ⇒ A.
tu
Completeness—the converse of the soundness result above—does not holdfor vF , vB but does hold for the weaker notion of vBF . For a restricted class of
non-deterministic systems the completeness result is shown in [11,12].
Theorem 6.2 (Completeness of vBF )tr(s,c) v tr(t,d)=⇒(s, c) vBF (t, d) .

Proof. From a (T, F )-system (s, c), we construct its “canonical system” as
1

tr(s,c)ζ∼=A

in K`(T ) .

FA

That is, the dynamics is the final F -coalgebra and the start states map is thetrace of the system. It is obvious by definition that the map tr c is a morphism of
systems from (s, c) to this canonical system (the left side of Diagram (7) below).
We apply the same construction to (t, d) yielding the right side of the diagram.
Then the assumption tr(s,c) v tr(t,d) fits in the lower middle of the diagram.
FXcX

F (trc )F (trd )
FA
∼
= ζ
trc
trd
A
tr(s,c) v tr(t,d)
s
1
t

FY
d
Y

(7)

From this we have two diagrams of backward-forward simulations—like Diagram(4) in Definition 4.6—depending on our choice of the intermediate system.
FX
c
X

FA
∼
=
A

tr(s,c)

1

FY
d
Y
v

or

FX
c
X
v

FA
∼
=
A
tr(t,d)1

FYdYEither diagram shows (s, c) vBF (t, d).

tuUsing the completeness result we can prove that the simulation relationvBF —now equivalent to trace inclusion—is actually transitive.
Proposition 6.3 The simulation relations vF , vB and vBF are preorders. Thatis, they are reflexive and transitive.
Proof. Except for transitivity of vBF , the proof is straightforward. See [6, Propositions 6.3, 6.4].
tu

7Conclusions and future work

We have developed a generic theory of branching state-based systems in termsof coalgebras in Kleisli categories. Notions such as forward/backward simulations and traces are defined and related via soundness and completeness results.
Several illustrating examples suggest practical implications of this theory.
There are a number of issues on branching systems that remain to be elaborated in our generic framework. To name a few: composition of systems, compositionality of semantics, modal logic, preservation of logical formulas, infinite
traces and internal actions.
As mentioned in Remark 3.4, systems with both non-deterministic and probabilistic branching do not fit in our general framework. There are many semanticalquestions (see e.g. [1]) about this combination of different branching: hopefully
categorical approaches will contribute to clarify the picture.
More examples of types of systems to which our framework applies are to
be found. For example, the author is interested in a probabilistic version ofanonymous simulations [9] .
IOA Toolset [3] is a formal verification tool in which systems are describedas I/O automata and analyzed using simulations. Now that its base theory ismade generic, one might as well work on a generic version of the toolset itself.

Acknowledgments
Thanks are due to Chris Heunen, Bart Jacobs, Yoshinobu Kawabe, Koki Nishizawa,Ana Sokolova, Frits Vaandrager and Hiroshi Watanabe for helpful discussions.

References
1. L. Cheung. Reconciling Nondeterministic and Probabilistic Choices. PhD thesis,
Radboud Univ. Nijmegen, 2006.
2. M. Fiore. A coinduction principle for recursive data types based on bisimulation.
Inf. & Comp., 127(2):186–198, 1996.
3. S. Garland, N. Lynch, and M. Vaziri. IOA: a language for specifying, programming,and validating distributed systems. MIT Laboratory for Computer Science, 1997.

4. I. Hasuo and B. Jacobs. Context-free languages via coalgebraic trace semantics.
In Algebra and Coalgebra in Computer Science (CALCO’05), volume 3629 of Lect.
Notes Comp. Sci., pages 213–231. Springer, Berlin, 2005.
5. I. Hasuo, B. Jacobs, and A. Sokolova. Generic trace theory. In Coalgebraic Methods
in Computer Science (CMCS 2006), Elect. Notes in Theor. Comp. Sci. Elsevier,
Amsterdam, 2006.
6. I. Hasuo. Generic forward and backward simulations. Technical report, ResearchCenter for Verification and Semantics, National Institute of Advanced Industrial
Science and Technology (AIST), Japan, 2006.
http://www.cs.ru.nl/~ichiro/papers/.
7. J. Hughes and B. Jacobs. Simulations in coalgebra. Theor. Comp. Sci., 327(12):71–108, 2004.
8. C. Jou and S. Smolka. Equivalences, congruences and complete axiomatizations
for probabilistic processes. In CONCUR’90, volume 458 of Lect. Notes Comp. Sci.,
pages 367–383. Springer-Verlag, 1990.
9. Y. Kawabe, K. Mano, H. Sakurada, and Y. Tsukada. Backward simulations foranonymity. In International Workshop on Issues in the Theory of Security (WITS’06), 2006.
10. Y. Kinoshita and J. Power. Data refinement and algebraic structure. Acta Informatica, 36:693–719, 2000.
11. N. Klarlund and F. Schneider. Verifying safety properties using infinite-state automata. Technical Report 89-1039, Department of Computer Science, Cornell University, Ithaca, New York, 1989.
12. N. Lynch and F. Vaandrager. Forward and backward simulations. I. Untimed
systems. Inf. & Comp., 121(2):214–233, 1995.
13. J. Power and D. Turi. A coalgebraic foundation for linear time semantics. In Category Theory and Computer Science, number 29 in Elect. Notes in Theor. Comp.
Sci. Elsevier, Amsterdam, 1999.
14. J. Rutten. Universal coalgebra: a theory of systems. Theor. Comp. Sci., 249:3–80,
2000.
15. R. Segala and N. Lynch. Probabilistic simulations for probabilistic processes.
Nordic Journ. Comput., 2(2):250–273, 1995.
16. A. Sokolova. Coalgebraic Analysis of Probabilistic Systems. PhD thesis, TU Eindhoven, 2005.
17. R. van Glabbeek, S. Smolka, and B. Steffen. Reactive, generative, and stratified
models of probabilistic processes. Inf. & Comp., 121:59–80, 1995.
18. S.H. Wu, S.A. Smolka, and E.W. Stark. Composition and behaviors of probabilistic
I/O automata. Theor. Comp. Sci., 176(1–2):1–38, 1997.