1 / 37

Non-Deterministic Automata Regular Expressions

Non-Deterministic Automata Regular Expressions. NFA Example. NFA Example. Input aplhabet, i.e. Formal Definition of NFAs. Set of states, i.e. Transition function. Initial state. Final states. Transition Function. Extended Transition Function. Formally. It holds. if and only if.

freja
Download Presentation

Non-Deterministic Automata Regular Expressions

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. Non-Deterministic AutomataRegular Expressions

  2. NFA Example

  3. NFA Example

  4. Input aplhabet, i.e. Formal Definition of NFAs Set of states, i.e. Transition function Initial state Final states

  5. Transition Function

  6. Extended Transition Function

  7. Formally It holds if and only if there is a walk from to with label

  8. The Language of an NFA

  9. Formally • The language • accepted by NFA is: • where • and there is some (final state)

  10. Equivalence of NFAs and DFAs • For DFAs or NFAs: • Machine is equivalent to • if

  11. Example NFA DFA

  12. Since • machines and are equivalent NFA DFA

  13. Equivalence of NFAs and DFAs • Every DFA is also an NFA • A language accepted by a DFA will be accepted by an NFA • An NFA is as least as powerful as a DFA • Is an DFA as powerful as an NFA?

  14. Is a DFA as Powerful as an NFA? • Answer: YES! • A language accepted by an NFA will be accepted by some DFA • For every NFA there is an equivalent DFA • that accepts the same language

  15. NFAs Accept the Regular Languages • For every NFA there is an equivalent DFA • The language accepted by a DFA is regular • The language accepted by an NFA is regular

  16. NFA to DFA NFA DFA

  17. NFA to DFA NFA DFA

  18. NFA to DFA NFA DFA

  19. NFA to DFA NFA DFA

  20. NFA to DFA NFA DFA

  21. NFA to DFA NFA DFA

  22. NFA to DFA NFA DFA

  23. NFA to DFA NFA DFA

  24. NFA to DFA Observations • We are given an NFA • We want to convert it • to an equivalent DFA • With

  25. If the NFA has states • The DFA has states in the powerset

  26. Procedure NFA to DFA • 1. Initial state of NFA: • Initial state of DFA:

  27. Example NFA DFA

  28. Procedure NFA to DFA • 2. For every DFA’s state • Compute in the NFA • Giving union • Add a transition

  29. Exampe NFA DFA

  30. Procedure NFA to DFA • Repeat Step 2 for all letters, • until • no more transitions can be added.

  31. Example NFA DFA

  32. Procedure NFA to DFA • 3. For any DFA state • If some is a final state for the NFA • Then, • is a final state for the DFA

  33. Example NFA DFA

  34. Theorem Take NFA Apply procedure to obtain DFA Then and are equivalent :

More Related