Today, we will introduce a system that
can evaluate
regular expressions.
Such systems are called Finite-state automata (FSA)
finite-state machines,
finite automata,
or simply state machines.
An FSA is an abstract machine that can be in
exactly one
of a finite number of states at any given time.
FSA can change from one state to another in response to inputs.
FSA are all around us!
Finite-state automata have
https://commons.wikimedia.org/wiki/File:Turnstile_state_machine_colored.svg
That is a state diagram.
Nodes (circles) represent states, edges (arrows) represent transitions from one state to another.
https://commons.wikimedia.org/wiki/File:Turnstile_state_machine_colored.svg
This state diagram also describes a special kind of FA:
Since every state has exactly one transition for each possible input, this is a deterministic FA.
In deterministic finite state machines, deterministic refers to the uniqueness of the computation run.
Transitions between states happen deterministically.
https://commons.wikimedia.org/wiki/File:DFA_example_multiplies_of_3.svg
In this state diagram, the incoming arrow is the start state, and we see an accept state which corresponds to an end state.
Here, the string “1001” would be accepted. What is the corresponding state sequence?
A DFA \(M\) is a 5-tuple, \(( Q, \Sigma, \delta , q_0 , F)\), consisting of
How do DFA relate to this?
Let’s consider a string \(w = a_1a_2 \ldots a_n\) over an alphabet \(\Sigma\).
The DFA \(M\) will accept the string \(w\), i.e. indicate a match, if there exists a sequence of states \(r_0, r_1, \ldots , r_n\) in \(Q\) with the following conditions:
Otherwise the string is rejected.
…to be continued.
Goddard
(2024)
FSA enable automation.
Acknowledgement:
This script is inspired by Goddard (2024).