1 / 23

NFA TO DFA

NFA TO DFA. Non Deterministic Features of NFA. There are three main cases of non- determinism in NFAs: Transition to a state without consuming any input. Multiple transitions on the same input symbol. No transition on an input symbol.

zeal
Download Presentation

NFA TO 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. NFA TO DFA

  2. Non Deterministic Features of NFA There are three main cases of non- determinism in NFAs: • Transition to a state without consuming any input. • Multiple transitions on the same input symbol. • No transition on an input symbol. To convert NFAs to DFAs we need to get rid of non-determinism from NFAs.

  3. Subset Construction Method Using Subset construction method to convert NFA to DFA involves the following steps: • For every state in the NFA, determine all reachable statesfor every input symbol. • The set of reachable states constitute a single state in the converted DFA (Each state in the DFA corresponds to a subset of states in the NFA). • Find reachable states for each new DFA state, until no more new states can be found.

  4. Subset Construction Method Fig1. NFA without λ-transitions

  5. Fig1. NFA without λ-transitions Subset Construction Method 3 a b a a 2 a b a,b 1 5 a a,b 4 b

  6. Fig1. NFA without λ-transitions Step1 Subset Construction Method 3 a b a a 2 a b Construct a transition table showing all reachable states for every state for every input signal. a,b 1 5 a a,b 4 b

  7. Fig1. NFA without λ-transitions Fig2. Transition table Subset Construction Method 3 a b a a 2 a b a,b 1 5 a a,b 4 b

  8. Fig1. NFA without λ-transitions Fig2. Transition table Subset Construction Method 3 a b a a 2 a b a,b 1 5 a a,b 4 b

  9. Fig1. NFA without λ-transitions Fig2. Transition table Subset Construction Method Transition from state q with input a Transition from state q with input b 3 a b Starts here a a 2 a b a,b 1 5 a a,b 4 b

  10. Subset Construction Method Fig2. Transition table Step2 The set of states resulting from every transition function constitutes a new state. Calculate all reachable states for every such state for every input signal.

  11. Fig3. Subset Construction table Starts with Initial state Fig2. Transition table

  12. Fig3. Subset Construction table Starts with Initial state Fig2. Transition table

  13. Fig3. Subset Construction table Starts with Initial state Fig2. Transition table Step3 Repeat this process(step2) until no more new states are reachable.

  14. Fig3. Subset Construction table Fig2. Transition table

  15. Fig3. Subset Construction table Fig2. Transition table

  16. Fig3. Subset Construction table Fig2. Transition table

  17. Fig3. Subset Construction table Fig2. Transition table

  18. Fig3. Subset Construction table Fig2. Transition table We already got 4 and 5. So we don’t add them again.

  19. Fig3. Subset Construction table Fig2. Transition table

  20. Fig3. Subset Construction table Fig2. Transition table

  21. Fig3. Subset Construction table Fig2. Transition table

  22. Fig3. Subset Construction table Fig2. Transition table Stops here as there are no more reachable states

  23. Fig4. Resulting FA after applying Subset Construction to fig1 Fig3. Subset Construction table a b a 12345 245 35 a a,b a b b a ∅ 1 3 b a,b b a 2 a b 45 5 b a 4 b

More Related