Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 NFAs accept the Regular Languages. 2 Equivalence of Machines Definition: Machine is equivalent to machine if.

Similar presentations


Presentation on theme: "1 NFAs accept the Regular Languages. 2 Equivalence of Machines Definition: Machine is equivalent to machine if."— Presentation transcript:

1 1 NFAs accept the Regular Languages

2 2 Equivalence of Machines Definition: Machine is equivalent to machine if

3 3 Example of equivalent machines NFA FA

4 4 We will prove: Languages accepted by NFAs Regular Languages NFAs and FAs have the same computation power Languages accepted by FAs

5 5 Languages accepted by NFAs Regular Languages accepted by NFAs Regular Languages We will show:

6 6 Languages accepted by NFAs Regular Languages Proof-Step 1 Proof: Every FA is trivially an NFA Any language accepted by a FA is also accepted by an NFA

7 7 Languages accepted by NFAs Regular Languages Proof-Step 2 Proof: Any NFA can be converted to an equivalent FA Any language accepted by an NFA is also accepted by a FA

8 8 Convert NFA to FA NFA FA

9 9 Convert NFA to FA NFA FA

10 10 Convert NFA to FA NFA FA

11 11 Convert NFA to FA NFA FA

12 12 Convert NFA to FA NFA FA

13 13 Convert NFA to FA NFA FA

14 14 Convert NFA to FA NFA FA

15 15 NFA to FA: Remarks We are given an NFA We want to convert it to an equivalent FA With

16 16 If the NFA has states the FA has states in the powerset

17 17 Procedure NFA to FA 1. Initial state of NFA: Initial state of FA:

18 18 Example NFA FA

19 19 Procedure NFA to FA 2. For every FA’s state Compute in the NFA Add transition to FA

20 20 Exampe NFA FA

21 21 Procedure NFA to FA Repeat Step 2 for all letters in alphabet, until no more transitions can be added.

22 22 Example NFA FA

23 23 Procedure NFA to FA 3. For any FA state If is accepting state in NFA Then, is accepting state in FA

24 24 Example NFA FA

25 25 Theorem Take NFA Apply procedure to obtain FA Then and are equivalent :

26 26 Proof AND

27 27 First we show: Take arbitrary: We will prove:

28 28

29 29 denotes

30 30 We will show that if then

31 31 More generally, we will show that if in : (arbitrary string) then

32 32 Proof by induction on Induction Basis: Is true by construction of

33 33 Induction hypothesis:

34 34 Induction Step:

35 35 Induction Step:

36 36 Therefore if then

37 37 We have shown: We also need to show: (proof is similar)

38 38 Single Accepting State for NFAs

39 39 Any NFA can be converted to an equivalent NFA with a single accepting state

40 40 NFA Equivalent NFA Example

41 41 NFA In General Equivalent NFA Single accepting state

42 42 Extreme Case NFA without accepting state Add an accepting state without transitions

43 43 Properties of Regular Languages

44 44 Concatenation: Star: Union: Are regular Languages For regular languages and we will prove that: Complement: Intersection: Reversal:

45 45 We say: Regular languages are closed under Concatenation: Star: Union: Complement: Intersection: Reversal:

46 46 Regular language Single accepting state NFA Single aceepting state Regular language NFA

47 47 Example

48 48 Union NFA for

49 49 Example NFA for

50 50 Concatenation NFA for

51 51 Example NFA for

52 52 Star Operation NFA for

53 53 Example NFA for

54 54 Reverse NFA for 1. Reverse all transitions 2. Make initial state accepting state and vice versa

55 55 Example

56 56 Complement 1. Take the FA that accepts 2. Make final states non-final, and vice-versa

57 57 Example

58 58 Intersection regular We show regular

59 59 DeMorgan’s Law: regular

60 60 Example regular

61 61 for FA Construct a new FA that accepts Machine simulates in parallel and Another Proof for Intersection Closure

62 62 States in State in

63 63 transition FA transition FA

64 64 initial state Initial state FA

65 65 accept state accept states FA Both constituents must be accepting states

66 66 Example:

67 67 Automaton for intersection

68 68 simulates in parallel and accepts stringif and only if accepts string and accepts string


Download ppt "1 NFAs accept the Regular Languages. 2 Equivalence of Machines Definition: Machine is equivalent to machine if."

Similar presentations


Ads by Google