Context_Free_Grammars_Normal

Context_Free_Grammars_Normal - Simplifications of...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: Simplifications of Context-Free Grammars 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 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 In general: 1 y B xBz A Substitute z xy xBz A 1 | equivalent grammar 1 y B Nullable Variables : production- X Nullable Variable: Y Example: M aMb M aMb S Nullable variable production- M M aMb M aMb S Substitute ab aMb M ab aMb S | | Removing s production- After we remove all the all the nullable variables disappear (except for the start variable) s production- Unit-Productions Y X Unit Production: (a single variable in both sides) bb B A B B A a A aA S Example: Unit Productions bb B A B B A a A aA S Substitute B A bb B B A B a A aB aA S | | Removal of unit productions: Remove bb B B A B a A aB aA S | | bb B A B a A aB aA S | B B X X can be removed immediately Unit productions of form Substitute A B bb B a A aA aB aA S | | bb B A B a A aB aA S | Remove repeated productions bb B a A aB aA S | bb B a A aA aB aA S | | Final grammar Useless Productions...
View Full Document

Page1 / 38

Context_Free_Grammars_Normal - Simplifications of...

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

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