State-Transition Tables
bytes.zone
bytes.zone
Large tables are quite hard to understand, especially if there's no tooling around that, or the tooling was one-off hack and now it's lost
Once you get to the need for hierarchical state machines, finding the optimum decomposition into system/sub-systems and choice of this breakdown is by far the hardest part of and sizeable state machine implementation, in my experience.
I have written a state machine generator that both produces the table and the code (no allocation, as fast as hand optimized, suitable for embedded) for my multithreading runtime to visually detect logic/design bugs in the code used:
For the theory, mostly reading the following references (in the README) and ensuring that I don't stray too much from what they describe to ease formal verification and code audits in the future:
## References
- [Mealy State Machine](https://en.wikipedia.org/wiki/Mealy_machine)
- [Pushdown Automaton](https://en.wikipedia.org/wiki/Pushdown_automaton)
- [Communicating Finite State Machines](https://en.wikipedia.org/wiki/Communicating_finite-state_mac...)
- [Petri Nets](https://en.wikipedia.org/wiki/Petri_net)
- [Kahn Process Networks](https://en.wikipedia.org/wiki/Kahn_process_networks)
Extras
- [Overview/Slides from Marquette Embedded SystemS Laboratory](https://www.dejazzer.com/ece777/ECE777_3_system_modeling.ppt...)
- [Berkeley's Ptolemy project](https://ptolemy.berkeley.edu/index.htm)
Often I find forcing people to use the state table creates all sorts of problems, but all of them are related to the specifier actually having to know what they want, and being confronted by having to define it to the final detail.