<!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>A Simple Abstract Interpretation for Petri Net Queries</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Karsten Wolf</string-name>
          <email>karsten.wolf@uni-rostock.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Universität Rostock, Institut für Informatik</institution>
        </aff>
      </contrib-group>
      <fpage>163</fpage>
      <lpage>170</lpage>
      <abstract>
        <p>We propose a simple but effective method for the detection of duplicates in state predicates for Petri nets. We map sub-formulas to integer numbers using a mapping abstr. The assignment guarantees that abstr( 1) = abstr( 2) implies equivalence of 1 and 2 while abstr( 1) = abstr( 2) implies equivalence of 1 and : 2. The obtained knowledge can be used for reducing the size of a formula that is obtained by expensive constructions such as the transformation into disjunctive normal form. The method is implemented in our tool LoLA 2.0.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
    </sec>
    <sec id="sec-2">
      <title>Petri nets</title>
      <p>We consider place/transition nets. A place/transition net N consists of finite and
disjoint sets P (places) and T (transitions), an arc relation F (P T )[(T P ),
a weight function W : F ! N n f0g, and an initial marking m0. A marking m is
a mapping m : P ! N. Transition t is enabled in m iff, for all p 2 P , [p; t] 2 F
implies m(p) W ([p; t]).</p>
      <p>We skip the definition of the behaviour of Petri nets since this is not relevant
for this paper.
3</p>
    </sec>
    <sec id="sec-3">
      <title>State Predicates</title>
      <p>A state predicate is a logical formula that represents a property of markings.
Applied to a marking, it yields true or false. State predicates are used for the
specification of verification queries, typically as part of a formula in some
temporal logic. Most verification tools for Petri nets support the specification of state
predicates in one or the other syntax. Most competitions in the model checking
contest (MCC) [3] involve state predicates. Our considerations are based on the
following syntax and semantics.</p>
      <p>Definition 1 (State predicate). A state predicate can have any of the
following shapes (ki are integer numbers, pi are places, ti transitions, 2 f&lt;; &gt;; ;
; =; 6=g, and i state predicates):
– TRUE, FALSE: true for all markings (no marking, respectively);
– k1p1 + + knpn k0: true for marking m iff k1m(p1) + + knm(pn)
– FIREABLE(ti): true for m iff ti is enabled in m;
– DEADLOCK: true for m iff no transition is enabled in m;
– INITIAL: true for m iff m = m0;
–</p>
      <p>1 ^ ^ n, 1 _ _ n, : 1, 1 =) 2, 1 ()
to the usual interpretation of Boolean logic.
2: evaluated according
k0;</p>
      <p>State predicates can be represented as a tree, with the Boolean operators as
inner nodes and the remaining predicates (called atomic) as leaves. We assume
that a conjunction 1 ^ ^ n is represented as a single node with n children
for the sub-formulas i. The same applies to disjunctions.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Sources of duplicates</title>
      <p>There are several transformations that involve replication of subformulas:</p>
      <p>Rewriting Boolean operators. Even if all Boolean operators are permitted in
specifications, internal representations are usually restricted to conjunction and
disjunction. That is, 1 () 2 may be replaced with ( 1 ^ 2) _ (: 1 ^ : 2)
and causes a replication of sub-formulas 1 and 2. Similar rewriting rules apply
to formulas in temporal logic, causing replication of involved state predicates.</p>
      <p>Rewriting atomic predicates. Tools typically try to internally use as few as
possible atomic state predicates. So FIREABLE(t) can be replaced by Vp:[p;t]2F p</p>
      <p>W ([p; t]). INITIAL can be replaced with Vp2P p = m0(p). DEADLOCK is
equivalent to Vt2T : FIREABLE(t). The overwhelming majority of Petri net
models is ordinary (all arc weights are equal to one) and a considerable amount
of models is safe (at most one token on any place in all reachable markings).
For example, the “known models” of the MCC in 2017 comprised of 65 ordinary
nets versus 12 non-ordinary nets. 39 nets are safe, compared to 38 non-safe net
models.</p>
      <p>predicates like p &gt; 0 and p = 1 may occur several times (e.g. once for every
transition connected to p).</p>
      <p>Frequently used predicates. Many specifications frequently use expressions like
“place p is marked (p &gt; 0)” or “ p is unmarked (p = 0)”. Hence, these predicates
may occur more than once in a predicate.</p>
      <p>Transformation into disjunctive normal form. Verification techniques that
are based on linear algebra, for instance the exploitation of the state equation
[6], are restricted to convex properties (i.e. conjunctions of inequations). Hence,
FIREABILITY and other predicates must be unfolded and the resulting property
must be transformed into a disjunction of conjunctions of inequations. Then, the
individual conjunctions can be fed to the state equation separately. Generation
of a disjunctive normal form involves the application of the law of distributivity:
( 1 _ 2 _ 3) ^ ( 4 _ 5) is to be rewritten to ( 1 ^ 4) _ ( 1 ^ 5) _ ( 2 ^ 4) _
( 2 ^ 5) _ ( 3 ^ 4) _ ( 3 ^ 5).</p>
      <p>Translation from other formalisms. Place/transition nets representing
interesting systems, together with their verification queries, are often generated by
translation from other specification languages. Translations are based on
patterns and often induce duplicates of state predicates or sub-formulas. Consider,
for instance, the translation from a place p of a Coloured Petri Net with domain
f1; 2; 3g into three places p1, p2, and p3 of a place/transition net. Assuming that
addition is not supported, formula p = (three tokens on p) could be translated
into
(p1 = 0^p2 = 0^p3 = 3)_(p1 = 0^p2 = 1^p3 = 2)_
_(p1 = 3^p2 = 0^p3 = 0)
This formula contains a lot of replications of elementary comparisons.</p>
      <p>Consequently, a verification tool may expect the presence of duplicates in
the state predicates it is given for verification. It generates additional duplicates
in its internal transformations. Since place/transition nets are a formalism with
low-level modelling primitives (transitions actually represent simple vector
addition), automatically generated predicates may involve huge conjunctions and
disjunctions. Generation of disjunctive normal form may easily explode.
Detection of duplicates helps in reducing the size of resulting formulas thus speeding
up subsequent use of the state predicates.
5
The idea of abstract interpretation [2] is to map certain entities into another
(abstract) domain where some considerations can be verified more easily.
Abstraction must be faithful (every result derived in the abstract domain must be
correct in the original domain) but not necessarily precise (there may be results
that hold in the original domain but cannot be derived in the abstract domain).
Loss of precision is the price to be paid for easier approaches in the abstract
domain.</p>
      <p>
        We propose to use the set Z of integer numbers as abstract domain. We aim
at assigning a number abstr( ) to every state predicate such that the following
results may be reliably derived:
– if abstr(
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) = abstr(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) then 1 is semantically equivalent to 2;
– if abstr(
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) = abstr(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) then 1 is semantically equivalent to : 2;
– if abstr(
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) = 1 then 1 is a tautology (true for every marking);
– if abstr(
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) = 1 then 1 is a contradiction (false for every marking);
We do not attempt to meet the converse of any of these statements. That is,
there may be semantically equivalent formulas with different values for their
abstraction.
      </p>
      <p>We explicitly store abstr( ) for every state predicate and every of its
subformulas. Hence, once computed, abstr( ) can be derived from in constant
time.
6
In this section, we discuss the assignment of abstract values to atomic state
predicates (all but the Boolean combinations). The following assignment reflects
the frequent occurrence of certain propositions. Without loss of generality, we
assume that P = fp1; : : : ; pmg and T = ft1; : : : ; tng.</p>
      <p>– abstr(TRUE) := 1;
– abstr(FALSE) := 1;
– abstr(DEADLOCK) := 2;
– abstr(INITIAL) := 3;
– for all pi 2 P , abstr(pi &gt; 0) := 3 + i and abstr(pi = 0) :=
– for all tj 2 T , abstr(FIREABLE(tj )) := m + 3 + j.
3
i;</p>
      <p>For the remaining atomic propositions, we assign consecutive numbers. To
this end, we introduce a “function” new() that returns, whenever called, a fresh
(previously unused) number greater than 3 + m + n. That is, if any
comparison, except the ones just mentioned, is used twice in a state predicate, the two
incarnations get different values (and we do not detect their equality).
– abstr(k1p1 +
+ knpn</p>
      <p>k0) := new();</p>
      <p>For soundness, it is important that indeed every call to new() returns a
distinct value. In a threaded context, this can be achieved without synchronisation:
let every call to new() in thread k of an n-threaded program return only values
that are congruent to k modulo n. Obviously, the proposed setting meets the
requirements mentioned in Section 5.</p>
    </sec>
    <sec id="sec-5">
      <title>Boolean combinations</title>
      <p>For simplicity, we consider only conjunction, disjunction, and negation. We
basically assume that equivalence and implication leave the scene early in the game
using well-known rewrite rules. Negation can be handled quite easily. abstr(: )
can be naturally set to abstr( ), so the value can be inherited from the
subformula.</p>
      <p>Next we consider a conjunction with k sub-formulas. We proceed inductively,
starting with a conjunction that has 0 sub-formulas. During this process, we
combine the definition of the abstract value of the conjunction with the
detection of duplicates among the subformulas. An empty conjunction is treated as
TRUE, so it receives abstract value 1. Assume that we want to add i to a given
conjunction C = 1 ^ ^ i 1. We distinguish the following cases:
– abstr(C) = 1: Then abstr(C ^ i) := abstr( i), and 1; : : : ; i 1 are removed
from the formula;
– abstr(C) = 1: Then abstr(C ^ i) := 1, and i is not added to the list of
subformulas of C;
– abstr( i) = 1: Then abstr(C ^ i) := abstr(C), and i is not added to the
list of subformulas of C;
– abstr( i) = 1: Then abstr(C ^ i) := 1, and 1; : : : ; i 1 are removed
from the formula;
– abstr(C) = abstr( i): Then abstr(C ^ i) := abstr(C), and i is not added
to the list of subformulas of C;
– abstr(C) = abstr( i): Then abstr(C ^ i) := 1;
– There is a j &lt; i with abstr( j ) = abstr( i). Then abstr(C ^ i) := abstr(C),
and i is not added to the list of subformulas of C;
– There is a j &lt; i with abstr( j ) = abstr( i). Then abstr(C ^ i) := 1;
– Otherwise, abstr(C ^ i) := new().</p>
      <p>The assignment reflects simple laws of Boolean logic: ^ is and ^: is false.
Hence, the assignment reflects the specification in Section 5. The approach relies
on the assumption that formulas are constructed only by adding sub-formulas.
It does not work for a process that involves the removal of a sub-formula.</p>
      <p>For a disjunction, the assignment can be naturally derived from the
considerations for conjunction and negation: 1 _ 2 is equivalent to :(: 1 ^ : 2). In
particular, the empty disjunction should get value -1.</p>
      <p>
        Using the above definition, the abstract value may depend on the order in
which subformulas appear in a conjunction or disjunction. Assuming abstr(
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) =
10, abstr(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) = 10, and abstr(
        <xref ref-type="bibr" rid="ref3">3</xref>
        ) = 25, then abstr( 1 ^ 2 ^ 3) = 1 while
abstr( 1 ^ 3 ^ 2) would be the result of another call to new(), e.g. 1001.
Both values are correct but naturally 1 is the preferable value. Hence, a clever
implementation would always assign 1 when values k and k appear as abstract
values in the list of subformulas of a conjunction. Disjunctions can be handled
similarly.
      </p>
      <p>The described process can be used for updating abstract values while
composing a formula from its constituents. This is the case for the original construction
of the predicate, but also for the construction of a disjunctive normal form. There
are a few constructions where we assign the abstract value differently. When we
copy a predicate (for instance when rewriting an equivalence), the copy gets
the same abstract value as the original predicate. When we transform a
FIREABILITY, DEADLOCK, or INITIAL predicate into a Boolean combination of
inequations, the resulting predicate inherits the abstract value of the original
formula as well. When we turn a predicate into its negation (e.g. when applying
de Morgan’s rule for eliminating negation symbols), the resulting predicate gets
the inverse of the original value.
8</p>
    </sec>
    <sec id="sec-6">
      <title>Examples</title>
      <p>Consider the formula p = 1 () q = 0 where p and q are assumed to be places.
Internally, we support only , so we would rewrite the formula to (p 1 ^ 1
p) () q 0 (assume that we detect q 0 to be a tautology since q cannot
get a negative number of tokens). Further, we normalise the formula such that
only ^ and _ is used. We apply the rewrite rule that replaces A () B with
(A _ :B) ^ (:A _ B). We obtain:
((p
1 ^ 1
p) _ 1
q) ^ (p
0 _ 2
p _ q
0)
This is the formula that we normally use for state space verification. Since
the rewrite rule introduced copies of A and B, the two copies (and their
subformulas) get the same value which is than inversed through negation in one
of the two copies. This way, we preserve some knowledge about the origin of
sub-formulas.</p>
      <p>If, subsequently, we want to include the state equation (i.e. linear
programming) approach, we transform the formula into a disjunctive normal form since
linear program can handle only conjunctions of inequations. We proceed by first
transforming the left part, resulting in
(p
1 _ 1
q) ^ (1
p _ 1
q) ^ (p
0 _ 2
p _ q
0)
Then we apply the law of distributivity to the whole formula. Doing that in the
brute-force way, would result in in a disjunction of 12 subformulas:
(p
(p
(p
(p
(p
(p
(1
(1
(1
(1
(1
(1
1 ^ 1
1 ^ 1
1 ^ 1
1 ^ 1
1 ^ 1
1 ^ 1
q ^ 1
q ^ 1
q ^ 1
q ^ 1
q ^ 1
q ^ 1
p ^ p
p ^ 2
p ^ q
q ^ p
q ^ 2
q ^ q
p ^ p
p ^ 2
p ^ q
q ^ p
q ^ 2
q ^ q
0)_
p)_
0)_
0)_
p)_
0)_
0)_
p)_
0)_
0)_
p)_
0)
Our abstraction, however, recognises that p 0 is the negation of 1 p, p 1 is
the negation of 2 p, and q 0 is the negation of 1 q since the abstraction of
one the the formulas is 1 times the abstraction of the other one. The detection
does not depend on the simplicity of these formulas since the abstraction takes
care of copying and negation in the process of transforming the original formula.
As soon as a formula and its negation appear in a conjunction, the conjunction
is replaced by false and thus disregarded in the resulting formula. This way, first,
second, 5th, 6th, 7th, 9th, and 12th subformulas Furthermore it recognises the
duplicate appearance of 1 q in the 10th and 11th sub-formulas, so we would
produce the normal form
Our approach reduced a formula with 36 literals to a formula with 13 literals.
Instead of 12 conjunctions, only 5 conjunctions need to be shipped to the linear
programming tool. One might argue that formula would not have exploded in
the first place if the equivalence A () B would have been rewritten by
(A ^ B) _ (:A ^ :B). Using that rule, however, the negated formula would
explode instead, so the choice of the rule for rewriting equivalence does not solve
the problem of duplication.
9</p>
    </sec>
    <sec id="sec-7">
      <title>Experience and Conclusion</title>
      <p>We implemented the abstract interpretation in our tool LoLA 2 [5, 7]. Our main
focus was to reduce the size of disjunctive normal form generation which is a
pre-requisite for applying the state equation based method of [6]. The abstract
interpretation yields a sufficient condition that sub-formulas can be merged. We
jointly apply a hash-based technique that yields a sufficient condition for
subformulas to be at least syntactically different. Whenever none of the two criteria
applies, we investigate the sub-formulas recursively to look for additional
duplicates. The abstract interpretation costs virtually no time, so we are convinced
that it establishes a nice tool for handling state predicates in verification. Using
special codes for frequently occurring atomic predicates, the method is in fact
Petri net specific.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Edmund</surname>
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Clarke</surname>
          </string-name>
          , Orna Grumberg, and
          <string-name>
            <surname>Doron</surname>
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Peled</surname>
          </string-name>
          .
          <article-title>Model checking</article-title>
          . MIT Press,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>Patrick</given-names>
            <surname>Cousot</surname>
          </string-name>
          and
          <string-name>
            <given-names>Radhia</given-names>
            <surname>Cousot</surname>
          </string-name>
          .
          <article-title>Abstract interpretation frameworks</article-title>
          .
          <source>J. Log. Comput.</source>
          ,
          <volume>2</volume>
          (
          <issue>4</issue>
          ):
          <fpage>511</fpage>
          -
          <lpage>547</lpage>
          ,
          <year>1992</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>F.</given-names>
            <surname>Kordon</surname>
          </string-name>
          et al.
          <article-title>Homepage of the Model Checking Contest</article-title>
          . http://mcc.lip6.fr/,
          <year>June 2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>Zohar</given-names>
            <surname>Manna</surname>
          </string-name>
          and
          <string-name>
            <given-names>Amir</given-names>
            <surname>Pnueli</surname>
          </string-name>
          .
          <article-title>The temporal logic of reactive and concurrent systems - specification</article-title>
          . Springer,
          <year>1992</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>K.</given-names>
            <surname>Schmidt</surname>
          </string-name>
          .
          <article-title>Lola: A low level analyser</article-title>
          .
          <source>In ICATPN, LNCS 1825</source>
          , pages
          <fpage>465</fpage>
          -
          <lpage>474</lpage>
          ,
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>H.</given-names>
            <surname>Wimmel</surname>
          </string-name>
          and
          <string-name>
            <given-names>K.</given-names>
            <surname>Wolf</surname>
          </string-name>
          .
          <article-title>Applying CEGAR to the Petri net state equation</article-title>
          .
          <source>Logical Methods in Computer Science</source>
          ,
          <volume>8</volume>
          (
          <issue>3</issue>
          ),
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>K.</given-names>
            <surname>Wolf</surname>
          </string-name>
          .
          <article-title>Petri net model checking with lola 2</article-title>
          . In Accepted for:
          <source>Petri Nets</source>
          <year>2018</year>
          , pages
          <fpage>465</fpage>
          -
          <lpage>474</lpage>
          ,
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>