1 / 10

DFA-> Minimum DFA

DFA-> Minimum DFA. Module 05.4 COP4020 – Programming Language Concepts Dr. Manuel E. Bermudez. DFA-> Minimum DFA. Done. Soon. RG R RG L Minimum DFA RE NFA DFA. Now. Given a DFA M, there exists an equivalent minimal

richardj
Download Presentation

DFA-> Minimum DFA

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DFA-> Minimum DFA Module 05.4COP4020 – Programming Language Concepts Dr. Manuel E. Bermudez

  2. DFA-> Minimum DFA Done Soon RGR RGL Minimum DFA RE NFA DFA Now

  3. Given a DFA M, there exists an equivalent minimal DFA M’: no other equivalent DFA exists with fewer states than M’. State Minimization: Will build MDFA from DFA (not “surgery”). Start with two states: final and non-final. Split states only if necessary: minimum # of states. DFA-> Minimum DFA

  4. Definition: A partition of a set S is a set of subsets of S so that every element of S appears in exactly one of the subsets. Example: S = {1, 2, 3, 4, 5} Π1 = { {1, 2, 3, 4}, {5} } Π2 = { {1, 2, 3,}, {4}, {5} } Π3 = { {1, 3}, {2}, {4}, {5} } Π2 is a refinement of Π1, and Π3 is a refinement of Π2. DFA-> Minimum DFA

  5. Minimization Algorithm: Remove all undefined transitions by introducting a TRAP state, from which no final state is reachable. Partition all states into two groups (final states and non-final states). Complete the “Next State” table for each group, by specifying transitions from group to group. Form the next partition: split groups in which Next State table entries differ. Repeat 3,4 until no further splitting is possible. Determine start and final states. DFA-> Minimum DFA

  6. Example: Π0 = { {1, 2, 3, 4}, {5} } St. a b 1234 1234 1234 1234 1234 1234 1234 5 1234 1234 DFA-> Minimum DFA a b 2 4 a a 1 a b a b b 3 5 1 2 3 4 5 b Split {4} from partition {1,2,3,4}: Π1 = { {1, 2, 3},{4}, {5} }

  7. Π1 = { {1, 2, 3},{4}, {5} } St. a b 123 123 123 4 123 123 123 5 123 123 DFA-> Minimum DFA a b 2 4 a a 1 a b a b b 3 5 1 2 3 4 5 b Split {2} from partition {1,2,3} Π2 = { {1, 3}, {2}, {4}, {5} }

  8. Π2 = { {1, 3},{2},{4}, {5} } St. a b 2 13 2 13 2 4 2 5 2 13 DFA-> Minimum DFA a b 2 4 a a 1 a b a b b 3 5 b 1 3 2 4 5 b 13 No more splitting ! b a a a 5 2 a b Minimal DFA: b 4

  9. DFA-> Minimum DFA Done !! RGR RGL Minimum DFA RE NFA DFA

  10. Summary of Regular Languages Smallest class in the Chomsky hierarchy. Appropriate for lexical analysis. Four representations: RGR ,RGL , RE and FSA. All four are equivalent; algorithms to perform transformations among them. Various advantages and disadvantages among these four, for language designer, implementer, and user. FSA’s can be made deterministic, and minimal. summary

More Related