Petri Nets Flashcards
What are Petri Nets used for?
Used to rigorously define a system, reducing ambiguity.
Often used in distributed systems and for systems with resource sharing.
Deterministic or non-deterministic?
Non-deterministic, since we do not know which one of the transitions will fire first.
High-level Petri Net attributes
- Colour
- Time
- Hierarchy
Active and passive.
Transitions are active.
Tokens are passive.
How are transitions enabled?
All inputs connected to the transition require a token.
Atomicity
Firing is atomic, consuming tokens from input and then generating on output.
Deadlock
The system cannot go through anymore transitions.
Transitions without inputs.
Can fire at any time.
Sinks
A transition without outputs, and is used just to consume tokens.
Conflicts
Two transitions fighting for the same token on an input, leading to a non-deterministic input.
Arcs
Arcs are the connections between transitions and inputs.
We can have many arcs for one connection, indicating multiple token consumptions.
Current State v Reachable State
Current state -> current configuration of tokens.
Reachable State -> reachable form by firing a sequence of enabled transitions.
Colour
Adding colour to the tokens is adding value to them. For example, a token could represent a person.
Transition Specifications
- number of tokens produced
- value of the tokens
- preconditions (optional), like if statements.
Preconditions can be used to help solve non-deterministic issues with conflicts of transitions.
Time
Allows a minimum and maximum amount of time with each transition.
So lets say that a transition has been enabled, and is ready to fire. We can have values Tmin and Tmax which determine the minimum amount of time it could take to fire and the maximum amount of time.