lect18 - Distinct regular expressions may represent the...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Example. Simplify a regular expression: Distinct regular expressions may represent the same language: a + b and b + a represent the same language { a , b }. Two expressions R and S that represent the same language, L ( R ) = L ( S ), are considered equal . For example, a + a * = a * because L ( a + a * ) = L ( a * ) = { λ , a , aa , aaa , …} λ + ab + abab ( ab ) * = ( ab ) * L ={ λ , ab , abab , ababab , …} aa ( b * + a )+ a ( ab * + aa ) = aa ( b * + a ) a ( a + b ) * + aa ( a + b ) * + aaa ( a + b ) * = a ( a + b ) * To prove it we can show that aa ( a+b ) * a ( a+b )( a+b ) * a ( a+b ) * and aaa ( a + b ) * a ( a+b ) * . Then use A B A B = B
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Properties of Regular Expressions 1) + properties R + T = T + R R + = + R = R R + R = R ( R+S ) +T=R+ ( S+T ) L ( R ) L ( T ) = L ( R ) L ( T ) L ( R ) ∪∅ = L ( R ) L ( R ) L ( R ) = L ( R ) ( L ( R ) L ( S )) L ( T ) = L ( R ) ( L ( S ) L ( T )) 2) ‘ ’ properties of regular expressions R ⋅ ∅ = ∅⋅ R = R ⋅ λ = λ⋅ R = R ( R S ) T=R ( S T ) 3) distributive properties of regular expressions R ( S + T )= R S + R T ( S + T ) R = S R + S T
Background image of page 2
3 4) closure properties * = λ * = λ R * = R * R * =( R * ) * = R + R * R * = λ + R * =( λ + R * ) * =( λ + R ) R * = λ + R R * R * =( R +…+ R k ) * for any k 1 R * = λ + R + R 2 +…+ R k - 1 + R k R * for any k 1 R * R = R R * ( R + S ) * =( R *+ S * ) * =( R * S * ) * =( R * S ) * R * = R *( SR * ) * R ( SR ) * =( RS ) * R ( R * S ) * = λ +( R + S ) * S ( RS * ) * = λ + R ( R + S ) *
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Proof. We need to prove two inclusion properties, i) R * R * R * and ii) R * R * R * . ii) To prove R * R * R * let's take arbitrary string w R * R * ……. .(1) to prove that w R * . Each of this properties can be proved. For example, let's prove that R * = R * R * . i) To prove R * R * R * it is sufficient to note that for any expression S (understand: for any set of strings, described by expression S ) S S R * because λ R * . (1)
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 20

lect18 - Distinct regular expressions may represent the...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online