String Matching With Finite Automata and KMP
String Matching With Finite Automata and KMP
FINITE AUTOMATA
FINITE AUTOMATA
Where,
• Q is a finite set of states,
• q0 ∈ Q is the start state,
• A ⊆ Q is a distinguished set of accepting states,
• Σ is a finite input alphabet,
• δ is a function that maps from Q X Σ to Q, called the transition function of M.
FINITE AUTOMATA
• The finite automaton begins in state q0 and reads the characters of its
input string one at a time. If the automaton is in state q and reads input
character a, it moves (“makes a transition”) from state q to state δ (q,a).
Whenever its current state q is a member of A, the machine M has
accepted the string read so far. An input that is not accepted is
rejected
STRING-MATCHING AUTOMATA