Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Chomsky normal form
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===DEL: Eliminate Ξ΅-rules=== An Ξ΅-rule is a rule of the form :''A'' β Ξ΅, where ''A'' is not ''S''<sub>0</sub>, the grammar's start symbol. To eliminate all rules of this form, first determine the set of all nonterminals that derive Ξ΅. Hopcroft and Ullman (1979) call such nonterminals ''nullable'', and compute them as follows: * If a rule ''A'' β Ξ΅ exists, then ''A'' is nullable. * If a rule ''A'' β ''X''<sub>1</sub> ... ''X''<sub>''n''</sub> exists, and every single ''X''<sub>''i''</sub> is nullable, then ''A'' is nullable, too. Obtain an intermediate grammar by replacing each rule :''A'' β ''X''<sub>1</sub> ... ''X''<sub>''n''</sub> by all versions with some nullable ''X''<sub>''i''</sub> omitted. By deleting in this grammar each Ξ΅-rule, unless its left-hand side is the start symbol, the transformed grammar is obtained.<ref name="Hopcroft.Ullman.1979"/>{{rp|90}} For example, in the following grammar, with start symbol ''S''<sub>0</sub>, : ''S''<sub>0</sub> β ''AbB'' | ''C'' : ''B'' β ''AA'' | ''AC'' : ''C'' β ''b'' | ''c'' : ''A'' β ''a'' | Ξ΅ the nonterminal ''A'', and hence also ''B'', is nullable, while neither ''C'' nor ''S''<sub>0</sub> is. Hence the following intermediate grammar is obtained:<ref group=note>indicating a kept and omitted nonterminal ''N'' by ''{{color|#006000|N}}'' and ''{{color|#ffc0c0|<s>N</s>}}'', respectively</ref> : ''S''<sub>0</sub> β ''{{color|#006000|A}}b{{color|#006000|B}}'' | ''{{color|#006000|A}}b{{color|#ffc0c0|<s>B</s>}}'' | ''{{color|#ffc0c0|<s>A</s>}}b{{color|#006000|B}}'' | ''{{color|#ffc0c0|<s>A</s>}}b{{color|#ffc0c0|<s>B</s>}}'' | ''C'' : ''B'' β ''{{color|#006000|AA}}'' | ''{{color|#ffc0c0|<s>A</s>}}{{color|#006000|A}}'' | ''{{color|#006000|A}}{{color|#ffc0c0|<s>A</s>}}'' | ''{{color|#ffc0c0|<s>A</s>}}Ξ΅{{color|#ffc0c0|<s>A</s>}}'' | ''{{color|#006000|A}}C'' | ''{{color|#ffc0c0|<s>A</s>}}C'' : ''C'' β ''b'' | ''c'' : ''A'' β ''a'' | Ξ΅ In this grammar, all Ξ΅-rules have been "[[inlining|inlined]] at the call site".<ref group=note>If the grammar had a rule ''S''<sub>0</sub> β Ξ΅, it could not be "inlined", since it had no "call sites". Therefore it could not be deleted in the next step.</ref> In the next step, they can hence be deleted, yielding the grammar: : ''S''<sub>0</sub> β ''AbB'' | ''Ab'' | ''bB'' | ''b'' | ''C'' : ''B'' β ''AA'' | ''A'' | ''AC'' | ''C'' : ''C'' β ''b'' | ''c'' : ''A'' β ''a'' This grammar produces the same language as the original example grammar, viz. {''ab'',''aba'',''abaa'',''abab'',''abac'',''abb'',''abc'',''b'',''ba'',''baa'',''bab'',''bac'',''bb'',''bc'',''c''}, but has no Ξ΅-rules.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Chomsky normal form
(section)
Add topic