This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: £ CS 373: Theory of Computation £ Madhusudan Parthasarathy Lecture 8: From DFA s/ NFA s to Regular Expres- sions 11 February 2010 In this lecture, we will show that any DFA can be converted into a regular expression. Our construction would work by allowing regular expressions to be written on the edges of the DFA , and then showing how one can remove states from this generalized automata (getting a new equivalent automata with the fewer states). In the end of this state removal process, we will remain with a generalized automata with a single initial state and a single accepting state, and it would be then easy to convert it into a single regular expression. 1 From NFA to regular expression 1.1 GNFA A Generalized NFA Consider an NFA N where we allowed to write any regular expression on the edges, and not only just symbols. The automata is allowed to travel on an edge, if it can matches a pre x of the unread input, to the regular expression written on the edge. We will refer to such an automata as a GNFA ( general- ized non-deterministic nite automata [Don't you just love all these shortcuts?]). Thus, the GNFA on the right, accepts the string abbbbaaba , since A abbbb---→ B aa-→ B ba-→ E. A B C E ab * aa ab ∪ ba a * ( aa ) * ∅ b * b ab To simplify the discussion, we would enforce the following conditions: (C1) There are transitions going from the initial state to all other states, and there are no transitions into the initial state. (C2) There is a single accept state that has only transitions coming into it (and no outgoing transitions). (C3) The accept state is distinct from the initial state. (C4) Except for the initial and accepting states, all other states are connected to all other states via a transition. In particular, each state has a transition to itself. When you can not actually go between two states, a GNFA has a transitions labelled with ∅ , which will not match any string of input characters. We do not have to draw these transitions explicitly in the state diagrams. 1 1.2 Top-level outline of conversion We will convert a DFA to a regular expression as follows: (A) Convert DFA to a GNFA , adding new initial and nal states. (B) Remove all states one-by-one, until we have only the initial and nal states....
View Full Document
This note was uploaded on 03/04/2010 for the course CS 373 taught by Professor Kuma during the Spring '10 term at University of Illinois at Urbana–Champaign.
- Spring '10