Finite-State Automata and Regular Languages
(Content adapted from Critchlow & Eck)
We know now that our two models for mechanical language recognition actually recognize the same class of languages. The question still remains: do they recognize the same class of languages as the class generated mechanically by regular expressions? The answer turns out to be "yes". There are two parts to proving this: first that every language generated can be recognized, and second that every language recognized can be generated.
Regular Expression to NFA
Theorem: Every language generated by a regular expression can be recognized by an NFA.
Proof: The proof of this theorem is a nice example of a proof by induction on the structure of regular expressions. The definition of regular expression is inductive: , , and are the simplest regular expressions, and then more complicated regular expressions can be built from these. We will show that there are NFAs that accept the languages generated by the simplest regular expressions, and then show how those machines can be put together to form machines that accept languages generated by more complicated regular expressions.
Consider the regular expression . . Here is a machine that accepts :
Consider the regular expression . . Here is a machine that accepts :
Consider the regular expression . . Here is a machine that accepts :
Now suppose that you have NFAs that accept the languages generated by the regular expressions and . Building a machine that accepts is fairly straightforward: take an NFA that accepts and an NFA that accepts . Introduce a new state , connect it to the start states of