Single Final State for NFA Fall 2004 COMP
- Slides: 56
Single Final State for NFA Fall 2004 COMP 335 1
Any NFA can be converted to an equivalent NFA with a single final state Fall 2004 COMP 335 2
Example NFA Equivalent NFA Fall 2004 COMP 335 3
NFA In General Equivalent NFA Single final state Fall 2004 COMP 335 4
Extreme Case NFA without final state Add a final state Without transitions Fall 2004 COMP 335 5
Properties of Regular Languages Fall 2004 COMP 335 6
For regular languages we will prove that: and Union: Concatenation: Are regular Languages Star: Reversal: Complement: Intersection: Fall 2004 COMP 335 7
We say: Regular languages are closed under Union: Concatenation: Star: Reversal: Complement: Intersection: Fall 2004 COMP 335 8
Regular language NFA Single final state Fall 2004 Single final state COMP 335 9
Example Fall 2004 COMP 335 10
Union NFA for Fall 2004 COMP 335 11
Example NFA for Fall 2004 COMP 335 12
Concatenation NFA for Fall 2004 COMP 335 13
Example NFA for Fall 2004 COMP 335 14
Star Operation NFA for Fall 2004 COMP 335 15
Example NFA for Fall 2004 COMP 335 16
Reverse NFA for 1. Reverse all transitions Fall 2004 2. Make initial state final state and vice versa COMP 335 17
Example Fall 2004 COMP 335 18
Complement 1. Take the DFA that accepts 2. Make final states non-final, and vice-versa Fall 2004 COMP 335 19
Example Fall 2004 COMP 335 20
Intersection De. Morgan’s Law: regular regular Fall 2004 COMP 335 21
Example regular Fall 2004 COMP 335 regular 22
Regular Expressions Fall 2004 COMP 335 23
Regular Expressions Regular expressions describe regular languages Example: describes the language Fall 2004 COMP 335 24
Recursive Definition Primitive regular expressions: Given regular expressions and Are regular expressions Fall 2004 COMP 335 25
Examples A regular expression: Not a regular expression: Fall 2004 COMP 335 26
Languages of Regular Expressions : language of regular expression Example: Fall 2004 COMP 335 27
Definition For primitive regular expressions : Fall 2004 COMP 335 28
Definition (continued) For regular expressions Fall 2004 COMP 335 and 29
Example Regular expression: Fall 2004 COMP 335 30
Example Regular expression Fall 2004 COMP 335 31
Example Regular expression Fall 2004 COMP 335 32
Example Regular expression = {all strings with at least two consecutive 0} Fall 2004 COMP 335 33
Example Regular expression = { all strings without two consecutive 0 } Fall 2004 COMP 335 34
Equivalent Regular Expressions Definition: Regular expressions and are equivalent if Fall 2004 COMP 335 35
Example = { all strings without two consecutive 0 } and are equivalent Reg. expressions Fall 2004 COMP 335 36
Regular Expressions and Regular Languages Fall 2004 COMP 335 37
Theorem Languages Generated by Regular Expressions Fall 2004 COMP 335 Regular Languages 38
Theorem - Part 1 Languages Generated by Regular Expressions 1. For any regular expression the language Fall 2004 Regular Languages is regular COMP 335 39
Theorem - Part 2 Languages Generated by Regular Expressions 2. For any regular language a regular expression Fall 2004 COMP 335 Regular Languages , there is with 40
Proof - Part 1 1. For any regular expression the language is regular Proof by induction on the size of Fall 2004 COMP 335 41
Induction Basis Primitive Regular Expressions: NFAs regular languages Fall 2004 COMP 335 42
Inductive Hypothesis Assume for regular expressions and that and are regular languages Fall 2004 COMP 335 43
Inductive Step We will prove: are regular Languages. Fall 2004 COMP 335 44
By definition of regular expressions: Fall 2004 COMP 335 45
By inductive hypothesis we know: and are regular languages We also know: Regular languages are closed under: Union Concatenation Star Fall 2004 COMP 335 46
Therefore: Are regular languages Fall 2004 COMP 335 47
And trivially: is a regular language Fall 2004 COMP 335 48
Proof – Part 2 2. For any regular language a regular expression there is with Proof by construction of regular expression Fall 2004 COMP 335 49
Since NFA is regular, take an that accepts it Single final state Fall 2004 COMP 335 50
From , construct an equivalent Generalized Transition Graph in which transition labels are regular expressions Example: Fall 2004 COMP 335 51
Another Example: Fall 2004 COMP 335 52
Reducing the states: Fall 2004 COMP 335 53
Resulting Regular Expression: Fall 2004 COMP 335 54
In General Removing states: Fall 2004 COMP 335 55
The final transition graph: The resulting regular expression: Fall 2004 COMP 335 56
- Comp 345
- Physics fall final exam review
- Us history semester 1 final exam study guide answers
- Von neumann architecture is sisd
- Single instruction single data
- Multi channel multi phase example
- Progress south carolina
- Jsa stands for
- Laplace transform
- Final value theorem
- Kontinuitetshantering
- Typiska novell drag
- Tack för att ni lyssnade bild
- Returpilarna
- Varför kallas perioden 1918-1939 för mellankrigstiden?
- En lathund för arbete med kontinuitetshantering
- Underlag för särskild löneskatt på pensionskostnader
- Tidbok yrkesförare
- A gastrica
- Densitet vatten
- Datorkunskap för nybörjare
- Stig kerman
- Debatt artikel mall
- Delegerande ledarstil
- Nyckelkompetenser för livslångt lärande
- Påbyggnader för flakfordon
- Arkimedes princip formel
- Svenskt ramverk för digital samverkan
- I gullregnens månad
- Presentera för publik crossboss
- Jiddisch
- Kanaans land
- Treserva lathund
- Luftstrupen för medicinare
- Claes martinsson
- Cks
- Programskede byggprocessen
- Mat för idrottare
- Verktyg för automatisering av utbetalningar
- Rutin för avvikelsehantering
- Smärtskolan kunskap för livet
- Ministerstyre för och nackdelar
- Tack för att ni har lyssnat
- Referatmarkeringar
- Redogör för vad psykologi är
- Stål för stötfångarsystem
- Atmosfr
- Borra hål för knoppar
- Vilken grundregel finns det för tronföljden i sverige?
- Variansen formel
- Tack för att ni har lyssnat
- Steg för steg rita
- Informationskartläggning
- Tobinskatten för och nackdelar
- Blomman för dagen drog
- Mästar lärling modellen
- Egg för emanuel