Deterministic Finite Automaton
A Deterministic Finite Automaton (DFA) can be represented by a 5-tuple (Q, ∑, δ, q₀, F) where⦁ Q is a finite set of states.⦁ ∑ is a finite set of symbols called the alphabet.⦁ δ is the transition function where δ: Q × ∑ → Q⦁ q₀ is the initial state from where any input is processed (q₀ ∈ Q).⦁ F is a set of final state/states of Q (F ⊆ Q).A DFA is represented by digraphs called state diagram.⦁ The vertices represent the states.⦁ The arcs labeled with an input alphabet show the transitions.⦁ The initial state is denoted by an empty single incoming arc.⦁ The final state is indicated by double circles.Implement and test DFA functions for verifying and tokenizing binary strings.TaskWrite functions that verify and tokenize string by the following finite automaton:⦁ Q = {a, b, c},⦁ ∑ = {0, 1},q₀ = {a},⦁ F = {c},⦁ δ is represented by following tablePresent State Next State for 0 Next State for 1b c ac b cGraphically the above automaton can be presented as the following state diagraDetails⦁ Write function verify that verifies if the input string is accepted, i.e. DFA reached the final state c and no more symbol at the input, by the above DFA.⦁ The STATE type provides a collection of union subtypes which you can use to indicate a current DFA state.⦁ If an input string is accepted by DFA then return EOI state.⦁ If an input string is not accepted by DFA then return ERROR state.⦁ Write function tokenize that verifies if the input string is accepted, and converts the string characters into thetokens, i.e. DFA reached the final state c and no more symbol at the input, by the above DFA.⦁ The STATE type provides a collection of union subtypes which you can use to indicate a current DFA state.⦁ The TOKEN type provides a collection of union subtypes which represent tokens in a binary strings: ONE & ZERO.⦁ Return a list of tokens corresponding to the input string.⦁ If an input string cannot be tokenized by DFA then return empty list.