tmp79F5 TMP
tmp79F5 TMP
tmp79F5 TMP
Christian Rohr
I. M OTIVATION
Stochastic Petri Nets (SPN) [1] and Generalized Stochastic
Petri Nets (GSPN) [2] are frequently used formalisms to model
and analyze concurrent systems. In the last three decades they
have specifically been used in technical application domains
to investigate, e.g., communication protocols or manufacturing
systems [3, 4]. An SPN associates firing rates to transitions
of the underlying qualitative Petri net and can be seen as a
high-level description of a Continuous-Time Markov Chain
(CTMC). The SPN class can be generalized to GSPN by
adding so-called immediate transitions, which immediately
fire when becoming enabled. States with enabled immediate
transitions have a zero sojourn time and are called vanishing
states. The GSPNs semantics is not a CTMC anymore, but
can still be reduced to it.
The structural description of (G)SPNs and their Markovian
semantics offer the modeler a large variety of qualitative and
quantitative analysis methods which have been implemented
in numerous software tools. Many methods consider the set
of reachable states and thus suffer from the state space
explosion problem. Symbolic approaches relying on Decision
Diagrams (DD), e.g., Binary Decision Diagrams (BDD) [5]
or related generalizations, permit qualitative reasoning over
reachable states in new dimensions (beyond 1028 states [6]).
This includes also model checking of, e.g., CTL formulas.
However, quantitative analyses of the induced CTMC require efficient processing of the state transitions which are
weighted with real values. Kronecker algebra [4] or generalizations of BDDs, such as Multi-Terminal Decision Diagrams
(MTDD), allow for the analysis of models of remarkable state
978-0-7695-4491-5/11 $26.00 2011 IEEE
DOI 10.1109/QEST.2011.19
91
II. T HE TOOL
In the following we assume basic knowledge of the Petri
net formalism. A general introduction can be found in [2], a
tutorial tailored to Systems Biology in [8].
B. Implementation
In the following we present the basic tool architecture,
which is depicted in Fig. 2. We will sketch the main ideas behind the single components which have been considered during
MARCIEs development to achieve highly efficient analysis
capabilities. In this paper we will concentrate on quantitative
analysis aspects because this is the most challenging part.
A. Overview
MARCIE is a tool for GSPN analysis, supporting qualitative
and quantitative analyses including model checking facilities.
Particular features are symbolic state space analysis including
efficient saturation-based state space generation, evaluation of
standard Petri net properties as well as CTL model checking.
Further it offers symbolic CSL model checking and permits
to compute reward expectations. Most of MARCIEs features
are realized on top of an IDD implementation [11]. IDDs are
used to efficiently encode interval logic functions representing
marking sets of bounded Petri nets. Thus, MARCIE falls
into the category of symbolic analysis tools as SMART [15]
and PRISM [16]. However, recently it has been extended by
approximative and simulative engines, which work explicitly,
to support also stochastic analysis of unbounded nets.
MARCIE is entirely written in C++, and uses the libraries
GMP, pthreads flex/bison and boost. It comprises about 40, 000
source lines of code. MARCIE is available for non-commercial
use; we provide statically linked binaries for Mac OS X
and Linux. The tool, the manual and a benchmark suite
can be found on our website http://www-dssz.informatik.tucottbus.de/DSSZ/Software/Marcie. Currently, MARCIE itself
comes with a textual user interface. Options and input files can
also be specified by a generic Graphical User Interface (GUI)
Fig. 1.
.csl
.rw
.apnn
.po/.to
APNN
Orders
.ctl
Parser
Marcie
(9)
Rewards
CSL
Approximative
CTMC
Analysis (7)
CTL
GSPN
CTL
Representation (1)
Gillespie
FAU
Place/Transition
CSL
Model Checker (8)
Quantitative
Statespace
Analysis (4)
Order
Generator (3)
Exact CTMC
Analysis (6)
Uniformization
Jacobi
GaussSeidel
PseudoGauss
Seidel
Qualitative
Analysis
Analysis
Yes/No
probabilities
Fig. 2.
Place/Transition
Traces
.csv
BFS
Chaining
Saturation
Interval Decision
Diagram
Engine (2)
Order
.po/to
Liveness
Reversibility
#States
#Dead States
Yes/No
92
4) State Space Analysis: Bounded Petri nets can be analysed based on the knowledge of all states, which are reachable
from the initial marking. Thus the first step is often to construct
the state space. MARCIE implements three different state
space generation algorithms upon its IDD engine.
1) Common Breadth-First Search (BFS): an iteration fires
sequentially all transitions (according to the transition
ordering) before adding the new states to the state space.
2) Transitions chaining: like BFS, but the state space is
updated after the firing of each single transition.
3) Saturation algorithm (SAT): transitions are fired in conformance with the decision diagram, i.e. according to
an ordering, which is defined by the variable ordering.
A transition is saturated if its firing does not add new
states to the current state space. Transitions are bottomup saturated (i.e. starting at the terminal nodes and going
towards the root). Having fired a given transition, all preceding transitions have to be saturated again, either after
a single firing (single) or the exhausted firing (fixpoint)
of the current transition.
Having the state space, MARCIE permits to find dead states
and to decide reversibility and liveness of transitions, which
involves a symbolic decomposition of the state space into
strongly connected components.
#!
%"&'(
%+&))(
%*&+(
#$
%"&'(
Fig. 3.
%'&))(
"
93
Transient probabilities. The computation of transient probabilities can be achieved by solving the system of Kolmogorov
differential equations, which can be done using different methods, as for instance uniformization, Krylov subspace methods,
or ordinary differential equations [23]. When dealing with very
large and cyclic CTMCs, as it is often the case, the method
of choice is uniformization. The basic idea is to embed a
discretization of the CTMC into a Poisson process. Doing so,
the computation of the transient probability distribution for a
specific time point reduces to that of Discrete Time Markov
Chains (DTMCs), which can be done by a repeated matrixvector multiplication. MARCIE provides multi-threaded transient analysis based on uniformization.
Steady state probabilities. The computation of a steady
state probability distribution requires to solve a homogeneous
system of equations. In the light of a symbolic matrix representation, iterative methods as Jacobi and Gauss-Seidel are
favoured over direct methods as Gauss elimination, because
they do not change the matrix. Currently, MARCIE offers a
multi-threaded Jacobi solver and a Gauss-Seidel solver. The
Gauss-Seidel method requires a single computation vector
and converges in many cases much faster than Jacobi, but
requires a row-wise extraction of the matrix entries. MARCIEs caching approach does not allow an efficient rowwise extraction. As a compromise, MARCIE also provides
a Pseudo-Gauss-Seidel solver [28].
Rewards. Often it is not sufficient to just reason about the
probability to be in a certain state at a certain time point
or in steady state. The expected time spent in certain states,
the expected number of transition firings within a given time
interval, and comparable measures can be of interest, too.
For this purpose, it is possible to extend a stochastic Petri
net to a stochastic reward net [29] by adding rewards, which
define additional measures; they can be associated to states and
transitions. A reward for a given state will be accumulated and
weighted with its sojourn time. A transition reward is acquired
each time a transition fires.
MARCIE supports the addition of rewards to a GSPN by
loading a set of reward structures. A reward structure is a set
of reward items state reward items and transition reward
items. A reward item must specify a set of states by means
of an interval logic function and a possibly state-dependent
reward function defining the actual reward value.
MARCIE represents rewards internally as additional, implicit Petri net transitions, which allows us to apply the onthe-fly approach also to compute rewards; see [14].
Immediate transitions. All quantitative analyses can be
applied without any exception to GSPNs. In this case, the
on-the-fly engine has also to consider the vanishing states,
which may represent the majority of reachable states, as
one can see in Table II. This will substantially increase the
memory effort. MARCIE needs an additional computation step
to propagate the probabilities from the vanishing states to the
tangible states. In summary, dealing with GSPNs is much more
expensive, and we recommend, if possible, to transform the
GSPN in a SPN as proposed in [2].
94
7) Approximative CTMC Analysis: Exact quantitative analyses consider all reachable states and all state transitions of
a GSPN; thus they are restricted to finite state spaces. But
in many cases, even the analysis of bounded models is not
feasible. Moreover, the investigated models may be unbounded
as it is often the case in many fields, among them Systems and
Synthetic Biology. Then approximative techniques may help,
which use just a finite and often very small subset of all states.
MARCIE supports two such techniques.
Approximative numerical analysis. To overcome the problem of an unmanageable state space size, the approximative
numerical analysis prunes insignificant states. The basic idea
is to combine a breadth-first variant of the state space construction with a transient analysis using uniformization. During
construction, all explored states having a probability below
a specified threshold will be removed from the current state
space. Thus, only a finite subset of a possibly infinite state
space will be considered. This sliding window method [30]
can be further enhanced by a technique called adaptive uniformization, where the Poisson process is replaced by a birth
process. This combination was first introduced in [31] as fast
adaptive uniformization (FAU). In contrast to the exact CTMC
analysis (see component 6), MARCIEs implementation of this
algorithm uses an explicit state space representation.
Simulation. If the approximate numerical analysis exceeds
the available memory, the method of choice has to be simulation. MARCIE provides the stochastic simulation algorithm
introduced by Gillespie [32]. It generates paths of finite length
of a possibly infinite CTMC. Unlike for the numerical analysis, the memory consumption of the simulation is constant,
because only the current state is hold in memory.
Generally it is necessary to perform a sufficient amount of
simulation runs due to the variance of the stochastic behaviour.
We choose the confidence interval method as described in [33]
to determine the required number of simulation runs. The user
can specify the confidence interval by defining the confidence
level, usually 95% or 99%, and the estimated accuracy, e.g.,
1103 or 1104 . MARCIE calculates the required number
of simulation runs to achieve this confidence interval. Besides
that, the user can manually set the number of simulation runs.
Each simulation run is done independently of the others.
Thus, it is not challenging to parallelize stochastic simulations.
MARCIE provides a multi-threaded simulation engine.
Immediate Transitions. The approximative numerical analysis as well as the simulation are capable of handling immediate transitions. The approximative numerical analysis has to
handle two types of states for this purpose. Besides tangible
states (only stochastic transition are enabled), vanishing states
can appear, where one or more immediate transitions are
enabled. Vanishing states are processed as soon as they occur,
because of the (per definition) higher priority of immediate
transitions.
The simulative processing of immediate transitions is rather
straightforward, see [34] for details. MARCIEs stochastic
simulation can not only deal with GSPN, but can also analyse
eXtended Stochastic Petri Nets (XSPN); see [35] for details.
95
IV. C OMPARISON
In this section we provide benchmark results to empirically
prove MARCIEs efficiency. We concentrate on quantitative
analyses and use CSL properties to trigger the computation of
transient and steady state probabilities. We will compare our
performance results with PRISM using five different stochastic
Petri nets. Besides established CTMC benchmarks we will also
use two models from Systems Biology.
All Petri net models have been done with our Petri net editor
Snoopy [19] and are available on our website http://wwwdssz.informatik.tu-cottbus.de/DSSZ/Examples. There we also
provide Petri nets for further biochemical models which we
have previously used as benchmarks [12, 35].
A. Case Studies
We will use the following technical systems.
FMS. The Flexible Manufacturing System with three machines has been published in [3]. The original model contains
immediate transitions; thus it is a GSPN. As discussed, our
exact CTMC analysis engine suffers from immediate transitions, and PRISM does not support immediate commands.
Thus we will consider a pure SPN model which has been
derived from the GSPN model by applying the elimination
rules for immediate transitions given in [2]. Furthermore, the
FSM model contains arcs with marking-dependent weights.
MARCIE does not support such arcs as they potentially
destroy the locality principle. Instead, our model simulates
the marking dependencies by additional transitions, each representing a specific firing situation in the original model. The
FMS is scalable concerning the number of items which can
be processed by the machines. The places P 1, P 2 and P 3
carry initially N tokens. The model can be easily scaled
be increasing the value of N . Our SPN model is limited
to N = 15 due to the explicit modelling of the markingdependent arcs.
Kanban. The kanban system has been used in [4] to
demonstrate efficient CTMC encoding and solution using the
Kronecker approach. The model is scalable by the initial
marking.
PSS. The SPN model of a polling server system has been
derived from that given in the PRISM case study collection
which is based on [45]. The model is scalable by the number
of stations communicating with the server. Thus scalability is
here given by the net structure, not only by the initial marking.
Additionally, we use the following models from Systems
Biology.
AKAP. This model, see Fig. 4, of the AKAP scaffoldmediated crosstalk between the cAMP and the Raf1/MEK/ERK pathways has been specified and analysed using
PRISM in [46]. The AKAP model is scalable by the initial
marking and the arc weights.
96
TABLE I
S IZE OF THE REACHABILITY GRAPHS FOR DIFFERENT MODEL
CONFIGURATIONS . R EACHABILITY GRAPH AND CTMC ARE ISOMORPHIC
IF THERE ARE NO PARALLEL TRANSITIONS . T HE REACHABILITY GRAPHS
OF THE AKAP MODEL CONTAIN SUCH PARALLEL TRANSITIONS .
model
,!-.
<AB;<AB .$%& <C:5
,!-.
<AB;<AB C:5
:,/0?:/7 .@! #
2##"
2"""
F MS
4
<AB;<AB .$%&
2"#"
4
2###
2#""
4
,!-.
2#"#
67>7:;7#,!-.
""
4
..
Kanban
.. 87<AB;<AB <.$%& #
2"##
87<AB;<AB( C:5
2""#
,!-.
P SS
AKAP
4
.$%& .
.$%&
/0,1
<AB;<AB 3 .$%&
.. 3
4
5677 .$%& 8796:87; ,!-.
,!-.
""
2##
4
87<AB;<AB 3 C:5
4
2""
""
#"
AN G
67>7:;7#,!-. 3
<AB;<AB 3 C:5
:,/0?:/7 3 .@! #
#
5677 <.$%& 8796:87; ,!-.
| states |
810
35,910
537,768
4,459,455
25,397,658
111,414,940
403,259,040
4,600
454,475
11,261,376
133,865,325
240
15,360
737,280
31,457,280
1,632,240
15,611,175
74,612,328
386,805,104
5,384
2,413,480
277,789,578
| transitions |
3,699
237,120
4,205,670
38,533,968
234,523,289
1,078,917,632
4,047,471,180
28,120
3,979,850
115,708,992
1,507,898,700
800
89,600
6,144,000
340,787,200
12,691,360
141,398,580
734,259,344
4,116,788,172
26,193
21,810,412
24,813,347,031
80553;7( 0= ,!-.
4
""4
#"4!"
""4
TABLE II
T HE EVOLUTION OF THE STATE SPACE OF THE FMS MODEL GIVEN AS
SPN AND GSPN. |Sq | DENOTES THE NUMBER OF STATES WHEN
COMPLETELY CONSIDERED QUALITATIVELY, I . E . IMMEDIATE
TRANSITIONS ARE NOT PRIORIZED OVER STOCHASTIC TRANSITIONS . A
2"#
N
2
4
6
8
10
12
14
2
4
6
8
5
10
15
20
3
4
5
6
2
4
6
,!-.
..
2#"
N
2
4
6
8
10
B. Experiments
All computational experiments were done on a 82.26 Mac
Pro workstation with 32GB RAM running Cent OS 5.5. We
restricted all experiments to a run-time of at most 12 hours.
We considered for all models different state spaces which
are shown in Table I. MARCIEs capabilities concerning state
space generation and CTL model checking are not appropriately reflected by these figures. For instance, MARCIE is able
to compute the state space for the FMS and Kanban model
up to N = 300 which means to have about 3.65 1028 or
2.65 1024 states [6].
However, in this paper we focus on the quantitative analysis;
thus the feasible model size is limited by the memory effort for
the probability vectors. On our test system this would permit
to consider models as Kanban, N=10, with about 1109 states,
depending on the used solver. For the FSM we use the SPN
model which permits a more efficient analysis as explained in
Section II-B6.
All experiments were triggered by CSL formulas, which
possibly refer to model-specific reward structures. The CSL
formulas and reward structures are available on our website.
Our numerical experiments can be divided into three categories.
|Sq |
3,444
438,600
15,126,440
248,002,785
2,501,413,200
|S|
2,202
138,060
2,519,580
|Sv |
1,392
102,150
1,981,812
|St |
810
35,910
537,768
4,459,455
25,397,658
97
TABLE III
T OTAL RUN - TIME FOR STEADY STATE ANALYSIS INCLUDING STATE SPACE GENERATION , INITIALIZATION , REWARD COMPUTATION - IF NECESSARY, AND
PROBABILITY COMPUTATION . T HE NUMBER OF REQUIRED ITERATIONS IS GIVEN IN THE COLUMNS iter. T HE LAST TWO COLUMNS SHOW RESULTS OF
PRISM USING ITS HYBRID AND SPARSE ENGINE . I F POSSIBLE WE USED THE JACOBI SOLVERS . F OR THE K ANBAN AND ANG MODELS WE USED THE
G AUSS -S EIDEL SOLVERS . T HE NUMBER OF ITERATIONS REQUIRED BY THE G AUSS -S EIDEL SOLVERS DIFFER BETWEEN MARCIE AND PRISM BECAUSE
OF DIFFERENT VARIABLE ORDERS .
model
F MS
Kanban
P SS
AKAP
AN G
N
2
6
10
12
14
2
4
6
8
10
15
20
4
5
6
2
3
4
MARCIE
PRISM
1
2
4
8
iter
hybrid
1s
1s
1s
1
378
2s
59s
42s
57s
34s
1,084
41s
1h11m15s
45m07s
30m31s
24m47s
1,812
2h25m42s
6h13m53s
3h52m32s
2h26m17s
2h04m45s
2,193
9h10m04s
1s
189
2
15s
Gauss-Seidel
323
12s
11m07s
no multi-threading support
622
9m48s
3h57m23s
999
3h27m27s
1s
1s
1s
1s
406
2s
14s
9s
5s
3s
657
24s
16m16s
10m58s
6m21s
3m08s
920
31m28s
21m17s
13m07s
7m04s
4m40s
1,433
17m37s
1h46m52s
1h05m12s
37m39s
23m03s
8h00m02s
3h53m29s
2h43m48s
48s
n.a.
4m05s
1s24m55s
Gauss-Seidel
no multi-threading support
iter
378
1,084
1,812
2,193
2,589
48
122
224
356
406
657
920
1,433
1,348
1,659
n.a.
n.a.
n.a.
sparse
3s
30s
37m15s
3h32m11s
2s
10s
6m18s
1h59m59s
2s
21s
26m31s
17m08s
28s
4) Approximative Analysis: For the fast adaptive uniformization as well as the simulation we use the CSL template
P=? [F [t, t] place = N ] which computes the probability to be
in a state satisfying the model-dependent state property that
place has N token at time point t when starting in the initial
state. We used the same places as for the transient analysis.
Results. Table V shows the total run-time for transient analysis using simulation in MARCIE and PRISM. The stochastic
98
TABLE IV
T OTAL RUN - TIME FOR TRANSIENT ANALYSIS INCLUDING STATE SPACE GENERATION , INITIALIZATION AND PROBABILITY COMPUTATION . T HE COLUMN
iter GIVES THE NUMBER OF REQUIRED ITERATIONS . T HE LAST TWO COLUMNS SHOW PRISM RESULTS USING ITS HYBRID AND SPARSE ENGINE .
model
N
8
F MS
10
12
14
4
Kanban
6
8
10
P SS
15
20
4
AKAP
5
6
4
AN G
5
6
Marcie
PRISM
1
2
4
8
hybrid
sparse
2m27s
2m28s
1m51s
1m28s
3m47s
2m50s
13m11s
9m44s
7m51s
8m22s
27m39s
15m57s
55m54s
42m41s
31m56s
29m57s
2h10m47s
1h39m05s
4h07m51s
3hm35ms07s
2h48m59s
2h41m41s
8h26m38s
OutOfMemory
6s
3s
2s
2s
12s
8s
1m57s
1m34s
48s
34s
5m16s
3m09s
23m59
17m53s
9m18s
6m41s
1h08m15s
43m23s
1s
1s
1s
1s
2s
2s
17s
7s
4s
3s
33s
17s
9m02s
5m32s
2m59s
2m06s
29m18s
14m22s
25m15s
17m09s
7m49s
5m13s
52m20s
24m12s
2h40m14s
1h34m36s
47m54s
30m26s
5h44m53s
3h49m45s
1m53s
1m18s
54s
44s
2m27s
7m24s
31m08s
20m50s
13m45s
11m46s
34m06s
4h25m34s
7h36m57s
4h39m52s
3h17m47s
3h00m16s
TABLE V
T OTAL RUN - TIME FOR SIMULATIONS DONE WITH MARCIE AND PRISM.
T HE CONFIDENCE LEVEL IS 99%, THE DESIRED ACCURACY 1 105 ,
WHICH LEADS TO 66, 348, 303 SIMULATION RUNS .
model
F MS
14
Kanban
10
10
P SS
20
AKAP
AN G
Threads
1
8
1
8
1
8
1
8
1
8
MARCIE
40m43s
5m4s
13m48s
1m58s
4h10m4s
31m53s
2m37s
25s
38m48s
5m20s
PRISM
3h24m13s
n.a.
2h23m58s
n.a.
62h32m33s
n.a.
10m23s
n.a.
8h26m57s
n.a.
N
14
10
20
6
6
t
1
10
1
1
1
time
29s
8m46s
33s
3s
42m21s
|Sappr |
821,199
20,444,464
296,991
81,657
12,619,037
R EFERENCES
|S|
403,259,040
1,005,927,208
31,457,280
386,805,104
277,789,578
[1] P. M. Merlin and D. J. Farber, Recoverability of communication protocols - implications of a theoretical study, IEEE
Transactions on Communications, vol. 24, no. 9, pp. 1036
1043, 1976.
[2] M. A. Marsan, G. Balbo, G. Conte, S. Donatelli, and G. Franceschinis, Modelling with Generalized Stochastic Petri Nets. Wiley Series in Parallel Computing, John Wiley and Sons, 1995,
2nd Edition.
[3] G. Ciardo and K. S. Trivedi, A Decomposition Approach
for Stochastic Reward Net Models, Performance Evaluation,
vol. 18, no. 1, pp. 3759, 1993.
[4] G. Ciardo and M. Tilgner, On the use of Kronecker operators
for the solution of generalized stocastic Petri nets, Institute
for Computer Applications in Science and Engineering, ICASE
Report 96-35, 1996.
99
[28]
[29]
[30]
[31]
[32]
[33]
[34]
[35]
[36]
[37]
[38]
[39]
[40]
[41]
[42]
[43]
[44]
[45]
[46]
[47]
100