l4 - Lecture 4 Equivalence of Regular Expressions and...

This preview shows pages 1–9. Sign up to view the full content.

Lecture 4: Equivalence of Regular Expressions and Finite Automata David Dill Department of Computer Science 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Outline Converting Regular Expressions to ǫ -NFAs Converting NFAs to regular expressions. 2
From Regular Expressions to Finite Automata Theorem: For every regular expression R , there is an ǫ -NFA E such that L ( R ) = L ( E ) . It is easier to prove a stronger theorem: Theorem: For every regular expression R , there is an ǫ -NFA E with these properties: L ( E ) = L ( R ) . There is a single final state. No transitions enter the start state. No transitions leave the final state. The theorem is proved by induction on the structure of regular expressions. (A fully detailed proof would have a lot of tedious manipulation of ˆ δ s) 3

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Proof of R ǫ -NFA The proof is by induction on the structure of regular expressions. When R = , the NFA is: a See figure in text. A All four properties are obviously met. When R = ǫ , the NFA is a See figure in text. A All four properties are obviously met. 4
Proof of R ǫ -NFA, cont. When R = a , the NFA is a See figure in text. A All four properties are obviously met. When R = R 1 + R 2 , the NFA is: a See figure in text. A Assuming the induction hypothesis for R 1 and R 2 , all four conditions are obviously met. 5

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Proof of R ǫ -NFA, cont. R 1 R 2 a See figure in text. A Assuming the induction hypothesis for R 1 and R 2 , all four conditions are obviously met. R a See figure in text. A 6
Example: Regular expression to ǫ -NFA Example: ( 0 + 11 ) 0 7

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Implications We already know that ǫ -NFAs, NFAs, and DFAs have equal expressive power. The latest theorem shows that FA are at least as expressive as regular
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 19

l4 - Lecture 4 Equivalence of Regular Expressions and...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online