Simulation (computer science) explained
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 (
,
, →),where
is a set of states,
is a set of labels and → is a set of labelled transitions (i.e., a subset of
),a relation
is a
simulation if and only if for every pair of states
in
and all labels λ in
:
if
, then there is
such that
Equivalently, in terms of relational composition:
R-1;\overset{λ}{ → } {\subseteq} \overset{λ}{ → };R-1
Given two states
and
in
,
can be
simulated by
, written
, if and only if there is a simulation
such that
. The relation
is called the
simulation preorder, and it is the union of all simulations:
precisely when
for some simulation
.
The set of simulations is closed under union;[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.[2] Note that there can be more than one relation that is both a simulation and a preorder;[3] the term simulation preorder refers to the largest one of them (which is a superset of all the others).
Two states
and
are said to be
similar, written
, if and only if
can be simulated by
and
can be simulated by
. 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).
[4] To witness, consider a similarity that
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
References
- David . Park . 1981 . Concurrency and Automata on Infinite Sequences . Proceedings of the 5th GI-Conference, Karlsruhe . . Deussen, Peter . 167–183 . 104 . . 978-3-540-10576-3 . 10.1007/BFb0017309.
- van Glabbeek . R. J. . The Linear Time – Branching Time Spectrum I: The Semantics of Concrete, Sequential Processes . Handbook of Process Algebra . http://boole.stanford.edu/pub/spectrum1.pdf.gz . 1 . 3–99 . 2001 . Elsevier.
Notes and References
- Meaning the union of two simulations is a simulation.
- Book: Milner, Robin . Robin Milner
. Robin Milner. Communication and Concurrency . 1989 . 0131149849 . Prentice-Hall, Inc. . USA.
- Consider the relations
and
—each is both a simulation and a preorder.
- For an example, see Fig. 1 in Champarnaud. J.-M. Coulon. F.. NFA reduction algorithms by means of regular inequalities. Theoretical Computer Science. 327. 3. 241–253. 2004. 0304-3975. 10.1016/j.tcs.2004.02.048. free.