+ All Categories
Home > Documents > Presentation - Theory of Computation

Presentation - Theory of Computation

Date post: 18-Jan-2016
Category:
Upload: eduardo-tavara
View: 37 times
Download: 0 times
Share this document with a friend
Description:
Computer Theory
Popular Tags:
22
6.2 TWO IMPORTANT NORMAL FORMS CHOMSKY NORMAL FORM GREIBACH NORMAL FORM Edith Castro March 27, 2014
Transcript
Page 1: Presentation - Theory of Computation

6.2 TWO IMPORTANT NORMAL FORMS

     CHOMSKY NORMAL FORM      GREIBACH NORMAL FORM

Edith Castro

March 27, 2014

Page 2: Presentation - Theory of Computation

Chomsky Normal Form

A context-free grammar is in Chomsky normal form if all productions are of the form:

A BC or A a

Where: A, B, C are variables and a is a terminal symbol.

Example 1:

Given the grammar: P: S AS | a,

A SA | b

The productions are of the Chomsky normal form.

2

Page 3: Presentation - Theory of Computation

Chomsky Normal FormExample 2:

Given another grammar:

P: S AS | AAS,

A SA | aa

The productions S AAS and A aa do not follow the conditions of the Chomsky normal form. The grammar is not in the Chomsky normal form.

3

Page 4: Presentation - Theory of Computation

Chomsky Normal Form

4

Page 5: Presentation - Theory of Computation

Chomsky Normal Form

5

Page 6: Presentation - Theory of Computation

Chomsky Normal Form

6

Page 7: Presentation - Theory of Computation

Chomsky Normal Form

7

Page 8: Presentation - Theory of Computation

Chomsky Normal Form

Example: Given the grammar with the productions:

S ABa, A aab,B Ac

Convert to Chomsky normal form.

Solution: We can apply the theorem 6.6. So the grammar does not have any - productions and no unit-productions.

8

Page 9: Presentation - Theory of Computation

Chomsky Normal Form

9

Page 10: Presentation - Theory of Computation

Chomsky Normal FormStep 1: We introduce additional variables to get the first two productions into normal form and we get the final result:

10

Page 11: Presentation - Theory of Computation

11

Page 12: Presentation - Theory of Computation

12

Page 13: Presentation - Theory of Computation

13

Page 14: Presentation - Theory of Computation

14

Page 15: Presentation - Theory of Computation

15

Page 16: Presentation - Theory of Computation

16

Page 17: Presentation - Theory of Computation

17

Page 18: Presentation - Theory of Computation

18

Page 19: Presentation - Theory of Computation

19

Page 20: Presentation - Theory of Computation

20

Page 21: Presentation - Theory of Computation

21

Page 22: Presentation - Theory of Computation

22


Recommended