petri-net

Why tokens are not added?


Reading this article it says:

A firing of an enabled transition removes one token from each input place and adds one token to each output place.

Now if I have the following net, with all single arcs

enter image description here

After firing T1 I would expect P2 to contain 2 tokens - from P1 and P4. But the result is one token in P2. Without getting too deep into math, how it's possible to explain it?


Solution

  • One way of thinking about Petri nets is to look at them as Predicate/Event nets where places represent predicates and transitions represent events that change the truth value of predicates. Tokens indicate which predicates hold true after a given sequence of events.

    For instance, your net can be a model of the following situation in a college library

     P1 = "A book is available at the library"
     P4 = "A book is needed by a student"
     P2 = "The student has the book"
    

    And

     T1 = "A book is dispatched to a student"
    

    Then firing T1 is possible only if P1 and P4 are true, i.e. hold a token. After firing T1 we arrive to a state where P1 and P4 conditions are invalidated and P2 becomes true.

    Interpreting Petri nets in this way it is easy to convince oneself that tokens are immaterial and therefore the number of tokens in the system, that is the number of predicates that are true at a given state, can change without any specific intervention.

    Petri nets provide for different interpretations. It is easy to see that in order to ensure that the number of tokens stays the same, a Petri net should have a property where each transition has equal number of incoming and outgoing arcs.