I am playing around the state machine concept trying to better understand the best areas of their application. The formal definition of an FSM contains the following elements:
- finite non-empty set of allowed states;
- an initial state;
- an alphabet ("allowed input symbols");
- state-transition function;
- and a set of final states.
I looked at a few online sources on this topic and noticed that all of them are focusing on the transition (state + input = new state) aspect of FSM. However, very little is said specifically about the final states of a machine.
So what I'd like to know is:
- either [the definition of] what exactly is the a final state;
- or what is the purpose of the final state (including practical applications).
That may let me infer the answers to a whole bunch of other related questions I have. E.g., what should happen if the state machine receives an input symbol that's not allowed; if that is an error then what's the way to recover; should an FSM-based system ready for a possibility of never reaching a final state; what if the setup of a machine makes it impossible to reach a final state in the first place; should an error state be a first class object of a FSM or not, whether the state machine should or should not store the input symbol sequence in real life systems...