{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

notes09-10 Closure Properties of Regular Languages

# notes09-10 Closure Properties of Regular Languages - CS 373...

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

CS 373: Theory of Computation Gul Agha Mahesh Viswanathan Fall 2010 1

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

View Full Document
1 Closure Properties Closure Properties Recall that we can carry out operations on one or more languages to obtain a new language Very useful in studying the properties of one language by relating it to other (better under- stood) languages Most useful when the operations are sophisticated, yet are guaranteed to preserve interesting properties of the language. Today: A variety of operations which preserve regularity i.e., the universe of regular languages is closed under these operations Closure Properties Definition 1. Regular Languages are closed under an operation op on languages if L 1 , L 2 , . . . L n regular = L = op( L 1 , L 2 , . . . L n ) is regular Example 2 . Regular languages are closed under “halving”, i.e., L regular = 1 2 L regular. “reversing”, i.e., L regular = L rev regular. 1.1 Boolean Operators Operations from Regular Expressions Proposition 3. Regular Languages are closed under , and * . Proof. (Summarizing previous arguments.) L 1 , L 2 regular = ⇒ ∃ regexes R 1 , R 2 s.t. L 1 = L ( R 1 ) and L 2 = L ( R 2 ). = L 1 L 2 = L ( R 1 R 2 ) = L 1 L 2 regular. = L 1 L 2 = L ( R 1 R 2 ) = L 1 L 2 regular. = L * 1 = L ( R * 1 ) = L * 1 regular. Closure Under Complementation 2
Proposition 4. Regular Languages are closed under complementation, i.e., if L is regular then L = Σ * \ L is also regular. Proof. If L is regular, then there is a DFA M = ( Q, Σ , δ, q 0 , F ) such that L = L ( M ). Then, M = ( Q, Σ , δ, q 0 , Q \ F ) (i.e., switch accept and non-accept states) accepts L . What happens if M (above) was an NFA ? Closure under Proposition 5. Regular Languages are closed under intersection, i.e., if L 1 and L 2 are regular then L 1 L 2 is also regular. Proof. Observe that L 1 L 2 = L 1 L 2 . Since regular languages are closed under union and complementation, we have L 1 and L 2 are regular L 1 L 2 is regular Hence, L 1 L 2 = L 1 L 2 is regular. Is there a direct proof for intersection (yielding a smaller DFA)? Cross-Product Construction Let M 1 = ( Q 1 , Σ , δ 1 , q 1 , F 1 ) and M 2 = ( Q 2 , Σ , δ 2 , q 2 , F 2 ) be DFAs recognizing L 1 and L 2 , respec- tively. Idea: Run M 1 and M 2 in parallel on the same input and accept if both M 1 and M 2 accept. Consider M = ( Q, Σ , δ, q 0 , F ) defined as follows Q = Q 1 × Q 2 q 0 = h q 1 , q 2 i δ ( h p 1 , p 2 i , a ) = h δ 1 ( p 1 , a ) , δ 2 ( p 2 , a ) i F = F 1 × F 2 M accepts L 1 L 2 (exercise) What happens if M 1 and M 2 where NFAs? Still works! Set δ ( h p 1 , p 2 i , a ) = δ 1 ( p 1 , a ) × δ 2 ( p 2 , a ).

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.
• Fall '08
• Viswanathan,M
• Formal language, Regular expression, Regular language, Homomorphism, regular languages, inverse homomorphism

{[ snackBarMessage ]}