Download presentation
Presentation is loading. Please wait.
1
1 A Single Final State for Finite Accepters
2
2 Observation Any Finite Accepter (NFA or DFA) can be converted to an equivalent NFA with a single final state
3
3 Example NFA Equivalent NFA
4
4 In General NFA Equivalent NFA Single final state
5
5 Extreme Case NFA without final state Add a final state
6
6 Properties of Regular Languages
7
7 Properties Take any regular languages and We will prove: Union: Concatenation: Star: Are regular Languages Complement: Intersection:
8
8 We Say closed Regular Languages are closed: –Under union: –Under concatenation: –Under the star operation: –Under complement: –Under intersection:
9
9 For regular languages and take NFAs and with Single final state
10
10 Example
11
11 Union NFA for
12
12 Example NFA for
13
13 Concatenation NFA for
14
14 Example NFA for
15
15 Star Operation NFA for
16
16 Example NFA for
17
17 Complement For the complement of regular language : Take the DFA that accepts Construct such that: –Each final state of is nonfinal in nonfinal final We have:
18
18 Example
19
19 Intersection For regular languages and : regular
20
20 Example Regular languages: The languageis regular
21
21 Regular Expressions
22
22 Regular Expressions Regular expressions are another way of expressing regular languages Example: Stands for the language
23
23 Recursive Definition Regular Expressions: Primitive regular expressions: Given regular expressions and Are regular expressions
24
24 Examples A regular expression Not a regular expression
25
25 Languages of Regular Expressions : language of regular expression Example
26
26 Definition For primitive regular expressions:
27
27 Definition (continued) For regular expressions and
28
28 Example Regular expression:
29
29 Example Regular expression
30
30 Example Regular expression
31
31 Example Regular expression = { all strings with at least two consecutive 0 }
32
32 Example Regular expression = { all strings without two consecutive 0 }
33
33 Equivalent Regular Expressions Definition: Regular expressions and are equivalent if
34
34 Example = { all strings with at least two consecutive 0 } and are equivalent regular expr.
35
35 Regular Expressions and Regular Languages
36
36 Theorem The class of languages described by Regular expressions is identical to the Regular languages
37
37 In Other Words For any regular expression the language is regular For any regular language there is a regular expression with
38
38 Proof First we prove: For any regular expression the language is regular
39
39 Induction Basis Primitive Regular Expressions: NFAs regular languages
40
40 Inductive Hypothesis Assume for regular expressions and that and are regular languages
41
41 Inductive Step We will prove that: Are regular Languages
42
42 By definition of regular expressions:
43
43 By inductive hypothesis and are regular languages We know: Regular languages are closed under union concatenation star operation
44
44 Therefore: Are regular languages
45
45 And trivially: is a regular language
46
46 Proof - Second Part Now we want to prove: For any regular language there is a regular expression with
47
47 Since is regular take the NFA that accepts it Single final state
48
48 From Construct the equivalent Generalized Transition Graph labels of transitions are regular expressions Example:
49
49 Another Example:
50
50 Reducing the states:
51
51 Resulting Regular Expression:
52
52 In General Removing states:
53
53 Obtaining the final regular expression:
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.