CSCE 355 Foundations of Computation Lecture 10 Closure
- Slides: 30
CSCE 355 Foundations of Computation Lecture 10 Closure Properties of Regular Languages Topics: n June 13, 2015 Extended Reg. Expr Thompson Construction
Last Time: Readings 2. 3 n n n Mutual Induction Proof revisited Languages denoted by regular expressions Examples Ruby Regular Expressions TEST 2 – Monday New: n – 2– Readings section 3. 1, 3. 2(skip DFA RE), 3. 3 CSCE 355 Summer 2015
Homework • English descriptions Regular expressions n n n 3. 1. 1 b – The set of strings of 0’s and 1’s such that the tenth symbol from the right is a 1. 3. 1. 1 c - The set of strings of 0’s and 1’s with at most one pair of consecutive 1’s. 3. 1. 2 b The set of strings of 0’s and 1’s such that the number of zeroes is divisible by 5. • Regular expressions English descriptions n n 3. 14 b (0*1*)*000(0+1)* 3. 14 c (0+10)*1* • Regular expressions εNFA (construction) n n n 3. 2. 4 b (0+1)01 3. 2. 4 c 00(0+1)* 3. 14 b, 3. 14 c convert to εNFA • Text matching 3. 3. 1 re for matching phone numbers CSCE 355 Summer 2015 (international etc) – 3–
Regular expressions for Addresses • Why? n n So we can automatically read email messages and extract addresses and insert into DB Joe Shmo 532 Spring Lake Road Columbia, SC 29209 • Let’s start with Street Names n n – 4– Spring Lake Road | Rd | avenue | Street | … CSCE 355 Summer 2015
Mc. Naughton-Yamada Construction Examples – 5– CSCE 355 Summer 2015
Mc. Naughton-Yamada Construction Examples • Extended regular expressions – 6– CSCE 355 Summer 2015
Lex and Flex • Regular definitions • Pattern match • “. ” Last pattern • Examples digit = [0 -9] alpha= [a-z. A-Z_] id = {alpha} ({alpha} | {letter} | ‘_’)* %% id {install_In. Symbol. Table(yytext); return(ID); } while { return (KEYWHILE); } – 7– CSCE 355 Summer 2015
Compilation – 8– CSCE 355 Summer 2015
DFA Reg. Expr NFA DFA • Regular Languages – 9– CSCE 355 Summer 2015
Not every language can be recognized by a DFA! – 10 – CSCE 355 Summer 2015
Algebraic Laws for Arithmetic Expressions • Properties • Equivalence of two expressions – 11 – CSCE 355 Summer 2015
Algebraic Laws for Regular Expressions • What does it mean re 1=re 2 ? – 12 – CSCE 355 Summer 2015
Languages are Sets So Properties are Inherited • Commutativity Law for alternation n AUB = BUA so n rls=slr • Associativity Law for alternation n (r + s) + t = r + (s + t) • Associativity Law for concatenation n – 13 – (rs) t = r (st) CSCE 355 Summer 2015
Commutivity – 14 – CSCE 355 Summer 2015
Identity/Annihilator • Identity • – 15 – annihilator CSCE 355 Summer 2015
Distributive Laws • In algebra • Theorem 3. 11 If L, M, and N are any languages, then L(M U N) = LM U LN Proof: w is in L(M U N) if and only if w is in LM U LN w is in L(M U N) w is in LM U LN – 16 – CSCE 355 Summer 2015
Factoring and Simplifying • 0 + 01* = • 0(ϵ + 1*) = • 01* – 17 – CSCE 355 Summer 2015
Checking for Equality of Two Regular Expressions • s=r? • (r+s)* = r* s* – 18 – CSCE 355 Summer 2015
Idempotent Law • x+x? • xx ? – 19 – CSCE 355 Summer 2015
Laws involving Closures • (L*)* = • Ф* = ϵ • ϵ* = ϵ • L+ = L L* • L* = L+ + ϵ • L? – 20 – CSCE 355 Summer 2015
Is L intersection R regular? – 21 – CSCE 355 Summer 2015
Is the Complement of a Regular Lang. regular? – 22 – CSCE 355 Summer 2015
Not all Languages are regular • L = {0 n 1 n | n >= 1} – 23 – CSCE 355 Summer 2015
Every finite language is Regular – 24 – CSCE 355 Summer 2015
Discovering Laws for Regular Expressions • (L +M)* = (L*M*)* • Concretize expressions (only work for pure regular expressions, not intersections. ) – 25 – CSCE 355 Summer 2015
Theorem 3. 14 • Theorem 3. 14 The following test identifies true laws for regular expressions: • Test for a Regular-Expression Algebraic Law n to Test if regular expressions E = F is true (L(E) = L(F)) 1. Convert E and F to concrete regular expressions C and D by replacing Variables by a concrete symbol 2. Test whether L(C) = L(D) if so the E = F is true! – 26 – CSCE 355 Summer 2015
– 27 – CSCE 355 Summer 2015
Pumping Lemma – 28 – CSCE 355 Summer 2015
– 29 – CSCE 355 Summer 2015
– 30 – CSCE 355 Summer 2015
- Csce 355
- Csce 355
- 01:640:244 lecture notes - lecture 15: plat, idah, farad
- Ece 355
- Sanglier de turquie
- Ece 355 understanding behavior & family dynamics
- Iat 355
- Iat 355
- Sentencia c-355 de 2006
- Factors of 355
- Iat 355
- Iat 355
- Mahmut kunter
- Iat 355
- Kj 355
- Sn bilangan ganjil
- Sentencia c-355 de 2006
- Sanglier attila 355 kg
- 645 rounded to the nearest ten
- Drop factor constant
- Secure multiparty computation
- Tzu chieh wei
- Pda examples
- Eecs 1019
- The purpose of computation is insight not numbers
- Media computation
- Object space paradigm
- Computation of wealth tax
- Computation history
- Crystalloid solution example
- Drug calculation formula