- Author
- J.V. Noble, Institute for Nuclear and Particle Physics, University of Virginia
- Published
- Undated (the page notes it was formatted 11 June 1994 and 17 April 1995)
- Kind
- Technical note for Forth programmers, with worked code
- Original
- www.forth.org/literature/noble.html
- Subject
- Compilers and interpreters
- Themes
- Small means, Rules that generate
What it is
J.V. Noble, of a university physics institute, wrote this note for Forth programmers. It gives methods for deterministic and nondeterministic finite state automata. The stated goal is a one-to-one match between the definition and the state table.
What it says
- Noble says nested IF logic is hard to read, debug or modify. It can also be slow.
- The note replaces history flags with one state variable. A state table gives actions and transitions.
- A brute-force version uses CASE: with one word per state. The note calls it inadequately factored.
- The defining word FSM: compiles a table of execution tokens. State and input column index it.
- The note's elegant version reads like the state table. Named transitions such as >1 follow each action.
- Using a word, not a number, for each transition allows nondeterministic machines. No other redefinition is needed.
What evidence it gives
The note gives complete Forth definitions and short console tests for the number-entry example. It adds an identifier recognizer and floating-point recognizers. It cites no benchmarks, so the speed claims are argument only.
Interests and limits
Some code works only on indirect-threaded Forths, and an appendix gives alternatives. Some helper words are left as an exercise. The claim about speed was not measured.
Connections
These links are this wiki's own reading, not claims the sources make.
- agents need control flow, not more prompts. The blog post wants explicit state transitions, with the model as one component. Noble's old note shows what that can look like: a table you can read. Noble also makes each transition a word, which permits nondeterministic machines. A model call could be one such word.