Over the past year, this blog has accumulated a library of Petri net models — coffee shops, tic-tac-toe, sudoku, knapsack problems, enzyme kinetics, Texas Hold'em — alongside concept posts on DDM, the token language, zero-knowledge proofs, and declarative infrastructure. Each post stood on its own, but taken together they trace a path from first principles to working systems.
I've organized that path into a book: Petri Nets as a Universal Abstraction: A Practitioner's Guide to Modeling with pflow.
The diagram is the table of contents as it stood at launch in February 2026: eighteen chapters and four appendices. The book has grown since. Part III split and gained chapters, an epilogue and a fifth appendix were added, and it now runs to twenty-one chapters. The part-by-part tour below follows the current table of contents.
Blog posts are good for snapshots. A book is better for structure.
The individual posts here were written as they came — a model one week, a concept the next, a tool walkthrough after that. A reader arriving fresh had no clear entry point: start with DDM? The token language? Jump straight to tic-tac-toe? The book answers that question by laying out a deliberate progression: theory first, then worked examples, then advanced topics, then the toolchain that ties it all together.
The book also fills in what the blog posts skipped: the mathematics of incidence matrices and P-invariants, the formal firing rules, conservation laws, and the connection between mass-action kinetics and ODE solvers. These ideas were implicit in the blog models, but no post ever treated them properly.
Starts with why Petri nets — what informal models get wrong and what a four-element formalism (places, transitions, arcs, tokens) gets right. Then the mathematics: the 5-tuple definition, markings as state vectors, incidence matrices, P-invariants, and conservation laws. Chapter 3 bridges the gap between discrete event simulation and continuous ODE analysis via mass-action kinetics. Chapter 4 introduces the token language — the four-term DSL (cell, func, arrow, guard) that every pflow model speaks.
If you've read the DDM and token language posts, these chapters expand on what you already know.
Six worked examples, each a blog post grown into a full chapter. The coffee shop becomes a resource modeling tutorial. Tic-tac-toe becomes a lesson in mutual exclusion and history-based pattern detection. Sudoku handles constraint satisfaction with constraint-collector transitions, one per row, column and block, each firing once its region is complete. These are the tic-tac-toe pattern collectors, generalized. The knapsack problem shows continuous relaxation applied to combinatorial optimization. Enzyme kinetics reveals that mass-action semantics were borrowed from biochemistry in the first place. Texas Hold'em tackles multi-phase state machines with role-based guards.
Each chapter builds its model from scratch, simulates it, and analyzes the results. The game and puzzle chapters go a step further and use the ODE to rank moves, with no search of the game tree.
At launch this part had four chapters. It now has six. Process mining (Chapter 11) discovers Petri nets from event logs, learns transition rates from the timing, and uses the learned model for predictive monitoring. Zero-knowledge proofs (Chapter 12) show how to prove a state transition is valid without revealing the state, with MiMC hashing and Groth16 circuits built by hand. Chapters 13 and 14 were split out after launch. Topology-Driven Verification has the petrigen compiler generate the gnark circuits from the net's topology instead. It also contains the result behind the incidence reduction: the center > corner > edge heuristic falls out of counting win-line connections. On-Chain ZK Verification compiles guards into arithmetic constraints, commits state with Merkle trees, and verifies proofs in a Solidity contract. Exponential weights (Chapter 15) explores the boundary between net structure and external logic. Declarative infrastructure (Chapter 16) connects Petri nets to JSON-LD and content addressing, under the principle of monotonic expansion.
The ZK Petri nets and JSON-LD posts are the closest blog counterparts here.
The toolchain chapters. How to use pflow.xyz as a visual editor. How petri-pilot generates full-stack applications from models. How go-pflow works under the hood: its solver, reachability analysis, and verification APIs. And the dual implementation pattern: Go and JavaScript producing identical outputs from identical inputs, with state root parity as the check that the specification is unambiguous. Chapter 20 now carries that discipline past two runtimes, to twenty-odd implementations held to one golden trace. Byte-Exact Across Four Languages is the same discipline applied to stochastic simulation.
Chapter 21, What the Abstraction Sits On, was added within a week of launch. It names the layered stack the book builds without saying so. It also argues that the strongest result in the book sits underneath the Petri net rather than in it: in Chapter 13, strategic value comes from graph connectivity alone. Appendix E, Categorical Foundations, followed in March. It covers the symmetric monoidal structure that the SMC post develops. Since August it has also carried the two-boundaries table (ρ inside the incidence matrix, contextual arcs outside it) that came out of revising The Category Settle.
Readers of this blog will recognize most of the applied material. What the book adds is mostly the connective tissue. The formal mathematics (incidence matrices, P-invariants, conservation laws, reachability) gets its own treatment instead of being assumed. Process mining, which the blog had barely touched, gets a whole chapter. The five categorical net types (Workflow, Resource, Game, Computation, Classification) move into Chapter 4 and become the lens the epilogue uses to reread the six applications. Chapters also cross-reference each other forward and backward, which a run of standalone posts never did. The book has no exercises, despite what an earlier version of this post said.
The preface offers two tracks. The theory track reads Parts I and III. The hands-on track skims Part I for vocabulary, then goes to Part II's worked examples and Part IV's tooling guides.
The book is live at book.pflow.xyz. The blog continues alongside it — new models and ideas will appear here first, and the best ones will find their way into future chapters.
The premise hasn't changed: small models beat black boxes. The book just gives that premise a spine.
Revised 2026-09-27, checked against the book source and the live table of contents: