1 / 15

Regular Languages

Regular Languages. Closure Properties. A language that can be defined by a RE is called a regular language . Are all languages regular? NO. Theorem. If L1 and L2 are regular languages, then L 1 +L 2 , L 1 L 2 , and L 1 * Are also regular languages Proof (by RE)

Download Presentation

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. Regular Languages Dr. Shakir Al Faraji

  2. Closure Properties A language that can be defined by a RE is called a regular language. Are all languages regular? NO Dr. Shakir Al Faraji

  3. Theorem If L1 and L2 are regular languages, then L1+L2 , L1 L2 , and L1* Are also regular languages Proof (by RE) If L1 and L2 are regular languages, there are REs r1 and r2 that define these languages. Then (r1+ r2) is a RE that defines the language L1+L2. The language L1 L2 can be defined by the RE r1r2. The language L1* can be defined by the RE (r1)*. Dr. Shakir Al Faraji

  4. Theorem – Cont. Proof (by machine) Because L1 and L2 are regular languages, there must be TGs that accept them. Let TG1 accept L1 and TG2 accept L2. Let us further assume that TG1 and TG2 each have a unique start state and unique separate final state. The following TG accept the language L1+L2. Dr. Shakir Al Faraji

  5. L1+L2   - - - TG1 TG2 + + Theorem – Cont. Dr. Shakir Al Faraji

  6. + TG2 - TG2 1 2 Theorem – Cont. L1L2 Dr. Shakir Al Faraji

  7. -   TG1 + Theorem – Cont. L1* Dr. Shakir Al Faraji

  8. Complements Definition If L is a language over the alphabet , we define its complement, L’, to be the language of all strings of letters from  that are not words in L. Dr. Shakir Al Faraji

  9. Complements Theorem If L is a regular language, then L’ is also a regular language. Proof If L is a regular language, we know from kleene’s theorem that there is some FA that accepts the language L. Some of the states of this FA are final states and, most likely, some are not. Let us reverse the final status of each state: Final state to nonfinal state Nonfinal state to final state Dr. Shakir Al Faraji

  10. b a ± a b Complements-Example DFA for a language end with a Dr. Shakir Al Faraji

  11. b Complements-Example DFA for a language does not end with a b a + - a Dr. Shakir Al Faraji

  12. Intersections Theorem If L1 and L2 are regular languages, then L1∩L2 is also a regular language. Proof By DeMorgan’s law for sets of any kind (regular language or not): L1 ∩ L2 = ( L’1U L’2 )’ Dr. Shakir Al Faraji

  13. a a a,b b + - b b a ± a b Intersections-Example FA1 FA2 Dr. Shakir Al Faraji

  14. Intersections-Example Solution will be done in a class Dr. Shakir Al Faraji

  15. END Dr. Shakir Al Faraji

More Related