Equivalence with Finite Automata How do you show that if language is regular, it can be defined by a regular expression? How do you build a regular expression given a DFA? convert DFA into GNFA convert GNFA into regular expression What's a GNFA (Generalized Nondeterministic Finite Automaton)? NFA with transitions labeled by regular expressions How does a GNFA process input or execute? each transition reads a block of symbols from the input the block of symbols must match the regular expression How does a GNFA decide whether to accept or reject? accept if any way of processing input accepts What special restricted form of GNFA simplifies conversion to a regular expression? (Note: We won't use arrows labeled with empty-set.) no arrows into start state single accept state no arrows out of accept state accept state different from start state How do you convert a DFA into a GNFA in the special form? add a new start state add an epsilon arrow to the old start state add a new accept state epsilon arrows from the old accept states combine multiple labels/arrows using union Convert the DFA into a GNFA in the special form. (graph5.pdf) machine M1 in problem 1.1 (page 83) M1 = ( {1,2,3}, {a,b}, d, 1, {2} ) a b 1 2 1 2 3 3 3 2 1 How do you convert a GNFA into a regular expression? repeatedly build an equivalent GNFA with one fewer state How do you build an equivalent GNFA with one fewer state? When state qr is removed, what's the new label on the arrow from qi to qj, given that the old machine had the following arrows? from qi to qr labeled R1 from qr to qr labeled R2 from qr to qj labeled R3 from qi to qj labeled R4 (treat any missing arrows as arrows labeled with empty-set) When do you stop removing states from the machine? when the GNFA has only 2 states (start and accept) remaining the one remaining arrow is labeled with the desired expression Convert the machine into a regular expression. (graph5.pdf) machine M1 in problem 1.1 (page 83) M1 = ( {1,2,3}, {a,b}, d, 1, {2} ) a b 1 2 1 2 3 3 3 2 1 remove state 3 remove state 1 remove state 2 Classwork (You may work with a partner.) Convert the machine into a regular expression. (graph6.pdf) machine M2 in problem 1.1 (page 83) M2 = ( {1,2,3,4}, {a,b}, d, 1, {1,4} ) a b 1 1 2 2 3 4 3 2 1 4 3 4 remove state 4 remove state 3