Costas Busch - RPI1 Single Final State for NFAs
Costas Busch - RPI2 Any NFA can be converted to an equivalent NFA with a single final state
Costas Busch - RPI3 NFA Equivalent NFA Example
Costas Busch - RPI4 NFA In General Equivalent NFA Single final state
Costas Busch - RPI5 Extreme Case NFA without final state Add a final state Without transitions
Costas Busch - RPI6 Properties of Regular Languages
Costas Busch - RPI7 Concatenation: Star: Union: Are regular Languages For regular languages and we will prove that: Complement: Intersection: Reversal:
Costas Busch - RPI8 We say: Regular languages are closed under Concatenation: Star: Union: Complement: Intersection: Reversal:
Costas Busch - RPI9 Regular language Single final state NFA Single final state Regular language NFA
Costas Busch - RPI10 Example
Costas Busch - RPI11 Union NFA for
Costas Busch - RPI12 Example NFA for
Costas Busch - RPI13 Concatenation NFA for
Costas Busch - RPI14 Example NFA for
Costas Busch - RPI15 Star Operation NFA for
Costas Busch - RPI16 Example NFA for
Costas Busch - RPI17 Reverse NFA for 1. Reverse all transitions 2. Make initial state final state and vice versa
Costas Busch - RPI18 Example
Costas Busch - RPI19 Complement 1. Take the DFA that accepts 2. Make final states non-final, and vice-versa
Costas Busch - RPI20 Example
Costas Busch - RPI21 Intersection DeMorgan’s Law: regular
Costas Busch - RPI22 Example regular
Costas Busch - RPI23 Regular Expressions
Costas Busch - RPI24 Regular Expressions Regular expressions describe regular languages Example: describes the language
Costas Busch - RPI25 Recursive Definition Are regular expressions Primitive regular expressions: Given regular expressions and
Costas Busch - RPI26 Examples A regular expression: Not a regular expression:
Costas Busch - RPI27 Languages of Regular Expressions : language of regular expression Example
Costas Busch - RPI28 Definition For primitive regular expressions:
Costas Busch - RPI29 Definition (continued) For regular expressions and
Costas Busch - RPI30 Example Regular expression:
Costas Busch - RPI31 Example Regular expression
Costas Busch - RPI32 Example Regular expression
Costas Busch - RPI33 Example Regular expression = { all strings with at least two consecutive 0 }
Costas Busch - RPI34 Example Regular expression = { all strings without two consecutive 0 }
Costas Busch - RPI35 Equivalent Regular Expressions Definition: Regular expressions and are equivalent if
Costas Busch - RPI36 Example = { all strings without two consecutive 0 } and are equivalent regular expr.
Costas Busch - RPI37 Regular Expressions and Regular Languages
Costas Busch - RPI38 Theorem Languages Generated by Regular Expressions Regular Languages
Costas Busch - RPI39 Theorem - Part 1 1. For any regular expression the language is regular Languages Generated by Regular Expressions Regular Languages
Costas Busch - RPI40 Theorem - Part 2 Languages Generated by Regular Expressions Regular Languages 2. For any regular language there is a regular expression with
Costas Busch - RPI41 Proof - Part 1 1. For any regular expression the language is regular Proof by induction on the size of
Costas Busch - RPI42 Induction Basis Primitive Regular Expressions: NFAs regular languages
Costas Busch - RPI43 Inductive Hypothesis Assume for regular expressions and that and are regular languages
Costas Busch - RPI44 Inductive Step We will prove: Are regular Languages
Costas Busch - RPI45 By definition of regular expressions:
Costas Busch - RPI46 By inductive hypothesis we know: and are regular languages Regular languages are closed under: Union Concatenation Star We also know:
Costas Busch - RPI47 Therefore: Are regular languages
Costas Busch - RPI48 And trivially: is a regular language
Costas Busch - RPI49 Proof – Part 2 2. For any regular language there is a regular expression with Proof by construction of regular expression
Costas Busch - RPI50 Since is regular take the NFA that accepts it Single final state
Costas Busch - RPI51 From construct the equivalent Generalized Transition Graph in which transition labels are regular expressions Example:
Costas Busch - RPI52 Another Example:
Costas Busch - RPI53 Reducing the states:
Costas Busch - RPI54 Resulting Regular Expression:
Costas Busch - RPI55 In General Removing states:
Costas Busch - RPI56 The final transition graph: The resulting regular expression: