Simplification of Context free grammar

Simplification of Context free grammar - S plifications im...

Info iconThis preview shows pages 1–16. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Simplifications of Context-Free Grammars
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 A Substitution Rule b B aA B abBc A aaA A aB S Substitute Equivalent grammar aA B abbc abBc A aaA A ab aB S | | b B
Background image of page 2
3 A Substitution Rule Equivalent grammar abaAc abbc abBc A aaA A aaA ab aB S | | | | aA B abbc abBc A aaA A ab aB S | | Substitute aA B
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 In general: 1 y B xBz A Substitute z xy xBz A 1 | equivalent grammar 1 y B
Background image of page 4
5 Nullable Variables : production - λ A Nullable Variable: A
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 Removing Nullable Variables Example Grammar: λ M aMb M aMb S Nullable variable
Background image of page 6
7 λ M M aMb M aMb S Substitute ab M aMb M ab S aMb S Final Grammar
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8 Unit-Productions B A Unit Production: (a single variable in both sides)
Background image of page 8
9 Removing Unit Productions Observation: A A Is removed immediately
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
10 Example Grammar: bb B A B B A a A aA S
Background image of page 10
11 bb B A B B A a A aA S Substitute B A bb B B A B a A aB aA S | |
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
12 Remove bb B B A B a A aB aA S | | bb B A B a A aB aA S | B B
Background image of page 12
13 Substitute A B bb B a A aA aB aA S | | bb B A B a A aB aA S |
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
14 Remove repeated productions bb B a A aB aA S | bb B a A aA aB aA S | | Final grammar
Background image of page 14
Useless Productions aA A A S
Background image of page 15

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 16
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/25/2011 for the course CSI 301 taught by Professor Mr.elienasr during the Spring '10 term at American University of Science & Tech.

Page1 / 51

Simplification of Context free grammar - S plifications im...

This preview shows document pages 1 - 16. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online