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
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?
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
And
Then firing
T1
is possible only ifP1
andP4
are true, i.e. hold a token. After firingT1
we arrive to a state whereP1
andP4
conditions are invalidated andP2
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.