# costas busch - rpi1 single final state for nfas. costas busch - rpi2 any nfa can be converted to an...

Post on 19-Dec-2015

212 views

Category:

## Documents

Tags:

• #### language slide

Embed Size (px)

TRANSCRIPT

• Slide 1
• Costas Busch - RPI1 Single Final State for NFAs
• Slide 2
• Costas Busch - RPI2 Any NFA can be converted to an equivalent NFA with a single final state
• Slide 3
• Costas Busch - RPI3 NFA Equivalent NFA Example
• Slide 4
• Costas Busch - RPI4 NFA In General Equivalent NFA Single final state
• Slide 5
• Costas Busch - RPI5 Extreme Case NFA without final state Add a final state Without transitions
• Slide 6
• Costas Busch - RPI6 Properties of Regular Languages
• Slide 7
• Costas Busch - RPI7 Concatenation: Star: Union: Are regular Languages For regular languages and we will prove that: Complement: Intersection: Reversal:
• Slide 8
• Costas Busch - RPI8 We say: Regular languages are closed under Concatenation: Star: Union: Complement: Intersection: Reversal:
• Slide 9
• Costas Busch - RPI9 Regular language Single final state NFA Single final state Regular language NFA
• Slide 10
• Costas Busch - RPI10 Example
• Slide 11
• Costas Busch - RPI11 Union NFA for
• Slide 12
• Costas Busch - RPI12 Example NFA for
• Slide 13
• Costas Busch - RPI13 Concatenation NFA for
• Slide 14
• Costas Busch - RPI14 Example NFA for
• Slide 15
• Costas Busch - RPI15 Star Operation NFA for
• Slide 16
• Costas Busch - RPI16 Example NFA for
• Slide 17
• Costas Busch - RPI17 Reverse NFA for 1. Reverse all transitions 2. Make initial state final state and vice versa
• Slide 18
• Costas Busch - RPI18 Example
• Slide 19
• Costas Busch - RPI19 Complement 1. Take the DFA that accepts 2. Make final states non-final, and vice-versa
• Slide 20
• Costas Busch - RPI20 Example
• Slide 21
• Costas Busch - RPI21 Intersection DeMorgans Law: regular
• Slide 22
• Costas Busch - RPI22 Example regular
• Slide 23
• Costas Busch - RPI23 Regular Expressions
• Slide 24
• Costas Busch - RPI24 Regular Expressions Regular expressions describe regular languages Example: describes the language
• Slide 25
• Costas Busch - RPI25 Recursive Definition Are regular expressions Primitive regular expressions: Given regular expressions and
• Slide 26
• Costas Busch - RPI26 Examples A regular expression: Not a regular expression:
• Slide 27
• Costas Busch - RPI27 Languages of Regular Expressions : language of regular expression Example
• Slide 28
• Costas Busch - RPI28 Definition For primitive regular expressions:
• Slide 29
• Costas Busch - RPI29 Definition (continued) For regular expressions and
• Slide 30
• Costas Busch - RPI30 Example Regular expression:
• Slide 31
• Costas Busch - RPI31 Example Regular expression
• Slide 32
• Costas Busch - RPI32 Example Regular expression
• Slide 33
• Costas Busch - RPI33 Example Regular expression = { all strings with at least two consecutive 0 }
• Slide 34
• Costas Busch - RPI34 Example Regular expression = { all strings without two consecutive 0 }
• Slide 35
• Costas Busch - RPI35 Equivalent Regular Expressions Definition: Regular expressions and are equivalent if
• Slide 36
• Costas Busch - RPI36 Example = { all strings without two consecutive 0 } and are equivalent regular expr.
• Slide 37
• Costas Busch - RPI37 Regular Expressions and Regular Languages
• Slide 38
• Costas Busch - RPI38 Theorem Languages Generated by Regular Expressions Regular Languages
• Slide 39
• Costas Busch - RPI39 Theorem - Part 1 1. For any regular expression the language is regular Languages Generated by Regular Expressions Regular Languages
• Slide 40
• Costas Busch - RPI40 Theorem - Part 2 Languages Generated by Regular Expressions Regular Languages 2. For any regular language there is a regular expression with
• Slide 41
• Costas Busch - RPI41 Proof - Part 1 1. For any regular expression the language is regular Proof by induction on the size of
• Slide 42
• Costas Busch - RPI42 Induction Basis Primitive Regular Expressions: NFAs regular languages
• Slide 43
• Costas Busch - RPI43 Inductive Hypothesis Assume for regular expressions and that and are regular languages
• Slide 44
• Costas Busch - RPI44 Inductive Step We will prove: Are regular Languages
• Slide 45
• Costas Busch - RPI45 By definition of regular expressions:
• Slide 46
• Costas Busch - RPI46 By inductive hypothesis we know: and are regular languages Regular languages are closed under: Union Concatenation Star We also know:
• Slide 47
• Costas Busch - RPI47 Therefore: Are regular languages
• Slide 48
• Costas Busch - RPI48 And trivially: is a regular language
• Slide 49
• Costas Busch - RPI49 Proof Part 2 2. For any regular language there is a regular expression with Proof by construction of regular expression
• Slide 50
• Costas Busch - RPI50 Since is regular take the NFA that accepts it Single final state
• Slide 51
• Costas Busch - RPI51 From construct the equivalent Generalized Transition Graph in which transition labels are regular expressions Example:
• Slide 52
• Costas Busch - RPI52 Another Example:
• Slide 53
• Costas Busch - RPI53 Reducing the states:
• Slide 54
• Costas Busch - RPI54 Resulting Regular Expression:
• Slide 55
• Costas Busch - RPI55 In General Removing states:
• Slide 56
• Costas Busch - RPI56 The final transition graph: The resulting regular expression:

Recommended