More Applications of the Pumping Lemma 1 The
- Slides: 43
More Applications of the Pumping Lemma 1
The Pumping Lemma: • Given a infinite regular language • there exists an integer • for any string with length • we can write • with • such that: and 2
Non-regular languages Regular languages 3
Theorem: The language is not regular Proof: Use the Pumping Lemma 4
Assume for contradiction that is a regular language Since is infinite we can apply the Pumping Lemma 5
Let be the integer in the Pumping Lemma Pick a string such that: length pick 6
Write From the Pumping Lemma it must be that length 7
We have: From the Pumping Lemma: Thus: 8
Therefore: BUT: CONTRADICTION!!! 9
Therefore: Our assumption that is a regular language is not true Conclusion: is not a regular language 10
Non-regular languages Regular languages 11
Theorem: The language is not regular Proof: Use the Pumping Lemma 12
Assume for contradiction that is a regular language Since is infinite we can apply the Pumping Lemma 13
Let be the integer in the Pumping Lemma Pick a string such that: length pick 14
Write From the Pumping Lemma it must be that length 15
We have: From the Pumping Lemma: Thus: 16
Therefore: BUT: CONTRADICTION!!! 17
Therefore: Our assumption that is a regular language is not true Conclusion: is not a regular language 18
Non-regular languages Regular languages 19
Theorem: The language is not regular Proof: Use the Pumping Lemma 20
Assume for contradiction that is a regular language Since is infinite we can apply the Pumping Lemma 21
Let be the integer in the Pumping Lemma Pick a string such that: length pick 22
Write From the Pumping Lemma it must be that length 23
We have: From the Pumping Lemma: Thus: 24
Therefore: And since: There is : 25
However: for any 26
Therefore: BUT: and CONTRADICTION!!! 27
Therefore: Our assumption that is a regular language is not true Conclusion: is not a regular language 28
Lex 29
Lex: a lexical analyzer • A Lex program recognizes strings • For each kind of string found the lex program takes an action 30
Output Input Var = 12 + 9; if (test > 20) temp = 0; else while (a < 20) temp++; Lex program Identifier: Var Operand: = Integer: 12 Operand: + Integer: 9 Semicolumn: ; Keyword: if Parenthesis: ( Identifier: test. . 31
In Lex strings are described with regular expressions Lex program Regular expressions “+” “-” “=“ /* operators */ “if” “then” /* keywords */ 32
Lex program Regular expressions (0|1|2|3|4|5|6|7|8|9)+ (a|b|. . |z|A|B|. . . |Z)+ /* integers */ /* identifiers */ 33
integers (0|1|2|3|4|5|6|7|8|9)+ [0 -9]+ 34
identifiers (a|b|. . |z|A|B|. . . |Z)+ [a-z. A-Z]+ 35
Each regular expression has an associated action (in C code) Examples: Regular expression Action n linenum++; [0 -9]+ prinf(“integer”); [a-z. A-Z]+ printf(“identifier”); 36
Default action: ECHO; Prints the string identified to the output 37
A small program %% [ tn] ; /*skip spaces*/ [0 -9]+ printf(“Integern”); [a-z. A-Z]+ printf(“Identifiern”); 38
Output Input 1234 test var 566 9800 78 Integer Identifier Integer 39
%{ int linenum = 1; %} Another program %% [ t] n ; /*skip spaces*/ linenum++; [0 -9]+ prinf(“Integern”); [a-z. A-Z]+ printf(“Identifiern”); . printf(“Error in line: %dn”, 40 linenum);
Output Input 1234 test var 566 9800 + temp 78 Integer Identifier Integer Error in line: 3 Identifier 41
Lex matches the longest input string Example: Regular Expressions Input: Matches: ifend if “ifend” “if” “ifend” ifn nomatch 42
Internal Structure of Lex Regular expressions NFA DFA Minimal DFA The final states of the DFA are associated with actions 43
- More more more i want more more more more we praise you
- More more more i want more more more more we praise you
- Applications of pumping lemma for cfl
- Pumping lemma applications
- Applications of pumping lemma
- Pumping lemma for cfl examples
- Pumping lemma meme
- Pumping lemma pigeonhole principle
- Pumping lemma for context-free languages examples
- Torzi cfg
- Pumping lemma for context free languages
- Contradict example
- Npdas
- Pumping lemma 예제
- Pumping lemma proof
- Pumping lemma non regular languages examples
- Pumping lemma for cfls
- Database mis
- Lemma and palea
- Black scholes ito lemma
- Patrizia lemma
- Snake lemma scene
- Ceas lemma
- Pumpáló lemma
- Schwartz-zippel lemma and polynomial identity testing
- Locc
- Königsberg
- Leftover hash lemma
- Subgraf
- Roy's identity
- Fazör
- Grass flower diagram
- Handshaking lemma
- Itos lemma
- Burnsides lemma
- Schur lemma
- Lemma consulting
- Qn graph
- Intext: "pumping"
- Ion pumps in the pumping speed range 150 to 1000 l/s
- Direct conversion pumping in laser
- Getter pumping speed
- Ekman pumping
- Pumping theorem