12.07.2015 Views

Closure properties of regular languages

Closure properties of regular languages

Closure properties of regular languages

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The Pumping Lemma& <strong>Closure</strong> PropertiesMartin FränzleInformatics and Mathematical ModellingThe Technical University <strong>of</strong> Denmark02140 Languages and Parsing, MF, Fall 2004 – p.1/8What you’ll learn1. Repeatable sub-strings:What’s “<strong>regular</strong>” about <strong>regular</strong> <strong>languages</strong>2. The pumping lemma:Shows that repeatable sub-strings are ubiquitious in infinite<strong>regular</strong> <strong>languages</strong>3. How to prove <strong>languages</strong> being non-<strong>regular</strong>:An application <strong>of</strong> the pumping lemma4. Some closure <strong>properties</strong> <strong>of</strong> the class <strong>of</strong> <strong>regular</strong> <strong>languages</strong>02140 Languages and Parsing, MF, Fall 2004 – p.2/8


£' ¢© ¤£#¨£¨¨ £¢!"!"% " ¥%" %$ &¤#¨!"!§¡¦¥¥¤¥£(¡¡¡RegularityBeanda DFA withwithtraversingin£:states,in £in £ in £removablerepeatable“Pumping”02140 Languages and Parsing, MF, Fall 2004 – p.3/8Non-<strong>regular</strong>ityAssume,¢-state DFA:traversingin %:INin $were <strong>regular</strong>, being accepted by anzeroesafter removalinrepeatableremovable onesin Shows that any DFA recognizing all strings infurther strings outside ¥.INrecognizescan’t be recognized by finite automata!02140 Languages and Parsing, MF, Fall 2004 – p.4/8


++*¤§)¢!*¦)£+*)¤£#¥¢©£©¤¨£¨£+¨#§¨!*¦)¤¥¤©£¥£¨£¤--¤¨+¢!* ¨,* ¨,*¤)*)*)¨¨£The pumping lemma for <strong>regular</strong> <strong>languages</strong>Thm: For each <strong>regular</strong> languagethat each ¥with1.,2. ¢,3.for eachIN.there is a constantcan be split intoIN suchsuch thatN.B.: Doesn’t imply that all <strong>regular</strong> <strong>languages</strong> are pumpable!All infinite ones are, however.Main use <strong>of</strong> pumping lemma is to prove non-<strong>regular</strong>ity <strong>of</strong> some¥!02140 Languages and Parsing, MF, Fall 2004 – p.5/8Non-<strong>regular</strong>ity — pro<strong>of</strong> recipeIn order to showto be non-<strong>regular</strong>, proceed as follows:1. Take IN arbitrarily (i.e., no constraints to be imposed fromyour side);2. Provide construction rules — obviously dependent onthe a word ¥with ¢.3. Take an arbitrary split <strong>of</strong>(a), and(b) ¢.intosatisfyingI.e., (a) and (b) are the only <strong>properties</strong> enforced.4. Provide a construction rule forIN such that,¤¢— for5. Prove that your constructions satisfy all their claimed <strong>properties</strong>( ¥, ¢, ¥), unless obvious.,¤02140 Languages and Parsing, MF, Fall 2004 – p.6/8¥.


36 45§ 4*¢¦)©2$§£% /-¦0/¨.$"¤"¦1$§ ++££§ £)£ ¨ )¨¨¨ *§ ¦*¨.¨ ¦¤$¢¢¤¤££5 6 43* § 4©) ¦¨+¨+¥¥¨¨ExamplesProve the following <strong>languages</strong> to be non-<strong>regular</strong>:For anyIN, take%, then pump.For anyIN, takein the splitis prime 7 " 87 ¨for a prime£. Then pump tois not prime.such that+.02140 Languages and Parsing, MF, Fall 2004 – p.7/8<strong>Closure</strong> <strong>properties</strong> <strong>of</strong> <strong>regular</strong> <strong>languages</strong>The <strong>regular</strong> <strong>languages</strong> are closed underunion — i.e., the union <strong>of</strong> two <strong>regular</strong> <strong>languages</strong> is <strong>regular</strong>,intersection — i.e., the intersection <strong>of</strong> two reg. lang.s is <strong>regular</strong>,complement — i.e., the complement <strong>of</strong> a reg. lang. is <strong>regular</strong>,difference — i.e., the difference <strong>of</strong> two reg. lang.s is <strong>regular</strong>,reversal — i.e., the language containing the reversals <strong>of</strong> thewords <strong>of</strong> a reg. lang. is <strong>regular</strong>,closure (Kleene star) — i.e., the closure <strong>of</strong> a reg. lang. is <strong>regular</strong>,concatenation — i.e., the catenation <strong>of</strong> two reg. lang.s is <strong>regular</strong>,homomorphism — i.e., the image <strong>of</strong> a reg. lang. under ahomomorphism is <strong>regular</strong>,inverse homomorphism — i.e., the pre-image <strong>of</strong> a reg. lang.under a homomorphism is <strong>regular</strong>.02140 Languages and Parsing, MF, Fall 2004 – p.8/8

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!