1 / 10

Regular expressions Regular languages

Regular expressions Regular languages. Sipser 1.3 (pages 63-76). Last time…. Regular expressions. Definition 1.52: Say that R is a regular expression if R is a for some a in the alphabet Σ ε Ø ( R 1 ∪ R 2 ), where R 1 and R 2 are regular exressions

rosina
Download Presentation

Regular expressions 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 expressionsRegular languages Sipser 1.3 (pages 63-76)

  2. Last time…

  3. Regular expressions • Definition 1.52: Say that R is a regular expression if R is • a for some a in the alphabet Σ • ε • Ø • (R1∪R2), where R1 and R2 are regular exressions • (R1°R2), where R1 and R2 are regular expressions • (R1*), where R1is a regular expression

  4. Regular expressions and NFAs • Theorem 1.54: A language is regular if and only if some regular expression describes it. • Proof (⇐) • If a ∈ Σ, then a is regular. • ε is regular. • Ø is regular. • If R1 and R2 are regular, then (R1∪R2) is regular. • If R1 and R2 are regular, then (R1°R2) is regular. • If R1 is a regular, then (R1*) is regular

  5. Today…

  6. Going forward • Theorem 1.54: A language is regular if and only if some regular expression describes it. • (⇒) 3-state DFA 5-state GNFA 4-state GNFA regular expression 2-state GNFA 3-state GNFA

  7. Generalized NFA Transition to every other state, but no transitions in Transitions in from every other state, but no transitions out Exactly one arrow to and from every state (including itself) other than start and accept

  8. Proof DFA to GNFA… • Step 1: Add a unique start state with an εjump to the original one • Step 2: Add a unique accept state with εjumps from the previous accept states • Step 3: Convert multiple labels to ∪ • Step 4: Add Ø jumps for any transition that’s missing

  9. Induction step: rip a state

  10. A simple example

More Related