Chomsky normal form: Difference between revisions
Jump to navigation
Jump to search
imported>TheUbMunster m Corrected grammar language viz. summary |
imported>Jochen Burghardt →DEL: Eliminate ε-rules: suggest to underline kept nonterminals in addition (e.g. for colorblind people and greyscale printouts); not sure anymore that coloring was a good idea at all, when it needs that much advanced programming |
||
| Line 68: | Line 68: | ||
: ''A'' → ''a'' | ε | : ''A'' → ''a'' | ε | ||
the nonterminal ''A'', and hence also ''B'', is nullable, while neither ''C'' nor ''S''<sub>0</sub> is. | 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|# | Hence the following intermediate grammar is obtained:<ref group=note>indicating a kept and omitted nonterminal ''N'' by ''{{color|var(--color-content-added, #006400)|<u>N</u>}}'' and ''{{color|var(--color-content-removed, #8B0000)|<s>N</s>}}'', respectively</ref> | ||
: ''S''<sub>0</sub> → ''{{color|# | : ''S''<sub>0</sub> → ''{{color|var(--color-content-added, #006400)|<u>A</u>}}b{{color|var(--color-content-added, #006400)|<u>B</u>}}'' | ''{{color|var(--color-content-added, #006400)|<u>A</u>}}b{{color|var(--color-content-removed, #8B0000)|<s>B</s>}}'' | ''{{color|var(--color-content-removed, #8B0000)|<s>A</s>}}b{{color|var(--color-content-added, #006400)|<u>B</u>}}'' | ''{{color|var(--color-content-removed, #8B0000)|<s>A</s>}}b{{color|var(--color-content-removed, #8B0000)|<s>B</s>}}'' | ''C'' | ||
: ''B'' → ''{{color|# | : ''B'' → ''{{color|var(--color-content-added, #006400)|<u>AA</u>}}'' | ''{{color|var(--color-content-removed, #8B0000)|<s>A</s>}}{{color|var(--color-content-added, #006400)|<u>A</u>}}'' | ''{{color|var(--color-content-added, #006400)|<u>A</u>}}{{color|var(--color-content-removed, #8B0000)|<s>A</s>}}'' | ''{{color|var(--color-content-removed, #8B0000)|<s>A</s>}}ε{{color|var(--color-content-removed, #8B0000)|<s>A</s>}}'' | ''{{color|var(--color-content-added, #006400)|<u>A</u>}}C'' | ''{{color|var(--color-content-removed, #8B0000)|<s>A</s>}}C'' | ||
: ''C'' → ''b'' | ''c'' | : ''C'' → ''b'' | ''c'' | ||
: ''A'' → ''a'' | ε | : ''A'' → ''a'' | ε | ||