![Page 1: These material has been reproduced and presented to you by KM Khan Afridi for IDEA only. Do not forget me in DUA Warning: The information herein is for](https://reader036.vdocuments.us/reader036/viewer/2022070413/5697bfa61a28abf838c9857c/html5/thumbnails/1.jpg)
These material has been reproduced and presented to you by KM Khan Afridi for
IDEA only. Do not forget me in DUA
Warning:The information herein is for idea purposes only and I cannot guarantee the accuracy of any information provided in this presentation..I makes no warranties, express, implied or statutory, as to the information in this presentation.This Presentation is protected by copyright laws and VU Plagiarism Policy. Unauthorized reproduction or distribution of this Presentation, or any portion of it, may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under law.
![Page 2: These material has been reproduced and presented to you by KM Khan Afridi for IDEA only. Do not forget me in DUA Warning: The information herein is for](https://reader036.vdocuments.us/reader036/viewer/2022070413/5697bfa61a28abf838c9857c/html5/thumbnails/2.jpg)
Converting Finite Automata into Regular Expressions
CS402
![Page 3: These material has been reproduced and presented to you by KM Khan Afridi for IDEA only. Do not forget me in DUA Warning: The information herein is for](https://reader036.vdocuments.us/reader036/viewer/2022070413/5697bfa61a28abf838c9857c/html5/thumbnails/3.jpg)
Kleene’s Theorem
Regular Expression
Finite Automaton
NFA-LGTG
TG NFA
![Page 4: These material has been reproduced and presented to you by KM Khan Afridi for IDEA only. Do not forget me in DUA Warning: The information herein is for](https://reader036.vdocuments.us/reader036/viewer/2022070413/5697bfa61a28abf838c9857c/html5/thumbnails/4.jpg)
First Three Proofs
• Every Finite Automaton is a NFA• Every NFA is a Transition Graph.• Every Transition Graph is a Generalised
Transition Graph.
![Page 5: These material has been reproduced and presented to you by KM Khan Afridi for IDEA only. Do not forget me in DUA Warning: The information herein is for](https://reader036.vdocuments.us/reader036/viewer/2022070413/5697bfa61a28abf838c9857c/html5/thumbnails/5.jpg)
How to convert aGeneralised Transition Graph
into aRegular Expression
![Page 6: These material has been reproduced and presented to you by KM Khan Afridi for IDEA only. Do not forget me in DUA Warning: The information herein is for](https://reader036.vdocuments.us/reader036/viewer/2022070413/5697bfa61a28abf838c9857c/html5/thumbnails/6.jpg)
Make a uniqueStart State
with no inputtransitions
Are there any Final States
?
Make a uniqueFinal State with nooutput transitions
Eliminatemultiple loops
Eliminatemultiple edges
Is the number of states
> 2?
Eliminate astate which is
NOTthe Start state
or theFinal state
Is the GTGconnected?
Write f
Write thelabel
NO
NO
NO
YES
YESYES
![Page 7: These material has been reproduced and presented to you by KM Khan Afridi for IDEA only. Do not forget me in DUA Warning: The information herein is for](https://reader036.vdocuments.us/reader036/viewer/2022070413/5697bfa61a28abf838c9857c/html5/thumbnails/7.jpg)
Make a unique Start State
-
-
...
...
...
![Page 8: These material has been reproduced and presented to you by KM Khan Afridi for IDEA only. Do not forget me in DUA Warning: The information herein is for](https://reader036.vdocuments.us/reader036/viewer/2022070413/5697bfa61a28abf838c9857c/html5/thumbnails/8.jpg)
Make a unique Start State
-
-
...
...
...
-
L
L
![Page 9: These material has been reproduced and presented to you by KM Khan Afridi for IDEA only. Do not forget me in DUA Warning: The information herein is for](https://reader036.vdocuments.us/reader036/viewer/2022070413/5697bfa61a28abf838c9857c/html5/thumbnails/9.jpg)
Make a unique Start State
...
...
...
-
L
L
![Page 10: These material has been reproduced and presented to you by KM Khan Afridi for IDEA only. Do not forget me in DUA Warning: The information herein is for](https://reader036.vdocuments.us/reader036/viewer/2022070413/5697bfa61a28abf838c9857c/html5/thumbnails/10.jpg)
Make a unique Final State
+
+
...
...
...
![Page 11: These material has been reproduced and presented to you by KM Khan Afridi for IDEA only. Do not forget me in DUA Warning: The information herein is for](https://reader036.vdocuments.us/reader036/viewer/2022070413/5697bfa61a28abf838c9857c/html5/thumbnails/11.jpg)
Make a unique Final State
+
+
...
...
...
+
L
L
![Page 12: These material has been reproduced and presented to you by KM Khan Afridi for IDEA only. Do not forget me in DUA Warning: The information herein is for](https://reader036.vdocuments.us/reader036/viewer/2022070413/5697bfa61a28abf838c9857c/html5/thumbnails/12.jpg)
Make a unique Final State
...
...
...
+
L
L
![Page 13: These material has been reproduced and presented to you by KM Khan Afridi for IDEA only. Do not forget me in DUA Warning: The information herein is for](https://reader036.vdocuments.us/reader036/viewer/2022070413/5697bfa61a28abf838c9857c/html5/thumbnails/13.jpg)
Eliminate multiple loops
... ...
R1
R2
R3
... ...
R1 + R2 + R3
![Page 14: These material has been reproduced and presented to you by KM Khan Afridi for IDEA only. Do not forget me in DUA Warning: The information herein is for](https://reader036.vdocuments.us/reader036/viewer/2022070413/5697bfa61a28abf838c9857c/html5/thumbnails/14.jpg)
Eliminate multiple edges
... ...
R1
R2
R3
R1 + R2 + R3... ...
![Page 15: These material has been reproduced and presented to you by KM Khan Afridi for IDEA only. Do not forget me in DUA Warning: The information herein is for](https://reader036.vdocuments.us/reader036/viewer/2022070413/5697bfa61a28abf838c9857c/html5/thumbnails/15.jpg)
State Elimination
Cases Incoming edgesfrom a different state
Outgoing edgesto a different state
Loops
1 1 1 NO2 1 1 YES3 1 More than 1 NO/YES4 More than 1 More than 1 NO/YES5 0 0, 1, or more NO/YES
6 0, 1, or more 0 NO/YES
![Page 16: These material has been reproduced and presented to you by KM Khan Afridi for IDEA only. Do not forget me in DUA Warning: The information herein is for](https://reader036.vdocuments.us/reader036/viewer/2022070413/5697bfa61a28abf838c9857c/html5/thumbnails/16.jpg)
... ...R1 R21 2
... ...R1 R2
1 2
![Page 17: These material has been reproduced and presented to you by KM Khan Afridi for IDEA only. Do not forget me in DUA Warning: The information herein is for](https://reader036.vdocuments.us/reader036/viewer/2022070413/5697bfa61a28abf838c9857c/html5/thumbnails/17.jpg)
... ...R1 (S)* R2
1 2
... ...R1 R21 2
S
![Page 18: These material has been reproduced and presented to you by KM Khan Afridi for IDEA only. Do not forget me in DUA Warning: The information herein is for](https://reader036.vdocuments.us/reader036/viewer/2022070413/5697bfa61a28abf838c9857c/html5/thumbnails/18.jpg)
... ...R1
R2
1 3
S 2
4
...
...
R3
R4
... ...R1 (S )* R3
1 3
4
2 ...
...
R1 (S )* R2
R1 (S )* R4
![Page 19: These material has been reproduced and presented to you by KM Khan Afridi for IDEA only. Do not forget me in DUA Warning: The information herein is for](https://reader036.vdocuments.us/reader036/viewer/2022070413/5697bfa61a28abf838c9857c/html5/thumbnails/19.jpg)
... ...
R1
R2
1 3
S 2 ...
R3
R4
... ...R1 (S )* R3
1 3
2 ...R1 (S )* R2
R1 (S )* R4
![Page 20: These material has been reproduced and presented to you by KM Khan Afridi for IDEA only. Do not forget me in DUA Warning: The information herein is for](https://reader036.vdocuments.us/reader036/viewer/2022070413/5697bfa61a28abf838c9857c/html5/thumbnails/20.jpg)
...
...
R1R2
1
3
S 2
4
...
...
R3
R4... 5 R5
...
...R1 (S )* R3
1
3
4
2 ...
...R1 (S )* R4... 5
R1 (S )* R2
R5 (S )* R2
R5 (S )* R4
R5 (S )* R3
![Page 21: These material has been reproduced and presented to you by KM Khan Afridi for IDEA only. Do not forget me in DUA Warning: The information herein is for](https://reader036.vdocuments.us/reader036/viewer/2022070413/5697bfa61a28abf838c9857c/html5/thumbnails/21.jpg)
...
...
R1R2
1
3
S 2
4
...
...
R3
R4... 5 R5
...
...
1
3
2
4
...
...... 5
![Page 22: These material has been reproduced and presented to you by KM Khan Afridi for IDEA only. Do not forget me in DUA Warning: The information herein is for](https://reader036.vdocuments.us/reader036/viewer/2022070413/5697bfa61a28abf838c9857c/html5/thumbnails/22.jpg)
...
...
R1R2
1
3
S 2
4
...
...
R3
R4... 5 R5
...
...
1
3
2
4
...
...... 5
![Page 23: These material has been reproduced and presented to you by KM Khan Afridi for IDEA only. Do not forget me in DUA Warning: The information herein is for](https://reader036.vdocuments.us/reader036/viewer/2022070413/5697bfa61a28abf838c9857c/html5/thumbnails/23.jpg)
Revision• Know Kleene’s Theorem• Be able to convert FAs into Regular
Expressions
Preparation
• Read– Lectures 11 and 12, Practice on Example