# How to model an inverse "token relationship" in Petri nets?

Suppose I have the following Petri net:

I wonder whether it is possible to model an inverse relationship between $$p2$$ and $$p3$$. Basically what I want to achieve is to make either $$t1$$ or $$t2$$ fireable but never both. Currently, I just set a token in $$p2$$ and leave $$p3$$ empty if I want to make $$t1$$ fireable (or vice versa for $$t2$$). I believe there must be a way to omit one place and achieve the same result, i.e., putting one token in $$p2$$ activates $$t1$$ but not $$t2$$ and zero tokens in $$p2$$ achieves the reverse.

Without extra transitions, the best you can do is make them alternate:

Extra transitions can be used to choose between filling p2 or p3:

You can do the same without the additional place:

You might even consider dropping one of the added transitions, to model the situation in which they are enabled in order.

• Hi, thanks a lot for your help. However, your suggestions do not yield my desired result. Basically, I want to omit $p2$ or $p3$ (because their meaning is redundant) and not make them alternating. The idea is that $p2$ represents semantically the inverse of $p3$. So if I have initially one marking in $p2$, it means that $p3$ should have zero markings and vice versa. Obviously, I can always set and check the tokens in both places manually, but I thought that maybe there is a better way to model it without having to use both places. Oct 2, 2021 at 12:55
• So you don't want to add things, instead you want to omit a place, and only fire a transition when it has no token. This is impossible; regular Petri nets (Place/Transition nets) cannot have negative conditions like that. You'll need an extended formalism; e.g. Predicate/Transition nets (see Wolfgang Reisig's works) or inhibitor arcs. Oct 2, 2021 at 18:38
• Thanks for your explanation. Yes, I want to omit a place, but I don't want to fire it when it has no token. I am aware that this is impossible. To give you an example: $p2$ represents ($\rightarrow$) "Product 1 in stock", $t1$ $\rightarrow$ "Ship Product 1", $p3$ $\rightarrow$ "No products in stock", $t2$ $\rightarrow$ "refill stock". When I want to model the scenario that product 1 is shipped, I have to put a token in $p2$ but at the same time I have to ensure that $p3$ has no tokens. This is a bit redundant. I thought that there is maybe a way to model this inverse relationship. Oct 2, 2021 at 19:28
• Addendum: The other scenario is that there is no product in stock ($p3$ has a token), meaning that $p2$ should have zero tokens to make $t1$ not fireable. I thought that I can somehow omit either $p2$ or $p3$ or at least make this inverse relationship explicit in the Petri net. Oct 2, 2021 at 19:31
• You can make sure $p3$ has no token whenever $p2$ has one by adding arcs such that every transition that puts a token into $p3$ takes one from $p2$ and vice versa (my first example). They'll have converse flow relations. This may affect the transition relation: new incoming arcs may enable transitions that were enabled before, while new outgoing arcs may enable them. Similarly, given a $p2$, you can add a 'converse' $p3$, but in general, this will affect the transition relation. Oct 3, 2021 at 11:17