<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Transient Analysis Of Stochastic Petri Nets With Interval Decision Diagrams</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Martin Schwarick ms@informatik.tu-cottbus.de</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Brandenburg University of Technology Cottbus</institution>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>This paper presents an Interval Decision Diagram (IDD) based approach to realize symbolically transient analysis of Continuous Time Markov Chains (CTMC) which are derived from stochastic Petri nets. Matrix-vector and vector-matrix multiplication are the major tasks when doing exact analysis of CTMCs. We sketch a simple algorithm which uses explicitly the Petri net structure and offers the opportunity of parallelization. We present results computed with our first prototype implementation.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Motivation</title>
      <p>
        Stochastic Petri nets are a natural way to model biochemical networks, where
token values are interpreted as levels of concentration [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. A stochastic Petri
net’s semantics is a CTMC which can be analysed applying steady-state and
transient analysis [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] or CSL [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] model checking. The tool of choice for these
purposes is often the probabilistic model checker PRISM [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], which seems to
represent the current state of the art. The description of stochastic Petri nets
can be translated into the PRISM language, as done in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. To face the problem
of state space explosion PRISM uses an engine based on Multi Terminal Binary
Decision Diagrams (MTBDD) and symbolically performs analysis.
Using PRISM’s MTBDD based approach in the context of stochastic Petri nets
with a level semantics has several drawbacks; prior knowledge about
boundedness of each place is required. A place which can carry up to k token must be
represented by |ld(k)| MTBDD variables. This results in an overhead in
computation time and memory. Since a token represents a concentration level increasing
the accuracy of analysis implies an increase of the possible number of tokens on
places. PRISM creates an MTBDD which represents the entire CTMC. Therefore
it is necessary to double the number of MTBDD variables. A further drawback
occurs if the CTMC contains many different rate values, since the number of
terminal nodes in the MTBDD equals this amount.
      </p>
      <p>
        A. Tovchigrechko introduced in [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] very efficient algorithms for the state space
based analysis of bounded Petri nets using IDDs. We combine the ideas and
algorithms in [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ][
        <xref ref-type="bibr" rid="ref5">5</xref>
        ][
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] and use a slightly augmented form of IDDs to realize
transient analysis of stochastic Petri nets. In section 3 we will sketch how it works.
But before that we will briefly recall the most important concepts.
      </p>
    </sec>
    <sec id="sec-2">
      <title>Preliminaries</title>
      <p>
        In a stochastic Petri net an exponentially distributed firing rate is associated to
each transition which is generally defined by a state-dependent hazard function.
Since we consider mass action kinetics [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] this hazard function is defined as the
product of a specific constant and the token values of the transition’s preplaces
of the state. The semantics of a stochastic Petri net is a CTMC which can be
seen as a graph isomorphic to the reachability graph of the underlying Petri net,
but state transitions are labeled with the firing rates. In general, CTMCs are
represented as very sparse matrices indexed by states, which entries are real
valued rates. Transient analysis determines for each state how probable it is to be in
it at a certain time point. An established technique to realize transient analysis
of CTMCs is the uniformization method [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Its basic operation is vector-matrix
multiplication which must be done for a certain number of iterations.
Faced with the state space explosion problem, it is not worth thinking about
implementing vector-matrix multiplication explicitly whereby the matrix and the
vector are indexed by states.
      </p>
      <p>In our approach the set of states is represented by an Interval Decision
Diagram. We compute all needed data at each iteration anew from one augmented
IDD representing the reachable states. That is the main difference to PRISM’s
approach, where the CTMC’s state space and its rate matrix are represented
symbolically by a BDD and a MTBDD.</p>
      <p>We will give a brief and informal introduction to IDDs:
[#0,01)
[3,4)
# 1
[1,2)
# 2
n4(p3)
[2,3)
# 1
n1(p2)[2,oo)</p>
      <p># 1
[#1,02)
[0,1) [#0,01)
# 0
1
[0,2)
# 0
n7(p1)
[2,3)
#4
[3,oo)
# 2
[1,2)
# 0
n2(p2)
[1#,o1o)
[0,1)
#0
0
[#35,4)
[4,oo)
# 6
n5(p3)</p>
      <p>n6(p3)
[#0,01)
[0,1)
# 0
[2,oo)
# 1
[1,oo)
# 1
3
Fig. 1: A Petri net and the IDD RS representing its reachable states. The path n7 −→
n6 −→ n2 −→ 1 represents state m ≡ (p1 : 3, p2 : 0, p3 : 0). The path n7 −→1 n4 −→1 n1 −→1 1
0 0
represents state m′ ≡ (p1 : 1, p2 : 1, p3 : 1) which can be reached from m by firing
transition t2. Edges are labeled with an interval and the additional index data.
An IDD is a rooted, directed and acyclic graph which nodes can have any number
of outgoing edges. Each edge is labeled with a left closed and right open interval
on N. The intervals of the outgoing edges of an IDD node define a partition of N.
There are two nodes without outgoing edges: the terminal nodes, labeled with
ONE and ZERO. To each IDD node a variable is associated, in our context a
place of the stochastic Petri net. We assume that on each way from the root to a
terminal node, the variables occur in the same order. As for BDDs the variable
ordering influences the IDD size. Furthermore we assume, that the IDD does not
contain isomorphic subgraphs. A sequence of IDD nodes considering connecting
edges reaching the ONE-terminal node represents a set of states. We will denote
a path as such a sequence while chosing exactly one value from the interval of
the occuring edges.</p>
      <p>In the following section we will present an algorithm which performs
vectormatrix (or vice versa) multiplication, whereby the matrix is defined by the
reachable states of a stochastic Petri net, using only the IDD represenation and the
net structure.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Multiplication by traversing</title>
      <p>To realize a matrix-vector or a vector-matrix multiplication, whereby the matrix
and the vector are indexed by states, we need a mapping from states to indices.
The depth first search traversation of an IDD induces a lexicographic order of
its represented states. Since a state is an unique path to the ONE-terminal node
we must store some information for each outgoing edge which enables the index
computation. For each edge we store the number of lexicographic smaller states,
which can be reached over all its previous sibling edges of the respective node
(See Fig. 1). We can also determine the number of states, which can be reached
over an arbitrary edge.</p>
      <p>The basic concept of our algorithm is to traverse for each transition t of the
stochastic Petri net the IDD ESt representing its enabling states. For each path
in ESt the IDD RS respresenting the reachable states contains a respective
path. We can easily determine the lexicographic index for the associated state
m using the additional index data during traversation. Since m is an element of
ESt there exists a path in RS, which represents the state m′, reached by firing
of transition t in m. While traversing the IDD ESt we track the paths for m
and m′ in RS and compute their indices considering all reachable states. Each
time the ONE-terminal has been reached we extract the indices of a matrix
entry. Furthermore we must determine the associated rate value. Considering mass
action kinetics implies to multiply the present rate with the current element of
an expanded interval if the current IDD node is related to a preplace of t.
The resulting recursive algorithm below should be self-explanatory. All used
functions can be implemented very efficiently. The function getW eight(p : P lace,
t : T ransition) returns the token change, the firing of t causes on p. If p is a
preplace for instance, the return value would be negative.
var
transition, t : Transition;
j: int;
procedure traverse (IDD_Node root, IDD_Node src, IDD_Node dest,
src_index int, dest_index int, rate double)
/* the following program code can be parallelized*/
for 0 &lt;= j &lt; SPN.transitions() do
t = SPN.getTransition(j);
traverse(ESt.root, RS.root, RS.root, 0, 0, t.rate);
end //for</p>
      <p>
        As for every implementation of decision diagrams, efficiency depends on
considering redundancies. In general nodes on inner IDD levels will be visited many times.
Subpaths beginning in these nodes will be traversed each time anew. Like in [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] we set
a certain IDD level and cache index and rate information for each of its nodes about
all paths containg these IDD nodes. For shortage of space we must omit further details
considering used data structures. Each time a node of this cache level has been reached,
only the cached data must be processed. The remaining problem is to find an adequate
level. Moving the cache level towards the root speeds up the computation at the cost
of an increased memory consumption as can be seen in Table 1. We hope to find good
heuristics based on the IDD structure and the Petri net structure.
      </p>
      <p>This traversation algorithm can be applied concurrently for more than one transition.
We have to care about synchronization of write access to the result vector only.
Currently we realize this synchronization by allocating a result vector for each thread which
performs traversation. When the traversation for all transitions is finished, result data
must be gathered before the next iteration starts.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Results</title>
      <p>
        We now present results obtained with our prototype, which is based on an IDD
implementation of A. Tovchigrechko. Our biochemical model is the extended ERK pathway
from [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. The test system is a Dual Core Intel Xeon with 2,1 GHz and 2 GB main
memory running a 64 Bit Linux. We made transient analysis for one second for the
eight level version. The CTMC has 6,110,643 states and 78,948,888 transitions. The
transient analysis requires 218 iterations. We compared the time per iteration and the
memory usage obtained by using our tool on one and two cores with PRISM 3.2 (hybrid
engine) as can be seen in Table 1. Currently our implementation requires significant
more memory than PRISM. This is in dept to our current cache data implementation
and the synchronization technique. Table 1 also underlines the impact of the cache
level to iteration time and memory usage.
      </p>
      <p>
        idd transient
number of cores 1
cache level 10 8
time per iteration (sec) 1.29 1.90
memory (MB) 534 408
In the near future a bulk of work has to be done to enhance functionality and
performance of our prototype.
functionality: As introduced in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] and realized in PRISM we want to implement CSL
model checking.
      </p>
      <p>
        Presently only mass action kinetics are implemented. In the future our tool should
handle arbitrary hazard functions as they can be specified with our Petri net editor
Snoopy [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ].
performance: One example for a performance improvement is transition grouping.
Instead of one traversation for each transition we could group several transitions
together and traverse the IDD for this transition group. Doing so should reduce the
traversation effort and should have an effect like loop blocking resulting in better
usage of the CPU’s cache memory. First experiments provided promising results.
Moreover memory requirements must be reduced. To simplify synchronization each
thread gets currently an own result vector of type double to store intermediate data.
We will look for a better approach like Compare and Set (CAS) to get by with only
one result vector.
      </p>
      <p>For the time being we use multiple cores sharing common main memory. We are going to
analyze whether our approach could be applicable in an environment with distributed
memory.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Gilbert</surname>
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Heiner</surname>
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lehrack</surname>
            <given-names>S.:</given-names>
          </string-name>
          <article-title>A unifying framework for modelling and analysing biochemical pathways using Petri nets</article-title>
          ,
          <source>Proc. 5th International Conference on Computational Methods in Systems Biology (CMSB</source>
          <year>2007</year>
          ), Edinburgh, September, Springer LNCS/LNBI 4695, pp.
          <fpage>200</fpage>
          -
          <lpage>216</lpage>
          (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Stewart</surname>
            <given-names>W. J.</given-names>
          </string-name>
          :
          <article-title>Introduction to the Numerical Solution of Markov Chains</article-title>
          . Princeton (
          <year>1994</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Aziz</surname>
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sanwal</surname>
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Singhal</surname>
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Brayton</surname>
            <given-names>R.</given-names>
          </string-name>
          :
          <article-title>Verifying Continuous Time Markov Chains</article-title>
          .
          <source>Proc. 8th International Conference on Computer Aided Verification (CAV96)</source>
          , Springer, pp.
          <fpage>269</fpage>
          -
          <lpage>276</lpage>
          (
          <year>1996</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Parker</surname>
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Implementation of symbolic model checking of probabilistic systems</article-title>
          . University of Bermingham,
          <source>PhD thesis</source>
          (
          <year>2002</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Miner</surname>
            <given-names>A.S.</given-names>
          </string-name>
          , Ciardo G.:
          <article-title>A data structure for the efficient solution of GSPN. College of William</article-title>
          and Mary
          <string-name>
            <surname>Williamsburg</surname>
          </string-name>
          (
          <year>1999</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Tovchigrechko</surname>
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Efficient symbolic analysis of bounded Petri Nets using Interval Decision Diagrams</article-title>
          . Brandenburgische Technische Universit¨at Cottbus,
          <source>PhD thesis</source>
          in press (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Baier</surname>
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Haverkort</surname>
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hermanns</surname>
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Katoen</surname>
            <given-names>J.-P.</given-names>
          </string-name>
          :
          <article-title>Model checking continuoustime Markov chains by transient analysis</article-title>
          .
          <source>Proc. 12th International Conference on Computer Aided Verification (CAV00)</source>
          , Springer, pp.
          <fpage>358</fpage>
          -
          <lpage>372</lpage>
          (
          <year>2000</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Heiner</surname>
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Richter</surname>
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schwarick</surname>
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Snoopy - A Tool to Design and Animate/Simulate Graph-Based Formalisms</article-title>
          .
          <source>Proc. International Workshop on Petri Nets Tools and APplications (PNTAP</source>
          <year>2008</year>
          , associated to SIMUTools
          <year>2008</year>
          ), Marseille, ACM digital library (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>