← Research library
SCHEMATEX / RESEARCH NOTEWorked analysis · Discrete-event systems

Petri net firing sequence: markings, matrix equation, and two conservation checks

Follow two parts through one machine, compute every reachable marking, and use the incidence matrix plus two P-invariants to catch an illegal firing sequence.

KEY RESULT2 → 2

modeled parts conserved from Raw to Finished

FIGURE 01 / REPRODUCIBLE OUTPUTSVG · SCHEMATEX
Petri net after Start fires, with one token in Raw, one in InProcess, no token in MachineFree, and Complete highlighted as enabled
Rendered deterministically by Schematex 1.0.13 from the source reproduced here; strict rendering returned no diagnostics, and every marking was independently recomputed from the firing rule and incidence matrix.

A Petri-net transition is enabled only when every input place contains at least the number of tokens required by its input arc. Firing subtracts those input tokens and adds the output tokens. In the one-machine example below, the legal sequence Start, Complete, Start, Complete moves two modeled parts from Raw to Finished, returns the machine-availability token, and satisfies two conservation checks at every intermediate marking. The final marking is [0, 1, 0, 2] in the place order [Raw, MachineFree, InProcess, Finished].

After Start fires, Raw and InProcess each contain one token, MachineFree and Finished are empty, and Complete is the only enabled transition
The renderer replays Start before drawing this marking. The machine is occupied, so another start is disabled; completion is enabled.

Scope and terminology first

This note uses an ordinary, untimed place/transition net, often shortened to a P/T net. A place is a circle that holds a nonnegative integer number of tokens. A transition is a bar representing an event. Directed arcs connect places to transitions or transitions to places, never two places or two transitions. The distribution of tokens over all places is the marking, which is the model's current state.

The public catalogue for ISO/IEC 15909-1:2019 identifies edition 2 as the current standard for Petri-net concepts, definitions, and graphical notation; ISO confirmed it in 2025. This article does not reproduce or interpret a licensed clause. The definitions and arithmetic below follow the ordinary weighted firing rule described in Murata's canonical 1989 IEEE survey and stated explicitly for manufacturing models by Huang and colleagues.

Tokens here are bookkeeping units, not physical objects or control signals. One token in MachineFree means “the modeled machine is available” only because we define it that way. The diagram does not sense a guard, command a motor, enforce mutual exclusion in hardware, or prove that a real machine is safe.

Model inputs and assumptions

The fictional cell begins with two parts waiting and one machine available:

PlaceInitial tokensMeaning in this model
Raw2parts not yet started
MachineFree1availability of the single modeled machine
InProcess0part currently occupying the machine
Finished0completed parts

Start consumes one token from both Raw and MachineFree, then produces one token in InProcess. Complete consumes one token from InProcess, then returns one token to MachineFree and produces one token in Finished. All six arcs have the default weight 1.

For a transition t, let Pre(p,t) be the input-arc weight from place p, or zero when no such arc exists. Let Post(p,t) be the output-arc weight. At marking M, t is enabled exactly when

M(p) >= Pre(p,t)  for every place p.

If enabled, firing produces

M'(p) = M(p) - Pre(p,t) + Post(p,t).

The NRC-sponsored UCRL-ID-114839 guide gives the same rule for unit-weight arcs: each input place must have a token; firing removes one token from every input and places one in every output. The guide uses Petri nets to explain concurrent events and resource exclusion, but its discussion is not an approval of this fictional cell.

Fire the four-step sequence by hand

Write each marking in the fixed place order [Raw, MachineFree, InProcess, Finished]:

StepRequested firingMarking after the stepEnabled nextWhy
0[2, 1, 0, 0]Startraw part and free machine are both present
1Start[1, 0, 1, 0]Completemachine token moved into InProcess
2Complete[1, 1, 0, 1]Startmachine token returned; one raw part remains
3Start[0, 0, 1, 1]Completesecond part occupies the machine
4Complete[0, 1, 0, 2]noneno raw or in-process part remains

The first firing is a component-wise subtraction and addition:

M0              = [2, 1, 0, 0]^T
Pre(:, Start)   = [1, 1, 0, 0]^T
Post(:, Start)  = [0, 0, 1, 0]^T

M1 = M0 - Pre(:, Start) + Post(:, Start)
   = [2,1,0,0]^T - [1,1,0,0]^T + [0,0,1,0]^T
   = [1,0,1,0]^T.

At M1, a second Start is illegal even though one raw part remains: MachineFree = 0 is smaller than the required input weight 1. This is the important distinction between drawing an arrow path and executing a token model. Every transition must be rechecked against the current marking.

Cross-check with the incidence matrix

Use columns [Start, Complete]. The input matrix, output matrix, and incidence matrix C = Post - Pre are

       Start Complete              Start Complete
Pre = [  1      0  ]        Post = [  0      0  ]   Raw
      [  1      0  ]               [  0      1  ]   MachineFree
      [  0      1  ]               [  1      0  ]   InProcess
      [  0      0  ]               [  0      1  ]   Finished

        Start Complete
C   = [ -1      0  ]   Raw
      [ -1     +1  ]   MachineFree
      [ +1     -1  ]   InProcess
      [  0     +1  ]   Finished.

The four-step sequence fires each transition twice, so its firing-count vector is sigma = [2,2]^T. The state equation gives

C sigma = [-2, 0, 0, 2]^T

M4 = M0 + C sigma
   = [2,1,0,0]^T + [-2,0,0,2]^T
   = [0,1,0,2]^T.

That matches the row-by-row token ledger. Murata's survey treats matrix equations as one of the principal Petri-net analysis methods; the ICAPS tutorial Petri Nets (for Planners) gives the same state equation and an essential limit: satisfying it is necessary for reachability, not sufficient. A firing-count vector forgets order. A candidate marking still needs an actual sequence in which every requested transition is enabled at its step, so this example keeps the intermediate rows instead of trusting only M0 + C sigma.

Two P-invariants catch lost or duplicated tokens

A place vector y is a P-invariant when y^T C = 0. Multiplying the state equation by such a vector cancels the transition effects, so y^T M has the same value at every reachable marking.

The first vector selects the two machine-state places:

y_machine = [0, 1, 1, 0]^T
y_machine^T C = [0, 0]

MachineFree + InProcess = 1  at M0, M1, M2, M3, and M4.

The machine is therefore represented in exactly one of two states: available or occupied. The second vector selects the three material-state places:

y_part = [1, 0, 1, 1]^T
y_part^T C = [0, 0]

Raw + InProcess + Finished = 2  at every marking.

That invariant catches accidental loss or duplication of the two modeled parts. It does not prove that a physical counter, sensor, or database record is correct; it proves only that the declared net topology conserves its abstract tokens.

Reproducible Schematex source

petri "One-machine cell after Start"
layout: lr
place Raw *2 "raw parts"
place MachineFree *1 "machine available"
place InProcess "part in machine"
place Finished "finished parts"
transition Start "start machining"
transition Complete "complete machining"
Raw -> Start
MachineFree -> Start
Start -> InProcess
InProcess -> Complete
Complete -> MachineFree
Complete -> Finished
fire: Start

Schematex 1.0.13 strictly parsed and rendered this source with no diagnostics on August 28, 2026. After replaying Start, the SVG records four places, two transitions, six arcs, marking {Raw:1, InProcess:1}, and Complete as the only enabled transition. The current Schematex Petri Net reference documents the marking syntax, bipartite checks, weighted arcs, capacity checks, and fire: replay. The renderer also classifies this graph structurally as a workflow net; that label is not a workflow-soundness or liveness proof.

Checks, failure modes, and review boundary

Use these checks before trusting a firing trace:

  1. Fixed order: name the place order once; every vector and matrix row must follow it.
  2. Bipartite structure: every arc must connect a place to a transition or a transition to a place.
  3. Enablement before firing: test every input against its arc weight at the current marking.
  4. No negative tokens: any negative component means the proposed firing was not legal under the ordinary rule.
  5. Row and matrix agreement: the step ledger and M0 + C sigma must produce the same final marking.
  6. Resource invariant: MachineFree + InProcess must remain 1.
  7. Material invariant: Raw + InProcess + Finished must remain 2.
  8. Terminal interpretation: no enabled transition at M4 means this two-part job is finished, not that the model is globally “deadlock-free.”

Two negative tests expose common modeling errors. Request Start, Start from M0: the second firing must be rejected because the machine token is absent. Then delete Complete -> MachineFree: the first part can finish, but the machine token never returns, the second Start stays disabled, and the machine invariant fails. Other frequent errors are treating a place label as a Boolean instead of a token count, forgetting an arc weight, reordering matrix rows, adding transition effects before checking enablement, and assuming a green enabled marker chooses which transition will fire.

Paste the source into the Schematex playground, first run the illegal Start, Start sequence, then restore the legal four-step sequence and verify both invariants at every row. For a real system, replace each token meaning and transition precondition with reviewed requirements, then analyze reachability, deadlocks, timing, and safety in tools and processes appropriate to the application.

References

  1. International Organization for Standardization and International Electrotechnical Commission. Systems and software engineering — High-level Petri nets — Part 1: Concepts, definitions and graphical notation. ISO/IEC 15909-1:2019, Edition 2, published August 2019; confirmed in 2025, 2019. https://www.iso.org/standard/67235.html Accessed August 28, 2026. [Paywalled]
  2. Tadao Murata. Petri Nets: Properties, Analysis and Applications. Proceedings of the IEEE, volume 77, issue 4, pages 541–580, April 1989; DOI 10.1109/5.24143, 1989. https://doi.org/10.1109/5.24143 Accessed August 28, 2026. [Paywalled]
  3. J. Dennis Lawrence; Lawrence Livermore National Laboratory; U.S. Nuclear Regulatory Commission. Software Reliability and Safety in Nuclear Reactor Protection Systems. UCRL-ID-114839, June 11, 1993 manuscript, Appendix pages 98–101, 1993. https://www.nrc.gov/reading-rm/doc-collections/nuregs/contract/cr6101/cr6101.pdf Accessed August 28, 2026.
  4. Jiwei Huang, Yeping Zhu, Bo Cheng, Chuang Lin, and Junliang Chen. A PetriNet-Based Approach for Supporting Traceability in Cyber-Physical Manufacturing Systems. Sensors 16(3):382, Published March 17, 2016; DOI 10.3390/s16030382, 2016. https://pmc.ncbi.nlm.nih.gov/articles/PMC4813957/ Accessed August 28, 2026.
  5. Blai Bonet, Patrik Haslum, Stefan Hickmott, Sylvie Thiébaux, and Stefan Edelkamp. Petri Nets (for Planners). International Conference on Automated Planning and Scheduling tutorial, ICAPS 2011 tutorial slides, 2011. https://bonetblai.github.io/tutorials/icaps11-petri.pdf Accessed August 28, 2026.
  6. Schematex Project. Petri Net syntax reference. Schematex 1.0.13 public documentation. https://schematex.js.org/docs/petri Accessed August 28, 2026.

Cite this article

Mara Voss. “Petri net firing sequence: markings, matrix equation, and two conservation checks.” Schematex Research. Version 2026-08-28. Updated August 28, 2026. https://schematex.js.org/research/petri-net-firing-sequence-worked-example