1 / 79

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. First Choice. All input is consumed. “accept”. Second Choice.

lucy-burt
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

  8. First Choice All input is consumed “accept”

  9. Second Choice

  10. Second Choice

  11. Second Choice No transition: the automaton hangs

  12. Second Choice Input cannot be consumed “reject”

  13. An NFA accepts a string: when there is a computation of the NFA that accepts the string There is a computation: all the input is consumed and the automaton is in an accepting state

  14. Example is accepted by the NFA: “accept” “reject” because this computation accepts

  15. Rejection example

  16. First Choice

  17. First Choice “reject”

  18. Second Choice

  19. Second Choice

  20. Second Choice “reject”

  21. An NFA rejects a string: when 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. Three major differences between FA & NFA • Each entry in the table of NFA is a set. • Allow as the second argument of . This means that the NFA can make a transition function without consuming an input symbol. • The set may be empty.

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

  24. Rejection example

  25. First Choice

  26. First Choice No transition: the automaton hangs

  27. First Choice Input cannot be consumed “reject”

  28. Second Choice

  29. Second Choice

  30. Second Choice No transition: the automaton hangs

  31. Second Choice Input cannot be consumed “reject”

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

  33. Language accepted:

  34. Lambda Transitions

  35. (read head does not move)

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

  37. Rejection Example

  38. (read head doesn’t move)

  39. No transition: the automaton hangs

  40. Input cannot be consumed “reject” String is rejected

  41. Language accepted:

  42. Another NFA Example

  43. “accept”

More Related