Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Single Final State for NFAs and DFAs. 2 Observation Any Finite Automaton (NFA or DFA) can be converted to an equivalent NFA with a single final state.

Similar presentations


Presentation on theme: "1 Single Final State for NFAs and DFAs. 2 Observation Any Finite Automaton (NFA or DFA) can be converted to an equivalent NFA with a single final state."— Presentation transcript:

1 1 Single Final State for NFAs and DFAs

2 2 Observation Any Finite Automaton (NFA or DFA) can be converted to an equivalent NFA with a single final state

3 3 NFA Equivalent NFA Example

4 4 NFA In General Equivalent NFA Single final state

5 5 Extreme Case NFA without final state Add a final state Without transitions

6 6 Some Properties of Regular Languages

7 7 Properties Concatenation:Star: Union: Are regular Languages For regular languages and we will prove that:

8 8 We Say: Regular languages are closed under Concatenation:Star: Union:

9 9 Regular language Single final state NFA Single final state Regular language NFA

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 Regular Expressions

18 18 Regular Expressions Regular expressions describe regular languages Example: describes the language

19 19 Recursive Definition Are regular expressions Primitive regular expressions: Given regular expressions and

20 20 Examples A regular expression: Not a regular expression:

21 21 Languages of Regular Expressions : language of regular expression Example

22 22 Definition For primitive regular expressions:

23 23 Definition (continued) For regular expressions and

24 24 Example Regular expression:

25 25 Example Regular expression

26 26 Example Regular expression

27 27 Example Regular expression = { all strings with at least two consecutive 0 }

28 28 Example Regular expression = { all strings without two consecutive 0 }

29 29 Equivalent Regular Expressions Definition: Regular expressions and are equivalent if

30 30 Example = { all strings with at least two consecutive 0 } and are equivalent regular expr.

31 31 Regular Expressions and Regular Languages

32 32 Theorem Languages Generated by Regular Expressions Regular Languages

33 33 Theorem - Part 1 1. For any regular expression the language is regular Languages Generated by Regular Expressions Regular Languages

34 34 Theorem - Part 2 Languages Generated by Regular Expressions Regular Languages 2. For any regular language there is a regular expression with

35 35 Proof - Part 1 1. For any regular expression the language is regular Proof by induction on the size of

36 36 Induction Basis Primitive Regular Expressions: NFAs regular languages

37 37 Inductive Hypothesis Assume for regular expressions and that and are regular languages

38 38 Inductive Step We will prove: Are regular Languages

39 39 By definition of regular expressions:

40 40 By inductive hypothesis we know: and are regular languages Regular languages are closed under union concatenation star We also know:

41 41 Therefore: Are regular languages

42 42 And trivially: is a regular language

43 43 Proof – Part 2 2. For any regular language there is a regular expression with Proof by construction of regular expression

44 44 Since is regular take the NFA that accepts it Single final state

45 45 From construct the equivalent Generalized Transition Graph transition labels are regular expressions Example:

46 46 Another Example:

47 47 Reducing the states:

48 48 Resulting Regular Expression:

49 49 In General Removing states:

50 50 Obtaining the final regular expression:


Download ppt "1 Single Final State for NFAs and DFAs. 2 Observation Any Finite Automaton (NFA or DFA) can be converted to an equivalent NFA with a single final state."

Similar presentations


Ads by Google