<!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>On Optimizing the Sweep-Line Method</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Robert Pru¨fer</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Humboldt-Universita ̈t zu Berlin, Institut fu ̈r Informatik Unter den Linden 6</institution>
          ,
          <addr-line>10099 Berlin</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <fpage>2</fpage>
      <lpage>7</lpage>
      <abstract>
        <p>For applying the sweep-line method, a state space reduction technique, it is necessary to provide an automatic calculation of a progress measure. In [1], such a calculation has been proposed for Petri nets. The approach presented there may lead to suboptimal results, therefore the author suggested possible optimizations. In this paper, we check whether the proposed optimization goals indeed lead to an improved performance of the sweep-line method.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>
        The sweep-line method is a state space reduction technique that can be used to verify
safety properties (e.g. the existence of deadlocks or reachability of a given state) of the
modelled system. The main idea of this technique is that during state space exploration,
there is some kind of “progress”: States that have been processed and will never be
visited again are no longer needed for further exploration. To quantify this progress,
a progress measure is needed that assigns a progress value to every state. To use the
sweep-line method fully automatically, the progress measure must be calculated
automatically, too. Such an automatic calculation of the progress measure for applying the
sweep-line method to state spaces of Petri nets has been proposed in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. This approach
leaves degrees of freedom and, in some cases, calculates a progress measure that does
not lead to an optimal state space reduction. In [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], the author suggests two optimization
goals to improve the performance of the sweep-line method: minimizing the number of
so-called regress transitions and avoiding chains of such regress transitions. In this
publication, we develop methods to achieve the proposed optimization goals and apply our
modified calculation of the progress measure in an experiment to check whether it leads
to an improved state space reduction.
      </p>
    </sec>
    <sec id="sec-2">
      <title>The Sweep-Line Method</title>
      <p>
        There exist two forms of the sweep-line method: the basic form [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], which is only
suitable for cycle-free state spaces, and the generalized form [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], which can be applied
to all types of state spaces. We first describe the basic method and afterwards extend it
to the generalized method.
      </p>
      <p>As we stated above, the progress measure assigns a progress value p(s) to every
state s of the state space. For the basic sweep-line method, the progress measure is
monotonous, i.e., for all states s; s0 and transitions t, s !t s0 implies p(s) p(s0). The
state space is explored such that states with low progress values are visited first.
Therefore, we can divide the set of states into three classes: (1) states that have been explored
including all their successors, (2) states that have been explored, but which’s successors
have not been completely explored (we also call this class front) and (3) states that have
not been explored yet. As the progress measure is monotonous, all states of class (1)
can be deleted; only the states of the front must be stored.</p>
      <p>For the generalized sweep-line method, the progress measure does not have to be
monotonous, i.e., for an edge s !t s0 of the state space it may hold p(s) &gt; p(s0). Such
edges are called regress edges. Applying the basic method would now lead to the
following problem: Let s !t s0 be a regress edge with s in class (2) or (3) and s0 in class (1).
Because all states of class (1) have been deleted, we have no information that we have
explored s0 yet. The exploration would be continued from this state and s0 will
eventually be explored again as an unknown state – the method would not terminate. That
is why in the generalized sweep-line method target states of regress edges are marked
as persistent and stored permanently in memory. In the current iteration (sweep) of the
sweep-line method, successors of persistent states are not explored, and newly marked
persistent states are initial states of the next sweep. Therefore, it is guaranteed that the
method terminates and explores all states at least once.</p>
      <p>It is obvious that a large number of persistent states increases memory consumption
and can lead to a large number of sweeps.</p>
      <p>
        The sweep-line method can be combined with stubborn sets, another state space
reduction method; the computation method for stubborn sets described in [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] can be used
for this purpose.
4
      </p>
    </sec>
    <sec id="sec-3">
      <title>Calculation of Progress Values for Petri nets</title>
      <p>
        The progress measure required for the sweep-line method needs to be generated for each
system which’s state space should be explored. The automatic calculation of a progress
measure for Petri nets described in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] is divided in two phases. Before state space
exploration is started, an offset function o that maps every transition of a given Petri Net
into an offset value o(t) 2 Q is calculated. During state space exploration, offset values
are combined to progress values: For the initial state s0, set p(s0) = 0. Then, for every
edge s !t s0 of the state space, set p(s0) = p(s) + o(t). For each transition t with o(t) &lt; 0,
every edge s !t s0 of the state space is a regress edge. Therefore, such transitions are
called regress transitions (RTs).
      </p>
      <p>Using this approach for calculating a consistent progress measure, offset values must
preserve the linear dependencies of all vectors D t.</p>
      <sec id="sec-3-1">
        <title>Definition 1 (Linear Dependency Preserving Offset Function). Let N be a Petri net</title>
        <p>with transitions T . An offset function o is linear dependency preserving if for all t 2 T ,
ft0; : : : ; tng T n ftg, l0; : : : ; ln 2 Q with D t = l0D t0 + + lnD tn it holds o(t) =
l0o(t0) + + lno(tn).</p>
        <p>
          The method for computing offset values suggested in [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ] leaves degrees of freedom and,
in some cases, calculates negative offset values for more transitions than necessary.
In other words, the calculation of offset values can be optimized. For the purpose of
optimization, we propose a computation method for offset values that differs from the
one described in [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]. Let N = [P; T; F;W; s0] be a Petri net and let a 2 QjPj be chosen
arbitrarily but fixed. Then the offset value of any transition t 2 T can be computed by
o(t) = a D t. As offset values computed this way are linear dependency preserving (see
Def. 1), a consistent progress measure will be generated when they are used.
5
        </p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Optimized Calculation of Offset Values</title>
      <p>The computation method for offset values described in Sect. 4 is suitable for the purpose
of optimization, as for attaining any optimization goal, only one vector a 2 QjPj must
be chosen properly to calculate the offset value o(t) = a D t for any transition t of a
Petri net. As we already mentioned, we want to attain two optimization goals: First, the
number of RTs should be minimized (as one could expect that this reduces the number
of persistent states and thus the number of sweeps) and second, chains of RTs should
be avoided (as such chains could lead to an unneccessary re-exploration of huge parts
of the state space). In our approach described in the following, at first we will compute
several sets of RTs which are as small as possible, and afterwards choose a set R which
promises to avoid chains of RTs the most. Afterwards, we can calculate a vector a such
that o(t) &lt; 0 iff t 2 R.
5.1</p>
      <sec id="sec-4-1">
        <title>Minimizing the Number of Regress Transitions</title>
        <p>For this subsection, let N = [P; T; F;W; s0] be a Petri net. Minimizing the number of
RTs means that we want to compute as few negative offset values as possible for all
transitions t 2 T . Furthermore, we decide that we do not want to assign the offset value
o(t) = 0 to any transition t 2 T . Therefore, with regard to the computation method
described in Sect. 4, for every transition t 2 T we set up the inequality a D t &gt; 0. Thus,
we obtain a system of linear inequalities which we call L .</p>
        <p>Obviously, if L is feasible, we can calculate positive offset values for all transitions
t 2 T . We may choose any vector a 2 QjPj from the set of feasible solutions described by
L (which can be done by a Linear Programming solver) to obtain offset values without
RTs. Of course, in this case we do not have to avoid chains of RTs as there are none.</p>
        <p>
          If L is not feasible, things become more difficult. To minimize the number of RTs,
we are looking for a feasible subsystem of L containing as many inequalities as
possible. This almost equates to solving an instance of the Maximum Feasible Subsystem
Problem (MAXFS) [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]; we only have to transform every inequality from a D t &gt; 0 to
a D t e with a preferably small e 2 Q and e &gt; 0. As MAXFS is NP-hard [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ], we
decided to use a heuristic based on Linear Programming, namely Algorithm 1 from [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ],
to solve our MAXFS instances. As this heuristic only provides a single solution (like all
MAXFS heuristics known to us), we modified it to obtain multiple solutions (see [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ] for
details). Now, for any feasible subsystem L 0 we obtained, we can choose an arbitrary
vector a 2 QjPj from the set of feasible solutions described by L 0 to compute offset
values with a minimal number of RTs.
5.2
        </p>
      </sec>
      <sec id="sec-4-2">
        <title>Avoiding Chains of Regress Transitions</title>
        <p>As we are now able to generate multiple sets of RTs, in this section we want to develop
a heuristic that should select the set which avoids chains of RTs the most. In contrast
to the minimization of RTs which can be performed prior to state space exploration,
chains of RTs are initially detected during state space exploration. As offset values are
calculated prior to state space exploration, we have to think about how to optimize offset
value calculation to avoid chains of RTs anyway. To attain this optimization goal, we
introduce the enabling graph.</p>
        <p>Definition 2 (Enabling Graph). Let N = [P; T; F;W; s0] be a Petri net. G = [V; E] is the
enabling graph of N, where V = T , and (t; t0) 2 E iff 9 p 2 P : t 2 p ^ t0 2 p .</p>
        <p>If there is an edge from t to t0 in the enabling graph, then firing t creates at least
one token on a place p 2 t0. Therefore, firing t supports enabling t0. In our heuristic
for avoiding chains of RTs, we use shortest paths within the enabling graph to decide
whether a set of RTs is likely to avoid chains or not. Although this approach has some
weaknesses (for example, it does not take account of concurrency of transitions and of
the actual marking of the net), we consider it to be appropriate for avoiding chains of
RTs prior to state space exploration. For a given Petri Net N = [P; T; F;W; s0] and its
enabling graph G = [V; E], our heuristic for avoiding chains of RTs chooses a set R of
RTs that satisfies the criteria described in the following.
1. Shortest paths from each t to each t0 with t; t0 2 R should be as long as possible.
2. Shortest paths from each transition t enabled in s0 to each t0 2 R should be as long
as possible.
3. For each t 2 R and each p 2 t, it should hold p 2= t0 for as many t0 2 R n ftg and
p 2 t00 for as many t00 2 T n R with D t00( p) &lt; 0 as possible.</p>
        <p>Criterion 1 aims at maximizing the number of explored states between any two
regress transitions. Especially, t0 should not fire immediately after t has fired.
Furthermore, in our implementation used for the case study in Sect. 6, we demand that the
shortest path among all shortest paths between RTs should be preferably long. It is
obvious that this criterion helps us to avoid chains of RTs.</p>
        <p>Criterion 2 states that during the first sweep, as many transitions as possible should
fire before a regress edge is explored. This does not avoid chains of RTs immediately,
but it has the effect that a large part of the state space should be already explored in the
first sweep.</p>
        <p>Criterion 3 takes account of shared places. We want to avoid that a RT t shares a
place p with another RT, because if the marking of p is sufficiently big, then these two
transitions could fire one after another, which would exactly yield a chain of RTs. On the
other hand, if t shares a place with a transition t0 that is not a RT and t0 consumes more
tokens from p than it produces on this place, the firing of t0 may disable t. Therefore,
such transitions should preferably be chosen as RTs.</p>
        <p>
          In our heuristic, we weight these criteria and combine them to a function f that
assigns a value to every set of RTs (see [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ] for details). The set to which f assigns the
largest value is chosen as the set that should avoid chains of RTs the most.
6
        </p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Case Study</title>
      <p>
        In our case study, we checked whether the computation of progress values given in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]
really leads to a worse performance of the sweep-line method compared to the
computation method and heuristics described in this paper. For this purpose, we tried to
compute the state space of 32 Petri nets from a GALS project [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. We used two versions of
the model checking tool LoLA [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]: the original version (LoLA O) which implements
the calculation described in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] as well as a modified version (LoLA H) where we
implemented our offset calculation method and heuristics. We executed the state space
computation once with stubborn sets (+stub) and once without stubborn sets (-stub).
      </p>
      <p>Table 1 shows a summary of our test results. The state space was too large to be
computed completely by LoLA O for 6 nets with stubborn sets and for 10 nets without
stubborn sets. In the table, these nets are not considered except for the columns complete
and #RT.</p>
      <p>
        From the results, we conclude that our optimization goals do not lead to an improved
performance of the sweep-line method in general. Moreover, as stated in [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], none of the
assumed correlations mentioned above (#RT and persistent, #RT and sweeps) is verified
by the results. Using -stub, for 14 nets where the full state space could be computed, #RT
was reduced, but persistent was only decreased for 8 of them and sweeps for 5 of them.
For +stub and -stub, for some nets #RT was reduced significantly, but peak, persistent
and sweeps even got larger, what means that the values for memory consumption and
the number of iterations got worse. Changing the weights of the criteria for avoiding
chains mentioned in Sect. 5.2 does not change the results in general.
      </p>
      <p>As the computation of the offset values does not depend on stubborn sets, we obtain
the same number of regress transitons for state space exploration with and without
stubborn sets.</p>
      <p>Although the results for the combination of the sweep-line method and stubborn sets
look more promising than those obtained without stubborn sets, note that our
optimization goals did not include special improvements for stubborn sets. Especially,
computation of stubborn sets combined with the sweep-line method in LoLA depends on the
offset values of all transitions; thus, one should not reason about these results without
taking a closer look at LoLA.
7</p>
    </sec>
    <sec id="sec-6">
      <title>Conclusion and Further Work</title>
      <p>The case study in Sect. 6 revealed that the optimization goals examined in Sect. 5 do not
improve the performance of the sweep-line method in general. Different optimization
goals must be found to achieve this aim.</p>
      <p>For estimating the number of persistent states, it turns out that it would be
important to know how often RTs are enabled during state space exploration and how many
distinct target states they lead to. Furthermore, even offset values of transitions which
are no RTs influence the peak value. It would be appropriate to provide an offset value
calculation that exploits this fact. Finally, as mentioned above, when using LoLA, the
implementation of stubborn sets should be taken into consideration when trying to
optimize the sweep-line method.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Schmidt</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Automated generation of a progress measure for the sweep-line method</article-title>
          . In: Jensen,
          <string-name>
            <given-names>K.</given-names>
            ,
            <surname>Podelski</surname>
          </string-name>
          ,
          <string-name>
            <surname>A</surname>
          </string-name>
          . (eds.)
          <article-title>TACAS 2004</article-title>
          .
          <article-title>LNCS</article-title>
          , vol.
          <volume>2988</volume>
          , pp.
          <fpage>192</fpage>
          -
          <lpage>204</lpage>
          . Springer, Berlin Heidelberg (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Christensen</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kristensen</surname>
            ,
            <given-names>L.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mailund</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>A Sweep-Line Method for State Space Exploration</article-title>
          . In: Margaria,
          <string-name>
            <given-names>T.</given-names>
            ,
            <surname>Yi</surname>
          </string-name>
          , W. (eds.)
          <article-title>TACAS 2001</article-title>
          .
          <article-title>LNCS</article-title>
          , vol.
          <year>2031</year>
          , pp.
          <fpage>450</fpage>
          -
          <lpage>464</lpage>
          . Springer Berlin Heidelberg (
          <year>2001</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Kristensen</surname>
            ,
            <given-names>L.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mailund</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>A Generalised Sweep-Line Method for Safety Properties</article-title>
          . In: Eriksson,
          <string-name>
            <given-names>L.-H.</given-names>
            ,
            <surname>Lindsay</surname>
          </string-name>
          ,
          <string-name>
            <surname>P.A. (eds.) FME</surname>
          </string-name>
          <year>2002</year>
          .
          <source>LNCS 2391</source>
          , pp.
          <fpage>215</fpage>
          -
          <lpage>239</lpage>
          . Springer Berlin Heidelberg (
          <year>2002</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Schmidt</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Stubborn Sets for Standard Properties</article-title>
          . In: Donatelli,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Kleijn</surname>
          </string-name>
          , H.C.M. (eds.)
          <source>ICATPN'99. LNCS</source>
          , vol.
          <volume>1639</volume>
          , pp.
          <fpage>46</fpage>
          -
          <lpage>65</lpage>
          . Springer, Berlin Heidelberg (
          <year>1999</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Amaldi</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pfetsch</surname>
            ,
            <given-names>M.E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Trotter</surname>
            ,
            <given-names>L.E.</given-names>
          </string-name>
          <string-name>
            <surname>Jr</surname>
          </string-name>
          .:
          <article-title>On the maximum feasible subsystem problem, IISs and IIS-hypergraphs</article-title>
          .
          <source>Math. Program. 95 no. 3</source>
          , pp.
          <fpage>533</fpage>
          -
          <lpage>554</lpage>
          (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Amaldi</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kann</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          :
          <article-title>The Complexity and Approximability of Finding Maximum Feasible Subsystems of Linear Relations</article-title>
          .
          <source>Theor. Comput. Sci</source>
          .
          <volume>147</volume>
          no.
          <issue>1-2</issue>
          , pp.
          <fpage>181</fpage>
          -
          <lpage>210</lpage>
          (
          <year>1995</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Chinneck</surname>
            ,
            <given-names>J.W.</given-names>
          </string-name>
          :
          <article-title>Fast Heuristics for the Maximum Feasible Subsystem Problem</article-title>
          .
          <source>INFORMS J. Comput. 13 no. 3</source>
          , pp.
          <fpage>210</fpage>
          -
          <lpage>223</lpage>
          (
          <year>2001</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8. Pru¨fer, R.:
          <article-title>Optimierung der Sweep-Line-</article-title>
          <string-name>
            <surname>Methode.</surname>
          </string-name>
          Humboldt-Universita¨t zu Berlin, diploma thesis (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Stahl</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Reisig</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Krstic</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Hazard Detection in a GALS Wrapper: A Case Study</article-title>
          . In: Desel,
          <string-name>
            <given-names>J.</given-names>
            ,
            <surname>Watanabe</surname>
          </string-name>
          ,
          <string-name>
            <surname>Y</surname>
          </string-name>
          . (eds.)
          <source>Proceedings of the Fifth International Conference on Application of Concurrency to System Design (ACSD05)</source>
          , pp.
          <fpage>234</fpage>
          -
          <lpage>243</lpage>
          . IEEE Computer Society (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Schmidt</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>LoLA: A Low Level Analyser</article-title>
          . In: Nielsen,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Simpson</surname>
          </string-name>
          ,
          <string-name>
            <surname>D</surname>
          </string-name>
          . (eds.)
          <article-title>ICATPN 2000</article-title>
          .
          <article-title>LNCS</article-title>
          , vol.
          <year>1825</year>
          , pp.
          <fpage>465</fpage>
          -
          <lpage>474</lpage>
          . Springer, Berlin Heidelberg (
          <year>2000</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>