1 / 104

Non-Deterministic Finite Automata

Non-Deterministic Finite Automata. Nondeterministic Finite Automaton (NFA). Alphabet =. Alphabet =. Two choices. Alphabet =. Two choices. No transition. No transition. First Choice. First Choice. First Choice. All input is consumed. “accept”. Second Choice. Second Choice.

Télécharger la présentation

Non-Deterministic Finite Automata

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 Finite Automata

  2. Nondeterministic Finite Automaton (NFA) Alphabet =

  3. Alphabet = Two choices

  4. Alphabet = Two choices No transition No transition

  5. First Choice

  6. First Choice

  7. First Choice All input is consumed “accept”

  8. Second Choice

  9. Second Choice Input cannot be consumed Automaton Halts “reject”

  10. An NFA accepts a string: if there is a computation of the NFA that accepts the string i.e., all the input string is processed and the automaton is in an accepting state

  11. is accepted by the NFA: “accept” “reject” because this computation accepts this computation is ignored

  12. Rejection example

  13. First Choice “reject”

  14. Second Choice

  15. Second Choice “reject”

  16. Another Rejection example

  17. First Choice

  18. First Choice Input cannot be consumed “reject” Automaton halts

  19. Second Choice

  20. Second Choice Input cannot be consumed Automaton halts “reject”

  21. An NFA rejects a string: if there is no computation of the NFA that accepts the string. For each computation: • All the input is consumed and the • automaton is in a non final state OR • The input cannot be consumed

  22. is rejected by the NFA: “reject” “reject” All possible computations lead to rejection

  23. is rejected by the NFA: “reject” “reject” All possible computations lead to rejection

  24. Language accepted:

  25. Lambda Transitions

  26. input tape head does not move

  27. all input is consumed “accept” String is accepted

  28. Rejection Example

  29. (read head doesn’t move)

  30. Input cannot be consumed Automaton halts “reject” String is rejected

  31. Language accepted:

  32. Another NFA Example

  33. “accept”

  34. Another String

  35. “accept”

  36. Language accepted

  37. Another NFA Example

  38. Language accepted (redundant state)

  39. Remarks: • The symbol never appears on the • input tape • Simple automata:

  40. NFAs are interesting because we can • express languages easier than DFAs NFA DFA

More Related