SlideShare a Scribd company logo
1 of 35
Regular VS Non Regular
Languages
Lecture 14
Faryal Shamsi
Lecturer Computer Science
Sukkur IBA University
Regular Languages
• A language that can be defined with a Regular Expression
• By Kleene’s Theorem we know that –
• RE=TG=FA
• Therefore, we can say that –
• A regular language can be defined with a Regular Expression, a Transition
Graph and a Finite Automata
• The result stated in this theorem is often expressed by saying:
• The set of regular languages is closed under –
• union, concatenation, and the Kleene star operator.
Proof by Machines (Union)
Proof by Machines (Concatenation)
Proof by Machines (Closure)
Working Example
R1 = a(a + b)*a + b(a + b)*b
R2 = (a + b)* aba (a + b)*
Working Example
R1 = a(a + b)*a + b(a + b)*b R2 = (a + b)* aba (a + b)*
Proof by Machines (Union)
a(a + b)*a + b(a + b)*b + (a + b)* aba (a + b)*
Proof by Machines (Concatenation)
a(a + b)*a + b(a + b)*b (a + b)* aba (a + b)*
Proof by Machines (Closure)
[ a(a + b)*a + b(a + b)*b ]*
Regular Languages are Closed under:
• Union
• Concatenation
• Closure
• Complement
• Intersection
• Difference
• Non regular languages may not have these properties
Example - Complement
Complement
Intersection
Intersection
Intersection FA1’ U FA2’
Intersection
FA1’ + FA2’ (FA1’ + FA2’)’
Non Regular Languages
• A language that can not be defined with a Regular Expression
(neither with a finite automata or transition graph), is said to be non-
regular language
• For Example: If  = {a,b} then
• PALINDROME = { , a, b, aa, bb, aba, bab, abba, baab, ababa, … }
• EQUAL = { , ab, aabb, abab, bbaa, baba, aabbab …}
Non Regular Languages
• A language that can not be defined with a Regular Expression or Finite
Automata or Transition Graph
• For Example –
When the range of the abstract exponent n is unspecified we
mean to imply that it is 0,1,2,3 …
Example: anbn
• We shall now show that this language is nonregular.
• Let us note: anbn  a*b*
• Though, that it is a subset of many regular languages, such as a*b*,
which, however, also includes such strings as aab and bb that {anbn}
does not.
• Let us be very careful to note that {a"b } is not a regular expression.
• It involves the symbols { } and n that are not in the alphabet of regular
expressions.
Pumping Lemma
Pumping Lemma – Proof
Example 1 – Proving Regularity of Language
Example
• Will it accept xyyz? xyyy? xyyyz?
Example 2 – Non-regularity of a Language
• Let,
• w=aaabbb x=aa , y=ab , z=bb w’= xyyz = aaababbb
• w=aaabbb x=a , y=aa , z=bbb w’= xyyz = aaaaabbb
• Is PRIME a regular language?
Example 3
Consider this case
• PALINROME is a non regular language.
• We cannot always use the first version of the Pumping Lemma to do
this because the string W=aba, satisfy the lemma and do not
contradict the language:
w= xynz x=a y=b z=a
• So, we have another way to express Pumping Lemma
Proof:
• Let us consider one of the FA's that might accept PALINDROME
• Consider this FA has 77 states, and it accepts a80ba80
• Now the palindrome must be accepted by this machine and it has
more letters than the machine has states.
(We should’t break ‘aba’ or ‘aabaa’ and so on…)
• This means that we can break w into the three parts, x, y, and z.
Proof:
• But since the length of x and y must be in total 77 or less, they must
both be made of solid a's, since the first 77 letters of w are all a's.
• That means when we form the word xyyz we are adding more a's on
to the front of w.
• But we are not adding more a's on to the back of w since all the rear
a's are in the z part, which stays fixed at 80 a's.
• But the second version of the Pumping Lemma said that
PALINDROME has to include. this string. Therefore, the second
version does not apply to the language PALINDROME, which means
that PALINDROME is nonregular.
Example 4
• Consider the language of Arithmetic Expressions –
• Try and Construct an FA or RE to recognize it
Defining a Non Regular Language
• Let’s recall the concept of ‘Recursive Definition’.
• Reference: Chapter. 3, Lecture 7
• We can define Asthmatic Expressions using Recursive Rules –

More Related Content

What's hot

Type checking in compiler design
Type checking in compiler designType checking in compiler design
Type checking in compiler designSudip Singh
 
Variants of Turing Machine
Variants of Turing MachineVariants of Turing Machine
Variants of Turing MachineRajendran
 
heap Sort Algorithm
heap  Sort Algorithmheap  Sort Algorithm
heap Sort AlgorithmLemia Algmri
 
NFA or Non deterministic finite automata
NFA or Non deterministic finite automataNFA or Non deterministic finite automata
NFA or Non deterministic finite automatadeepinderbedi
 
Automata theory - Push Down Automata (PDA)
Automata theory - Push Down Automata (PDA)Automata theory - Push Down Automata (PDA)
Automata theory - Push Down Automata (PDA)Akila Krishnamoorthy
 
Pumping lemma for regular set h1
Pumping lemma for regular set h1Pumping lemma for regular set h1
Pumping lemma for regular set h1Rajendran
 
Introduction TO Finite Automata
Introduction TO Finite AutomataIntroduction TO Finite Automata
Introduction TO Finite AutomataRatnakar Mikkili
 
Variants of Turing Machine
Variants of Turing MachineVariants of Turing Machine
Variants of Turing MachineRajendran
 
Code optimization in compiler design
Code optimization in compiler designCode optimization in compiler design
Code optimization in compiler designKuppusamy P
 
3.1,2,3 pushdown automata definition, moves & id
3.1,2,3 pushdown automata   definition, moves & id3.1,2,3 pushdown automata   definition, moves & id
3.1,2,3 pushdown automata definition, moves & idSampath Kumar S
 
Operator Precedence Grammar
Operator Precedence GrammarOperator Precedence Grammar
Operator Precedence GrammarHarisonFekadu
 
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)Mohammad Ilyas Malik
 

What's hot (20)

Type checking in compiler design
Type checking in compiler designType checking in compiler design
Type checking in compiler design
 
Variants of Turing Machine
Variants of Turing MachineVariants of Turing Machine
Variants of Turing Machine
 
Stop-and-Wait ARQ Protocol
Stop-and-Wait ARQ ProtocolStop-and-Wait ARQ Protocol
Stop-and-Wait ARQ Protocol
 
heap Sort Algorithm
heap  Sort Algorithmheap  Sort Algorithm
heap Sort Algorithm
 
Lecture 8
Lecture 8Lecture 8
Lecture 8
 
NFA or Non deterministic finite automata
NFA or Non deterministic finite automataNFA or Non deterministic finite automata
NFA or Non deterministic finite automata
 
Automata theory - Push Down Automata (PDA)
Automata theory - Push Down Automata (PDA)Automata theory - Push Down Automata (PDA)
Automata theory - Push Down Automata (PDA)
 
Recognition-of-tokens
Recognition-of-tokensRecognition-of-tokens
Recognition-of-tokens
 
Pumping lemma for regular set h1
Pumping lemma for regular set h1Pumping lemma for regular set h1
Pumping lemma for regular set h1
 
String operation
String operationString operation
String operation
 
Introduction TO Finite Automata
Introduction TO Finite AutomataIntroduction TO Finite Automata
Introduction TO Finite Automata
 
Turing machine by_deep
Turing machine by_deepTuring machine by_deep
Turing machine by_deep
 
Variants of Turing Machine
Variants of Turing MachineVariants of Turing Machine
Variants of Turing Machine
 
Code optimization in compiler design
Code optimization in compiler designCode optimization in compiler design
Code optimization in compiler design
 
3.1,2,3 pushdown automata definition, moves & id
3.1,2,3 pushdown automata   definition, moves & id3.1,2,3 pushdown automata   definition, moves & id
3.1,2,3 pushdown automata definition, moves & id
 
Operator Precedence Grammar
Operator Precedence GrammarOperator Precedence Grammar
Operator Precedence Grammar
 
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
 
Finite Automata
Finite AutomataFinite Automata
Finite Automata
 
Lesson 12
Lesson 12Lesson 12
Lesson 12
 
Computer graphics realism
Computer graphics realismComputer graphics realism
Computer graphics realism
 

Similar to 10 Regular VS Non Regular Language.pptx

09.LearningMaterial_Sample.pdf
09.LearningMaterial_Sample.pdf09.LearningMaterial_Sample.pdf
09.LearningMaterial_Sample.pdfssuser47f7f2
 
Theory of automata and formal language
Theory of automata and formal languageTheory of automata and formal language
Theory of automata and formal languageRabia Khalid
 
9781284077247_PPTx_CH01.pptx
9781284077247_PPTx_CH01.pptx9781284077247_PPTx_CH01.pptx
9781284077247_PPTx_CH01.pptxmainakmail2585
 
Introduction to Automata Theory
Introduction to Automata TheoryIntroduction to Automata Theory
Introduction to Automata TheoryKapil Saini
 
Introduction to automaton ppt
Introduction to automaton pptIntroduction to automaton ppt
Introduction to automaton pptShiela Rani
 
Theory of Computation Regular Expressions, Minimisation & Pumping Lemma
Theory of Computation Regular Expressions, Minimisation & Pumping LemmaTheory of Computation Regular Expressions, Minimisation & Pumping Lemma
Theory of Computation Regular Expressions, Minimisation & Pumping LemmaRushabh2428
 
Syntax Analyzer.pdf
Syntax Analyzer.pdfSyntax Analyzer.pdf
Syntax Analyzer.pdfkenilpatel65
 
Theory of Computation Basic Concepts and Grammar
Theory of Computation Basic Concepts and GrammarTheory of Computation Basic Concepts and Grammar
Theory of Computation Basic Concepts and GrammarRushabh2428
 
Theory of computing
Theory of computingTheory of computing
Theory of computingRanjan Kumar
 
Theory of Automata ___ Basis ...........
Theory of Automata ___ Basis ...........Theory of Automata ___ Basis ...........
Theory of Automata ___ Basis ...........NaumanAli215439
 
Pumping Lemma and Regular language or not?
Pumping Lemma and Regular language or not?Pumping Lemma and Regular language or not?
Pumping Lemma and Regular language or not?Animesh Chaturvedi
 
Context free langauges
Context free langaugesContext free langauges
Context free langaugessudhir sharma
 

Similar to 10 Regular VS Non Regular Language.pptx (20)

NLP_KASHK:Regular Expressions
NLP_KASHK:Regular Expressions NLP_KASHK:Regular Expressions
NLP_KASHK:Regular Expressions
 
09.LearningMaterial_Sample.pdf
09.LearningMaterial_Sample.pdf09.LearningMaterial_Sample.pdf
09.LearningMaterial_Sample.pdf
 
Theory of automata and formal language
Theory of automata and formal languageTheory of automata and formal language
Theory of automata and formal language
 
9781284077247_PPTx_CH01.pptx
9781284077247_PPTx_CH01.pptx9781284077247_PPTx_CH01.pptx
9781284077247_PPTx_CH01.pptx
 
Introduction to Automata Theory
Introduction to Automata TheoryIntroduction to Automata Theory
Introduction to Automata Theory
 
Introduction to automaton ppt
Introduction to automaton pptIntroduction to automaton ppt
Introduction to automaton ppt
 
Theory of Computation Regular Expressions, Minimisation & Pumping Lemma
Theory of Computation Regular Expressions, Minimisation & Pumping LemmaTheory of Computation Regular Expressions, Minimisation & Pumping Lemma
Theory of Computation Regular Expressions, Minimisation & Pumping Lemma
 
Unit2 Toc.pptx
Unit2 Toc.pptxUnit2 Toc.pptx
Unit2 Toc.pptx
 
L_2_apl.pptx
L_2_apl.pptxL_2_apl.pptx
L_2_apl.pptx
 
pumpexamples.pptx
pumpexamples.pptxpumpexamples.pptx
pumpexamples.pptx
 
Syntax Analyzer.pdf
Syntax Analyzer.pdfSyntax Analyzer.pdf
Syntax Analyzer.pdf
 
Lex analysis
Lex analysisLex analysis
Lex analysis
 
Lexical analysis
Lexical analysisLexical analysis
Lexical analysis
 
Theory of Computation Basic Concepts and Grammar
Theory of Computation Basic Concepts and GrammarTheory of Computation Basic Concepts and Grammar
Theory of Computation Basic Concepts and Grammar
 
Theory of computing
Theory of computingTheory of computing
Theory of computing
 
Theory of Automata ___ Basis ...........
Theory of Automata ___ Basis ...........Theory of Automata ___ Basis ...........
Theory of Automata ___ Basis ...........
 
Lexical 2
Lexical 2Lexical 2
Lexical 2
 
To lec 03
To lec 03To lec 03
To lec 03
 
Pumping Lemma and Regular language or not?
Pumping Lemma and Regular language or not?Pumping Lemma and Regular language or not?
Pumping Lemma and Regular language or not?
 
Context free langauges
Context free langaugesContext free langauges
Context free langauges
 

Recently uploaded

Why Won't Your Subaru Key Come Out Of The Ignition Find Out Here!
Why Won't Your Subaru Key Come Out Of The Ignition Find Out Here!Why Won't Your Subaru Key Come Out Of The Ignition Find Out Here!
Why Won't Your Subaru Key Come Out Of The Ignition Find Out Here!AutoScandia
 
Vip Mumbai Call Girls Mumbai Call On 9920725232 With Body to body massage wit...
Vip Mumbai Call Girls Mumbai Call On 9920725232 With Body to body massage wit...Vip Mumbai Call Girls Mumbai Call On 9920725232 With Body to body massage wit...
Vip Mumbai Call Girls Mumbai Call On 9920725232 With Body to body massage wit...amitlee9823
 
Dubai Call Girls Size E6 (O525547819) Call Girls In Dubai
Dubai Call Girls  Size E6 (O525547819) Call Girls In DubaiDubai Call Girls  Size E6 (O525547819) Call Girls In Dubai
Dubai Call Girls Size E6 (O525547819) Call Girls In Dubaikojalkojal131
 
Vip Hot🥵 Call Girls Delhi Delhi {9711199012} Avni Thakur 🧡😘 High Profile Girls
Vip Hot🥵 Call Girls Delhi Delhi {9711199012} Avni Thakur 🧡😘 High Profile GirlsVip Hot🥵 Call Girls Delhi Delhi {9711199012} Avni Thakur 🧡😘 High Profile Girls
Vip Hot🥵 Call Girls Delhi Delhi {9711199012} Avni Thakur 🧡😘 High Profile Girlsshivangimorya083
 
John Deere 7430 7530 Tractors Diagnostic Service Manual W.pdf
John Deere 7430 7530 Tractors Diagnostic Service Manual W.pdfJohn Deere 7430 7530 Tractors Diagnostic Service Manual W.pdf
John Deere 7430 7530 Tractors Diagnostic Service Manual W.pdfExcavator
 
Greenery-Palette Pitch Deck by Slidesgo.pptx
Greenery-Palette Pitch Deck by Slidesgo.pptxGreenery-Palette Pitch Deck by Slidesgo.pptx
Greenery-Palette Pitch Deck by Slidesgo.pptxzohiiimughal286
 
John Deere Tractors 6130M 6140M Diagnostic Manual
John Deere Tractors  6130M 6140M Diagnostic ManualJohn Deere Tractors  6130M 6140M Diagnostic Manual
John Deere Tractors 6130M 6140M Diagnostic ManualExcavator
 
Delhi Call Girls East Of Kailash 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls East Of Kailash 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls East Of Kailash 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls East Of Kailash 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
FULL ENJOY - 9953040155 Call Girls in Sector 61 | Noida
FULL ENJOY - 9953040155 Call Girls in Sector 61 | NoidaFULL ENJOY - 9953040155 Call Girls in Sector 61 | Noida
FULL ENJOY - 9953040155 Call Girls in Sector 61 | NoidaMalviyaNagarCallGirl
 
How To Troubleshoot Mercedes Blind Spot Assist Inoperative Error
How To Troubleshoot Mercedes Blind Spot Assist Inoperative ErrorHow To Troubleshoot Mercedes Blind Spot Assist Inoperative Error
How To Troubleshoot Mercedes Blind Spot Assist Inoperative ErrorAndres Auto Service
 
Lucknow 💋 (Genuine) Escort Service Lucknow | Service-oriented sexy call girls...
Lucknow 💋 (Genuine) Escort Service Lucknow | Service-oriented sexy call girls...Lucknow 💋 (Genuine) Escort Service Lucknow | Service-oriented sexy call girls...
Lucknow 💋 (Genuine) Escort Service Lucknow | Service-oriented sexy call girls...anilsa9823
 
Hauz Khas Call Girls ☎ 7042364481 independent Escorts Service in delhi
Hauz Khas Call Girls ☎ 7042364481 independent Escorts Service in delhiHauz Khas Call Girls ☎ 7042364481 independent Escorts Service in delhi
Hauz Khas Call Girls ☎ 7042364481 independent Escorts Service in delhiHot Call Girls In Sector 58 (Noida)
 
John deere 425 445 455 Maitenance Manual
John deere 425 445 455 Maitenance ManualJohn deere 425 445 455 Maitenance Manual
John deere 425 445 455 Maitenance ManualExcavator
 
How To Fix Mercedes Benz Anti-Theft Protection Activation Issue
How To Fix Mercedes Benz Anti-Theft Protection Activation IssueHow To Fix Mercedes Benz Anti-Theft Protection Activation Issue
How To Fix Mercedes Benz Anti-Theft Protection Activation IssueTerry Sayther Automotive
 
83778-77756 ( HER.SELF ) Brings Call Girls In Laxmi Nagar
83778-77756 ( HER.SELF ) Brings Call Girls In Laxmi Nagar83778-77756 ( HER.SELF ) Brings Call Girls In Laxmi Nagar
83778-77756 ( HER.SELF ) Brings Call Girls In Laxmi Nagardollysharma2066
 
꧁༒☬ 7042364481 (Call Girl) In Dwarka Delhi Escort Service In Delhi Ncr☬༒꧂
꧁༒☬ 7042364481 (Call Girl) In Dwarka Delhi Escort Service In Delhi Ncr☬༒꧂꧁༒☬ 7042364481 (Call Girl) In Dwarka Delhi Escort Service In Delhi Ncr☬༒꧂
꧁༒☬ 7042364481 (Call Girl) In Dwarka Delhi Escort Service In Delhi Ncr☬༒꧂Hot Call Girls In Sector 58 (Noida)
 
꧁ ୨⎯Call Girls In Ashok Vihar, New Delhi **✿❀7042364481❀✿**Escorts ServiCes C...
꧁ ୨⎯Call Girls In Ashok Vihar, New Delhi **✿❀7042364481❀✿**Escorts ServiCes C...꧁ ୨⎯Call Girls In Ashok Vihar, New Delhi **✿❀7042364481❀✿**Escorts ServiCes C...
꧁ ୨⎯Call Girls In Ashok Vihar, New Delhi **✿❀7042364481❀✿**Escorts ServiCes C...Hot Call Girls In Sector 58 (Noida)
 
Russian Call Girls Delhi Indirapuram {9711199171} Aarvi Gupta ✌️Independent ...
Russian  Call Girls Delhi Indirapuram {9711199171} Aarvi Gupta ✌️Independent ...Russian  Call Girls Delhi Indirapuram {9711199171} Aarvi Gupta ✌️Independent ...
Russian Call Girls Delhi Indirapuram {9711199171} Aarvi Gupta ✌️Independent ...shivangimorya083
 
Delhi Call Girls Saket 9711199171 ☎✔👌✔ Full night Service for more than 1 person
Delhi Call Girls Saket 9711199171 ☎✔👌✔ Full night Service for more than 1 personDelhi Call Girls Saket 9711199171 ☎✔👌✔ Full night Service for more than 1 person
Delhi Call Girls Saket 9711199171 ☎✔👌✔ Full night Service for more than 1 personshivangimorya083
 
定制多伦多大学毕业证(UofT毕业证)成绩单(学位证)原版一比一
定制多伦多大学毕业证(UofT毕业证)成绩单(学位证)原版一比一定制多伦多大学毕业证(UofT毕业证)成绩单(学位证)原版一比一
定制多伦多大学毕业证(UofT毕业证)成绩单(学位证)原版一比一meq5nzfnk
 

Recently uploaded (20)

Why Won't Your Subaru Key Come Out Of The Ignition Find Out Here!
Why Won't Your Subaru Key Come Out Of The Ignition Find Out Here!Why Won't Your Subaru Key Come Out Of The Ignition Find Out Here!
Why Won't Your Subaru Key Come Out Of The Ignition Find Out Here!
 
Vip Mumbai Call Girls Mumbai Call On 9920725232 With Body to body massage wit...
Vip Mumbai Call Girls Mumbai Call On 9920725232 With Body to body massage wit...Vip Mumbai Call Girls Mumbai Call On 9920725232 With Body to body massage wit...
Vip Mumbai Call Girls Mumbai Call On 9920725232 With Body to body massage wit...
 
Dubai Call Girls Size E6 (O525547819) Call Girls In Dubai
Dubai Call Girls  Size E6 (O525547819) Call Girls In DubaiDubai Call Girls  Size E6 (O525547819) Call Girls In Dubai
Dubai Call Girls Size E6 (O525547819) Call Girls In Dubai
 
Vip Hot🥵 Call Girls Delhi Delhi {9711199012} Avni Thakur 🧡😘 High Profile Girls
Vip Hot🥵 Call Girls Delhi Delhi {9711199012} Avni Thakur 🧡😘 High Profile GirlsVip Hot🥵 Call Girls Delhi Delhi {9711199012} Avni Thakur 🧡😘 High Profile Girls
Vip Hot🥵 Call Girls Delhi Delhi {9711199012} Avni Thakur 🧡😘 High Profile Girls
 
John Deere 7430 7530 Tractors Diagnostic Service Manual W.pdf
John Deere 7430 7530 Tractors Diagnostic Service Manual W.pdfJohn Deere 7430 7530 Tractors Diagnostic Service Manual W.pdf
John Deere 7430 7530 Tractors Diagnostic Service Manual W.pdf
 
Greenery-Palette Pitch Deck by Slidesgo.pptx
Greenery-Palette Pitch Deck by Slidesgo.pptxGreenery-Palette Pitch Deck by Slidesgo.pptx
Greenery-Palette Pitch Deck by Slidesgo.pptx
 
John Deere Tractors 6130M 6140M Diagnostic Manual
John Deere Tractors  6130M 6140M Diagnostic ManualJohn Deere Tractors  6130M 6140M Diagnostic Manual
John Deere Tractors 6130M 6140M Diagnostic Manual
 
Delhi Call Girls East Of Kailash 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls East Of Kailash 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls East Of Kailash 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls East Of Kailash 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
FULL ENJOY - 9953040155 Call Girls in Sector 61 | Noida
FULL ENJOY - 9953040155 Call Girls in Sector 61 | NoidaFULL ENJOY - 9953040155 Call Girls in Sector 61 | Noida
FULL ENJOY - 9953040155 Call Girls in Sector 61 | Noida
 
How To Troubleshoot Mercedes Blind Spot Assist Inoperative Error
How To Troubleshoot Mercedes Blind Spot Assist Inoperative ErrorHow To Troubleshoot Mercedes Blind Spot Assist Inoperative Error
How To Troubleshoot Mercedes Blind Spot Assist Inoperative Error
 
Lucknow 💋 (Genuine) Escort Service Lucknow | Service-oriented sexy call girls...
Lucknow 💋 (Genuine) Escort Service Lucknow | Service-oriented sexy call girls...Lucknow 💋 (Genuine) Escort Service Lucknow | Service-oriented sexy call girls...
Lucknow 💋 (Genuine) Escort Service Lucknow | Service-oriented sexy call girls...
 
Hauz Khas Call Girls ☎ 7042364481 independent Escorts Service in delhi
Hauz Khas Call Girls ☎ 7042364481 independent Escorts Service in delhiHauz Khas Call Girls ☎ 7042364481 independent Escorts Service in delhi
Hauz Khas Call Girls ☎ 7042364481 independent Escorts Service in delhi
 
John deere 425 445 455 Maitenance Manual
John deere 425 445 455 Maitenance ManualJohn deere 425 445 455 Maitenance Manual
John deere 425 445 455 Maitenance Manual
 
How To Fix Mercedes Benz Anti-Theft Protection Activation Issue
How To Fix Mercedes Benz Anti-Theft Protection Activation IssueHow To Fix Mercedes Benz Anti-Theft Protection Activation Issue
How To Fix Mercedes Benz Anti-Theft Protection Activation Issue
 
83778-77756 ( HER.SELF ) Brings Call Girls In Laxmi Nagar
83778-77756 ( HER.SELF ) Brings Call Girls In Laxmi Nagar83778-77756 ( HER.SELF ) Brings Call Girls In Laxmi Nagar
83778-77756 ( HER.SELF ) Brings Call Girls In Laxmi Nagar
 
꧁༒☬ 7042364481 (Call Girl) In Dwarka Delhi Escort Service In Delhi Ncr☬༒꧂
꧁༒☬ 7042364481 (Call Girl) In Dwarka Delhi Escort Service In Delhi Ncr☬༒꧂꧁༒☬ 7042364481 (Call Girl) In Dwarka Delhi Escort Service In Delhi Ncr☬༒꧂
꧁༒☬ 7042364481 (Call Girl) In Dwarka Delhi Escort Service In Delhi Ncr☬༒꧂
 
꧁ ୨⎯Call Girls In Ashok Vihar, New Delhi **✿❀7042364481❀✿**Escorts ServiCes C...
꧁ ୨⎯Call Girls In Ashok Vihar, New Delhi **✿❀7042364481❀✿**Escorts ServiCes C...꧁ ୨⎯Call Girls In Ashok Vihar, New Delhi **✿❀7042364481❀✿**Escorts ServiCes C...
꧁ ୨⎯Call Girls In Ashok Vihar, New Delhi **✿❀7042364481❀✿**Escorts ServiCes C...
 
Russian Call Girls Delhi Indirapuram {9711199171} Aarvi Gupta ✌️Independent ...
Russian  Call Girls Delhi Indirapuram {9711199171} Aarvi Gupta ✌️Independent ...Russian  Call Girls Delhi Indirapuram {9711199171} Aarvi Gupta ✌️Independent ...
Russian Call Girls Delhi Indirapuram {9711199171} Aarvi Gupta ✌️Independent ...
 
Delhi Call Girls Saket 9711199171 ☎✔👌✔ Full night Service for more than 1 person
Delhi Call Girls Saket 9711199171 ☎✔👌✔ Full night Service for more than 1 personDelhi Call Girls Saket 9711199171 ☎✔👌✔ Full night Service for more than 1 person
Delhi Call Girls Saket 9711199171 ☎✔👌✔ Full night Service for more than 1 person
 
定制多伦多大学毕业证(UofT毕业证)成绩单(学位证)原版一比一
定制多伦多大学毕业证(UofT毕业证)成绩单(学位证)原版一比一定制多伦多大学毕业证(UofT毕业证)成绩单(学位证)原版一比一
定制多伦多大学毕业证(UofT毕业证)成绩单(学位证)原版一比一
 

10 Regular VS Non Regular Language.pptx

  • 1. Regular VS Non Regular Languages Lecture 14 Faryal Shamsi Lecturer Computer Science Sukkur IBA University
  • 2. Regular Languages • A language that can be defined with a Regular Expression • By Kleene’s Theorem we know that – • RE=TG=FA • Therefore, we can say that – • A regular language can be defined with a Regular Expression, a Transition Graph and a Finite Automata
  • 3. • The result stated in this theorem is often expressed by saying: • The set of regular languages is closed under – • union, concatenation, and the Kleene star operator.
  • 4.
  • 6. Proof by Machines (Concatenation)
  • 7. Proof by Machines (Closure)
  • 8. Working Example R1 = a(a + b)*a + b(a + b)*b R2 = (a + b)* aba (a + b)*
  • 9. Working Example R1 = a(a + b)*a + b(a + b)*b R2 = (a + b)* aba (a + b)*
  • 10. Proof by Machines (Union) a(a + b)*a + b(a + b)*b + (a + b)* aba (a + b)*
  • 11. Proof by Machines (Concatenation) a(a + b)*a + b(a + b)*b (a + b)* aba (a + b)*
  • 12. Proof by Machines (Closure) [ a(a + b)*a + b(a + b)*b ]*
  • 13. Regular Languages are Closed under: • Union • Concatenation • Closure • Complement • Intersection • Difference • Non regular languages may not have these properties
  • 19. Intersection FA1’ + FA2’ (FA1’ + FA2’)’
  • 20. Non Regular Languages • A language that can not be defined with a Regular Expression (neither with a finite automata or transition graph), is said to be non- regular language • For Example: If  = {a,b} then • PALINDROME = { , a, b, aa, bb, aba, bab, abba, baab, ababa, … } • EQUAL = { , ab, aabb, abab, bbaa, baba, aabbab …}
  • 21. Non Regular Languages • A language that can not be defined with a Regular Expression or Finite Automata or Transition Graph • For Example – When the range of the abstract exponent n is unspecified we mean to imply that it is 0,1,2,3 …
  • 22. Example: anbn • We shall now show that this language is nonregular. • Let us note: anbn  a*b* • Though, that it is a subset of many regular languages, such as a*b*, which, however, also includes such strings as aab and bb that {anbn} does not. • Let us be very careful to note that {a"b } is not a regular expression. • It involves the symbols { } and n that are not in the alphabet of regular expressions.
  • 25. Example 1 – Proving Regularity of Language
  • 26. Example • Will it accept xyyz? xyyy? xyyyz?
  • 27. Example 2 – Non-regularity of a Language • Let, • w=aaabbb x=aa , y=ab , z=bb w’= xyyz = aaababbb • w=aaabbb x=a , y=aa , z=bbb w’= xyyz = aaaaabbb
  • 28.
  • 29. • Is PRIME a regular language? Example 3
  • 30. Consider this case • PALINROME is a non regular language. • We cannot always use the first version of the Pumping Lemma to do this because the string W=aba, satisfy the lemma and do not contradict the language: w= xynz x=a y=b z=a • So, we have another way to express Pumping Lemma
  • 31.
  • 32. Proof: • Let us consider one of the FA's that might accept PALINDROME • Consider this FA has 77 states, and it accepts a80ba80 • Now the palindrome must be accepted by this machine and it has more letters than the machine has states. (We should’t break ‘aba’ or ‘aabaa’ and so on…) • This means that we can break w into the three parts, x, y, and z.
  • 33. Proof: • But since the length of x and y must be in total 77 or less, they must both be made of solid a's, since the first 77 letters of w are all a's. • That means when we form the word xyyz we are adding more a's on to the front of w. • But we are not adding more a's on to the back of w since all the rear a's are in the z part, which stays fixed at 80 a's. • But the second version of the Pumping Lemma said that PALINDROME has to include. this string. Therefore, the second version does not apply to the language PALINDROME, which means that PALINDROME is nonregular.
  • 34. Example 4 • Consider the language of Arithmetic Expressions – • Try and Construct an FA or RE to recognize it
  • 35. Defining a Non Regular Language • Let’s recall the concept of ‘Recursive Definition’. • Reference: Chapter. 3, Lecture 7 • We can define Asthmatic Expressions using Recursive Rules –