Simulation (computer science)

From HandWiki
Revision as of 23:26, 6 February 2024 by Gametune (talk | contribs) (link)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

In theoretical computer science a simulation is a relation between state transition systems associating systems that behave in the same way in the sense that one system simulates the other. Intuitively, a system simulates another system if it can match all of its moves.

The basic definition relates states within one transition system, but this is easily adapted to relate two separate transition systems by building a system consisting of the disjoint union of the corresponding components.

Formal definition

Given a labelled 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 relation [math]\displaystyle{ R \subseteq S \times S }[/math] is a simulation 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 \overset{\alpha}{\rightarrow} p' }[/math], then there is [math]\displaystyle{ q \overset{\alpha}{\rightarrow} q' }[/math] such that [math]\displaystyle{ (p',q') \in R }[/math]

Equivalently, in terms of relational composition:

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

Given two states [math]\displaystyle{ p }[/math] and [math]\displaystyle{ q }[/math] in [math]\displaystyle{ S }[/math], [math]\displaystyle{ p }[/math] can be simulated by [math]\displaystyle{ q }[/math], written [math]\displaystyle{ p \, \leq \, q }[/math], if and only if there is a simulation [math]\displaystyle{ R }[/math] such that [math]\displaystyle{ (p, q) \in R }[/math]. The relation [math]\displaystyle{ \leq }[/math] is called the simulation preorder, and it is the union of all simulations: [math]\displaystyle{ (p,q) \in\,\leq\, }[/math] precisely when [math]\displaystyle{ (p, q) \in R }[/math] for some simulation [math]\displaystyle{ R }[/math].

The set of simulations is closed under union;[Note 1] therefore, the simulation preorder is itself a simulation. Since it is the union of all simulations, it is the unique largest simulation. Simulations are also closed under reflexive and transitive closure; therefore, the largest simulation must be reflexive and transitive. From this follows that the largest simulation — the simulation preorder — is indeed a preorder relation.[1] Note that there can be more than one relation which is both a simulation and a preorder;[Note 2] the term simulation preorder refers to the largest one of them (which is a superset of all the others).

Two states [math]\displaystyle{ p }[/math] and [math]\displaystyle{ q }[/math] are said to be similar, written [math]\displaystyle{ p \leq\geq q }[/math], if and only if [math]\displaystyle{ p }[/math] can be simulated by [math]\displaystyle{ q }[/math] and [math]\displaystyle{ q }[/math] can be simulated by [math]\displaystyle{ p }[/math]. Similarity is thus the maximal symmetric subset of the simulation preorder, which means it is reflexive, symmetric, and transitive; hence an equivalence relation. However, it is not necessarily a simulation, and precisely in those cases when it is not a simulation, it is strictly coarser than bisimilarity (meaning it is a superset of bisimilarity).[Note 3] To witness, consider a similarity which is a simulation. Since it is symmetric, it is a bisimulation. It must then be a subset of bisimilarity, which is the union of all bisimulations. Yet it is easy to see that similarity is always a superset of bisimilarity. From this follows that if similarity is a simulation, it equals bisimilarity. And if it equals bisimilarity, it is naturally a simulation (since bisimilarity is a simulation). Therefore, similarity is a simulation if and only if it equals bisimilarity. If it does not, it must be its strict superset; hence a strictly coarser equivalence relation.

Similarity of separate transition systems

When comparing two different transition systems (S', Λ', →') and (S", Λ", →"), the basic notions of simulation and similarity can be used by forming the disjoint composition of the two machines, (S, Λ, →) with S = S' ∐ S", Λ = Λ' ∪ Λ" and → = →' ∪ →", where ∐ is the disjoint union operator between sets.

See also

Notes

  1. Meaning the union of two simulations is a simulation.
  2. Consider the relations [math]\displaystyle{ \{\} }[/math] and [math]\displaystyle{ \{(0, 0)\} }[/math] — each is both a simulation and a preorder.
  3. For an example, see Fig. 1 in Champarnaud, J.-M; Coulon, F. (2004). "NFA reduction algorithms by means of regular inequalities". Theoretical Computer Science 327 (3): 241–253. doi:10.1016/j.tcs.2004.02.048. ISSN 0304-3975. 

References

  1. Park, David (1981). "Concurrency and Automata on Infinite Sequences". in Deussen, Peter. 104. Springer-Verlag. pp. 167–183. doi:10.1007/BFb0017309. ISBN 978-3-540-10576-3. http://wrap.warwick.ac.uk/47224/1/WRAP_Park_cs-rr-035.pdf. 
  2. van Glabbeek, R. J. (2001). "The Linear Time – Branching Time Spectrum I: The Semantics of Concrete, Sequential Processes". Elsevier. pp. 3–99. 



  1. Milner, Robin (1989). Communication and Concurrency. USA: Prentice-Hall, Inc.. ISBN 0131149849.