CS-5800 Theory of Computation II PROJECT PRESENTATION By Quincy Campbell & Sandeep Ravikanti.
Presentation - Theory of Computation
-
Upload
eduardo-tavara -
Category
Documents
-
view
36 -
download
0
description
Transcript of Presentation - Theory of Computation
![Page 1: Presentation - Theory of Computation](https://reader033.fdocuments.in/reader033/viewer/2022061602/55cf92ea550346f57b9a6cb5/html5/thumbnails/1.jpg)
6.2 TWO IMPORTANT NORMAL FORMS
CHOMSKY NORMAL FORM GREIBACH NORMAL FORM
Edith Castro
March 27, 2014
![Page 2: Presentation - Theory of Computation](https://reader033.fdocuments.in/reader033/viewer/2022061602/55cf92ea550346f57b9a6cb5/html5/thumbnails/2.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022061602/55cf92ea550346f57b9a6cb5/html5/thumbnails/3.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022061602/55cf92ea550346f57b9a6cb5/html5/thumbnails/4.jpg)
Chomsky Normal Form
4
![Page 5: Presentation - Theory of Computation](https://reader033.fdocuments.in/reader033/viewer/2022061602/55cf92ea550346f57b9a6cb5/html5/thumbnails/5.jpg)
Chomsky Normal Form
5
![Page 6: Presentation - Theory of Computation](https://reader033.fdocuments.in/reader033/viewer/2022061602/55cf92ea550346f57b9a6cb5/html5/thumbnails/6.jpg)
Chomsky Normal Form
6
![Page 7: Presentation - Theory of Computation](https://reader033.fdocuments.in/reader033/viewer/2022061602/55cf92ea550346f57b9a6cb5/html5/thumbnails/7.jpg)
Chomsky Normal Form
7
![Page 8: Presentation - Theory of Computation](https://reader033.fdocuments.in/reader033/viewer/2022061602/55cf92ea550346f57b9a6cb5/html5/thumbnails/8.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022061602/55cf92ea550346f57b9a6cb5/html5/thumbnails/9.jpg)
Chomsky Normal Form
9
![Page 10: Presentation - Theory of Computation](https://reader033.fdocuments.in/reader033/viewer/2022061602/55cf92ea550346f57b9a6cb5/html5/thumbnails/10.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022061602/55cf92ea550346f57b9a6cb5/html5/thumbnails/11.jpg)
11
![Page 12: Presentation - Theory of Computation](https://reader033.fdocuments.in/reader033/viewer/2022061602/55cf92ea550346f57b9a6cb5/html5/thumbnails/12.jpg)
12
![Page 13: Presentation - Theory of Computation](https://reader033.fdocuments.in/reader033/viewer/2022061602/55cf92ea550346f57b9a6cb5/html5/thumbnails/13.jpg)
13
![Page 14: Presentation - Theory of Computation](https://reader033.fdocuments.in/reader033/viewer/2022061602/55cf92ea550346f57b9a6cb5/html5/thumbnails/14.jpg)
14
![Page 15: Presentation - Theory of Computation](https://reader033.fdocuments.in/reader033/viewer/2022061602/55cf92ea550346f57b9a6cb5/html5/thumbnails/15.jpg)
15
![Page 16: Presentation - Theory of Computation](https://reader033.fdocuments.in/reader033/viewer/2022061602/55cf92ea550346f57b9a6cb5/html5/thumbnails/16.jpg)
16
![Page 17: Presentation - Theory of Computation](https://reader033.fdocuments.in/reader033/viewer/2022061602/55cf92ea550346f57b9a6cb5/html5/thumbnails/17.jpg)
17
![Page 18: Presentation - Theory of Computation](https://reader033.fdocuments.in/reader033/viewer/2022061602/55cf92ea550346f57b9a6cb5/html5/thumbnails/18.jpg)
18
![Page 19: Presentation - Theory of Computation](https://reader033.fdocuments.in/reader033/viewer/2022061602/55cf92ea550346f57b9a6cb5/html5/thumbnails/19.jpg)
19
![Page 20: Presentation - Theory of Computation](https://reader033.fdocuments.in/reader033/viewer/2022061602/55cf92ea550346f57b9a6cb5/html5/thumbnails/20.jpg)
20
![Page 21: Presentation - Theory of Computation](https://reader033.fdocuments.in/reader033/viewer/2022061602/55cf92ea550346f57b9a6cb5/html5/thumbnails/21.jpg)
21
![Page 22: Presentation - Theory of Computation](https://reader033.fdocuments.in/reader033/viewer/2022061602/55cf92ea550346f57b9a6cb5/html5/thumbnails/22.jpg)
22