notes09-10 Closure Properties of Regular Languages

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

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS 373: Theory of Computation Gul Agha Mahesh Viswanathan Fall 2010 1 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 ,F ) such that L = L ( M ). Then, M = ( Q, ,,q ,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 ,F ) defined as follows Q = Q 1 Q 2 q = 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...
View Full Document

This note was uploaded on 10/04/2011 for the course CS 373 taught by Professor Viswanathan,m during the Fall '08 term at University of Illinois, Urbana Champaign.

Page1 / 10

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

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

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