Bisimulation

From HandWiki
Short description: Relation between transition systems in computer science

In theoretical computer science a bisimulation is a binary relation between state transition systems, associating systems that behave in the same way in that one system simulates the other and vice versa.

Intuitively two systems are bisimilar if they, assuming we view them as playing a game according to some rules, match each other's moves. In this sense, each of the systems cannot be distinguished from the other by an observer.

Formal definition

Given a labeled state transition system ([math]\displaystyle{ S }[/math], [math]\displaystyle{ \Lambda }[/math], →), where [math]\displaystyle{ S }[/math] is a set of states, [math]\displaystyle{ \Lambda }[/math] is a set of labels and → is a set of labelled transitions (i.e., a subset of [math]\displaystyle{ S \times \Lambda \times S }[/math]), a bisimulation is a binary relation [math]\displaystyle{ R \subseteq S \times S }[/math], such that both [math]\displaystyle{ R }[/math] and its converse [math]\displaystyle{ R^T }[/math] are simulations. From this follows that the symmetric closure of a bisimulation is a bisimulation, and that each symmetric simulation is a bisimulation. Thus some authors define bisimulation as a symmetric simulation.[1]

Equivalently, [math]\displaystyle{ R }[/math] is a bisimulation if and only if for every pair of states [math]\displaystyle{ (p,q) }[/math] in [math]\displaystyle{ R }[/math] and all labels α in [math]\displaystyle{ \Lambda }[/math]:

  • if [math]\displaystyle{ p \mathrel{\overset{\alpha}{\rightarrow}} p' }[/math], then there is [math]\displaystyle{ q \mathrel{\overset{\alpha}{\rightarrow}} q' }[/math] such that [math]\displaystyle{ (p',q') \in R }[/math];
  • if [math]\displaystyle{ q \mathrel{\overset{\alpha}{\rightarrow}} q' }[/math], then there is [math]\displaystyle{ p \mathrel{\overset{\alpha}{\rightarrow}} p' }[/math] such that [math]\displaystyle{ (p',q') \in R }[/math].

Given two states [math]\displaystyle{ p }[/math] and [math]\displaystyle{ q }[/math] in [math]\displaystyle{ S }[/math], [math]\displaystyle{ p }[/math] is bisimilar to [math]\displaystyle{ q }[/math], written [math]\displaystyle{ p \, \sim \, q }[/math], if and only if there is a bisimulation [math]\displaystyle{ R }[/math] such that [math]\displaystyle{ (p, q) \in R }[/math]. This means that the bisimilarity relation [math]\displaystyle{ \, \sim \, }[/math] is the union of all bisimulations: [math]\displaystyle{ (p,q) \in\,\sim\, }[/math] precisely when [math]\displaystyle{ (p, q) \in R }[/math] for some bisimulation [math]\displaystyle{ R }[/math].

The set of bisimulations is closed under union;[Note 1] therefore, the bisimilarity relation is itself a bisimulation. Since it is the union of all bisimulations, it is the unique largest bisimulation. Bisimulations are also closed under reflexive, symmetric, and transitive closure; therefore, the largest bisimulation must be reflexive, symmetric, and transitive. From this follows that the largest bisimulation — bisimilarity — is an equivalence relation.[2]

Alternative definitions

Relational definition

Bisimulation can be defined in terms of composition of relations as follows.

Given a labelled state transition system [math]\displaystyle{ (S, \Lambda, \rightarrow) }[/math], a bisimulation relation is a binary relation [math]\displaystyle{ R }[/math] over [math]\displaystyle{ S }[/math] (i.e., [math]\displaystyle{ R }[/math][math]\displaystyle{ S }[/math] × [math]\displaystyle{ S }[/math]) such that [math]\displaystyle{ \forall\alpha\in\Lambda }[/math]

[math]\displaystyle{ R\ ;\ \overset{\alpha}{\rightarrow}\quad {\subseteq}\quad \overset{\alpha}{\rightarrow}\ ;\ R }[/math] and [math]\displaystyle{ R^{-1}\ ;\ \overset{\alpha}{\rightarrow}\quad {\subseteq}\quad \overset{\alpha}{\rightarrow}\ ;\ R^{-1} }[/math]

From the monotonicity and continuity of relation composition, it follows immediately that the set of bisimulations is closed under unions (joins in the poset of relations), and a simple algebraic calculation shows that the relation of bisimilarity—the join of all bisimulations—is an equivalence relation. This definition, and the associated treatment of bisimilarity, can be interpreted in any involutive quantale.

Fixpoint definition

Bisimilarity can also be defined in order-theoretical fashion, in terms of fixpoint theory, more precisely as the greatest fixed point of a certain function defined below.

Given a labelled state transition system ([math]\displaystyle{ S }[/math], Λ, →), define [math]\displaystyle{ F:\mathcal{P}(S \times S) \to \mathcal{P}(S \times S) }[/math] to be a function from binary relations over [math]\displaystyle{ S }[/math] to binary relations over [math]\displaystyle{ S }[/math], as follows:

Let [math]\displaystyle{ R }[/math] be any binary relation over [math]\displaystyle{ S }[/math]. [math]\displaystyle{ F(R) }[/math] is defined to be the set of all pairs [math]\displaystyle{ (p,q) }[/math] in [math]\displaystyle{ S }[/math] × [math]\displaystyle{ S }[/math] such that:

[math]\displaystyle{ \forall \alpha \in \Lambda. \, \forall p' \in S. \, p \overset{\alpha}{\rightarrow} p' \, \Rightarrow \, \exists q' \in S. \, q \overset{\alpha}{\rightarrow} q' \,\textrm{ and }\, (p',q') \in R }[/math] and [math]\displaystyle{ \forall \alpha \in \Lambda. \, \forall q' \in S. \, q \overset{\alpha}{\rightarrow} q' \, \Rightarrow \, \exists p' \in S. \, p \overset{\alpha}{\rightarrow} p' \,\textrm{ and }\, (p',q') \in R }[/math]

Bisimilarity is then defined to be the greatest fixed point of [math]\displaystyle{ F }[/math].

Ehrenfeucht–Fraïssé game definition

Bisimulation can also be thought of in terms of a game between two players: attacker and defender.

"Attacker" goes first and may choose any valid transition, [math]\displaystyle{ \alpha }[/math], from [math]\displaystyle{ (p,q) }[/math]. That is, [math]\displaystyle{ (p,q) \overset{\alpha}{\rightarrow} (p',q) }[/math] or [math]\displaystyle{ (p,q) \overset{\alpha}{\rightarrow} (p,q') }[/math]

The "Defender" must then attempt to match that transition, [math]\displaystyle{ \alpha }[/math] from either [math]\displaystyle{ (p',q) }[/math] or [math]\displaystyle{ (p,q') }[/math] depending on the attacker's move. I.e., they must find an [math]\displaystyle{ \alpha }[/math] such that: [math]\displaystyle{ (p',q) \overset{\alpha}{\rightarrow} (p',q') }[/math] or [math]\displaystyle{ (p,q') \overset{\alpha}{\rightarrow} (p',q') }[/math]

Attacker and defender continue to take alternating turns until:

  • The defender is unable to find any valid transitions to match the attacker's move. In this case the attacker wins.
  • The game reaches states [math]\displaystyle{ (p,q) }[/math] that are both 'dead' (i.e., there are no transitions from either state) In this case the defender wins
  • The game goes on forever, in which case the defender wins.
  • The game reaches states [math]\displaystyle{ (p,q) }[/math], which have already been visited. This is equivalent to an infinite play and counts as a win for the defender.

By the above definition the system is a bisimulation if and only if there exists a winning strategy for the defender.

Coalgebraic definition

A bisimulation for state transition systems is a special case of coalgebraic bisimulation for the type of covariant powerset functor. Note that every state transition system [math]\displaystyle{ (S, \Lambda, \rightarrow) }[/math] is bijectively a function [math]\displaystyle{ \xi_{\rightarrow} }[/math] from [math]\displaystyle{ S }[/math] to the powerset of [math]\displaystyle{ S }[/math] indexed by [math]\displaystyle{ \Lambda }[/math] written as [math]\displaystyle{ \mathcal{P}(\Lambda \times S) }[/math], defined by [math]\displaystyle{ p \mapsto \{ (\alpha, q) \in \Lambda \times S : p \overset{\alpha}{\rightarrow} q \}. }[/math]

Let [math]\displaystyle{ \pi_i \colon S \times S \to S }[/math] be [math]\displaystyle{ i }[/math]-th projection mapping [math]\displaystyle{ (p, q) }[/math] to [math]\displaystyle{ p }[/math] and [math]\displaystyle{ q }[/math] respectively for [math]\displaystyle{ i = 1, 2 }[/math]; and [math]\displaystyle{ \mathcal{P}(\Lambda \times \pi_1) }[/math] the forward image of [math]\displaystyle{ \pi_1 }[/math] defined by dropping the third component [math]\displaystyle{ P \mapsto \{ (\alpha, p) \in \Lambda \times S : \exists q . (\alpha, p, q) \in P \} }[/math] where [math]\displaystyle{ P }[/math] is a subset of [math]\displaystyle{ \Lambda \times S \times S }[/math]. Similarly for [math]\displaystyle{ \mathcal{P}(\Lambda \times \pi_2) }[/math].

Using the above notations, a relation [math]\displaystyle{ R \subseteq S \times S }[/math] is a bisimulation on a transition system [math]\displaystyle{ (S, \Lambda, \rightarrow) }[/math] if and only if there exists a transition system [math]\displaystyle{ \gamma \colon R \to \mathcal{P}(\Lambda \times R) }[/math] on the relation [math]\displaystyle{ R }[/math] such that the diagram

Coalgebraic bisimulation.svg

commutes, i.e. for [math]\displaystyle{ i = 1, 2 }[/math], the equations [math]\displaystyle{ \xi_\rightarrow \circ \pi_i = \mathcal{P}(\Lambda \times \pi_i) \circ \gamma }[/math] hold where [math]\displaystyle{ \xi_{\rightarrow} }[/math] is the functional representation of [math]\displaystyle{ (S, \Lambda, \rightarrow) }[/math].

Variants of bisimulation

In special contexts the notion of bisimulation is sometimes refined by adding additional requirements or constraints. An example is that of stutter bisimulation, in which one transition of one system may be matched with multiple transitions of the other, provided that the intermediate states are equivalent to the starting state ("stutters").[3]

A different variant applies if the state transition system includes a notion of silent (or internal) action, often denoted with [math]\displaystyle{ \tau }[/math], i.e. actions that are not visible by external observers, then bisimulation can be relaxed to be weak bisimulation, in which if two states [math]\displaystyle{ p }[/math] and [math]\displaystyle{ q }[/math] are bisimilar and there is some number of internal actions leading from [math]\displaystyle{ p }[/math] to some state [math]\displaystyle{ p' }[/math] then there must exist state [math]\displaystyle{ q' }[/math] such that there is some number (possibly zero) of internal actions leading from [math]\displaystyle{ q }[/math] to [math]\displaystyle{ q' }[/math]. A relation [math]\displaystyle{ \mathcal{R} }[/math] on processes is a weak bisimulation if the following holds (with [math]\displaystyle{ \mathcal{S} \in \{ \mathcal{R}, \mathcal{R}^{-1} \} }[/math], and [math]\displaystyle{ a,\tau }[/math] being an observable and mute transition respectively):

[math]\displaystyle{ \forall p, q. \quad (p,q) \in \mathcal{S} \Rightarrow p \stackrel{\tau}{\rightarrow} p' \Rightarrow \exists q' . \quad q \stackrel{\tau^\ast}{\rightarrow} q' \wedge (p',q') \in \mathcal{S} }[/math] [math]\displaystyle{ \forall p, q. \quad (p,q) \in \mathcal{S} \Rightarrow p \stackrel{a}{\rightarrow} p' \Rightarrow \exists q' . \quad q \stackrel{\tau^\ast a \tau^\ast}{\rightarrow} q' \wedge (p',q') \in \mathcal{S} }[/math]

This is closely related to the notion of bisimulation "up to" a relation.[4]

Typically, if the state transition system gives the operational semantics of a programming language, then the precise definition of bisimulation will be specific to the restrictions of the programming language. Therefore, in general, there may be more than one kind of bisimulation, (bisimilarity resp.) relationship depending on the context.

Bisimulation and modal logic

Since Kripke models are a special case of (labelled) state transition systems, bisimulation is also a topic in modal logic. In fact, modal logic is the fragment of first-order logic invariant under bisimulation (van Benthem's theorem).

Algorithm

Checking that two finite transition systems are bisimilar can be done in polynomial time.[5] The fastest algorithms are quasilinear time using partition refinement through a reduction to the coarsest partition problem.

See also

Notes

  1. Meaning the union of two bisimulations is a bisimulation.

References

  1. Jančar, Petr and Srba, Jiří (2008). "Undecidability of Bisimilarity by Defender's Forcing". J. ACM (New York, NY, USA: Association for Computing Machinery) 55 (1): 26. doi:10.1145/1326554.1326559. ISSN 0004-5411. https://doi.org/10.1145/1326554.1326559. 
  2. Milner, Robin (1989). Communication and Concurrency. USA: Prentice-Hall, Inc.. ISBN 0131149849. 
  3. Baier, Christel; Katoen, Joost-Pieter (2008). Principles of Model Checking. MIT Press. p. 527. ISBN 978-0-262-02649-9. 
  4. Damien Pous (2005). "Up-to techniques for weak bisimulation". Proc. 32nd ICALP. Lecture Notes in Computer Science (Springer Verlag) 3580: 730–741. 
  5. Baier & Katoen (2008), Cor. 7.45, p. 486.

Further reading

External links

Software tools