1 / 75

Formal Languages NFAs Accept the Regular Languages

Formal Languages NFAs Accept the Regular Languages. Equivalence of Machines. Definition: Machine is equivalent to machine if. Example of equivalent machines. NFA. FA. We will prove:. Languages accepted by NFAs. Regular Languages. Languages accepted by FAs.

rowena
Télécharger la présentation

Formal Languages NFAs Accept the Regular Languages

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. Formal Languages NFAs Accept the Regular Languages

  2. Equivalence of Machines • Definition: • Machine is equivalent to machine • if

  3. Example of equivalent machines NFA FA

  4. We will prove: Languages accepted by NFAs Regular Languages Languages accepted by FAs NFAs and FAs have the same computation power

  5. We will show: Languages accepted by NFAs Regular Languages Languages accepted by NFAs Regular Languages

  6. Proof-Step 1 Languages accepted by NFAs Regular Languages Proof?

  7. Proof-Step 1 Languages accepted by NFAs Regular Languages Proof: Every FA is trivially an NFA Any language accepted by a FA is also accepted by an NFA

  8. Proof-Step 2 Languages accepted by NFAs Regular Languages Any NFA can be converted to an equivalent FA Proof: Any language accepted by an NFA is also accepted by a FA

  9. Convert NFA to FA NFA FA

  10. Convert NFA to FA NFA FA

  11. Convert NFA to FA NFA FA

  12. Convert NFA to FA NFA FA

  13. Convert NFA to FA NFA FA

  14. Convert NFA to FA NFA FA

  15. Convert NFA to FA NFA FA

  16. NFA to FA Conversion • We are given an NFA • We want to convert it • to an equivalent FA • With

  17. What we need to construct • Finite Automaton (FA) : set of states : input alphabet : transition function : initial state : set of accepting states

  18. If the NFA has states • the FA has states in the power set

  19. Procedure NFA to FA • 1. Initial state of NFA: • Initial state of FA:

  20. Example NFA FA

  21. Procedure NFA to FA • 2. For every FA’s state • Compute in the NFA • Add transition to FA

  22. Example NFA FA

  23. Procedure NFA to FA • Repeat Step 2 for all letters in alphabet, • until • no more transitions can be added.

  24. Example NFA FA Done?

  25. Procedure NFA to FA • 3. For any FA state • If is accepting state in NFA • Then, • is accepting state in FA

  26. Example NFA FA

  27. Theorem Take NFA Apply procedure to obtain FA Then and are equivalent :

  28. Proof AND

  29. First we show: Take arbitrary: We will prove:

  30. denotes

  31. We will show that if then

  32. More generally, we will show that if in : (arbitrary string) then

  33. Proof by induction on Induction Basis: Is true by construction of

  34. Induction hypothesis:

  35. Induction Step:

  36. Induction Step:

  37. Therefore if then

  38. We have shown: We also need to show: (proof is similar)

  39. Induction Step: All cases covered?

  40. Single Accepting State for NFAs

  41. Any NFA can be converted • to an equivalent NFA • with a single accepting state

  42. Example NFA Equivalent NFA with single accepting state?

  43. Example NFA Equivalent NFA

  44. In General NFA Equivalent NFA Single accepting state

  45. Add an accepting state without transitions Extreme Case NFA without accepting state

  46. Properties of Regular Languages

  47. Union: Concatenation: Are regular Languages For regular languages and we will prove that: Star: Reversal: Complement: Intersection:

  48. Union: Concatenation: We say: Regular languages are closed under Star: Reversal: Complement: Intersection:

  49. Regular language Regular language NFA NFA Single accepting state Single accepting state

More Related