next up previous
Next: -Productions: Up: Simplification of CFG Previous: Simplification of CFG

Useless Symbols

e.g. tex2html_wrap_inline398
tex2html_wrap_inline400
tex2html_wrap_inline402
B is useless because tex2html_wrap_inline406
D is useless because tex2html_wrap_inline410

Def. A symbol X is useful if
tex2html_wrap_inline414 \ for tex2html_wrap_inline416

Two aspects:
  1. tex2html_wrap_inline418 , (live)
  2. tex2html_wrap_inline420 (reachable)

Algorithm to remove those variable which can not produce strings of terminals tex2html_wrap_inline422
tex2html_wrap_inline424
tex2html_wrap_inline426
While tex2html_wrap_inline428 do

displaymath298

e.g. tex2html_wrap_inline429
tex2html_wrap_inline431 because tex2html_wrap_inline432
tex2html_wrap_inline434 is useless.

Algorithm to identify tex2html_wrap_inline420
tex2html_wrap_inline438
tex2html_wrap_inline440
Iteratively, if tex2html_wrap_inline442
and tex2html_wrap_inline444
then add all the variables of tex2html_wrap_inline446 to V'
and all the terminals of tex2html_wrap_inline450 to T'.
e.g.
tex2html_wrap_inline454
  1. tex2html_wrap_inline458
  2. tex2html_wrap_inline460 because tex2html_wrap_inline432
  3. tex2html_wrap_inline464 because tex2html_wrap_inline466
Thus, D is useless.

Simplified Grammar is:
tex2html_wrap_inline432
tex2html_wrap_inline476
tex2html_wrap_inline475

Must apply algorithm for tex2html_wrap_inline472 first.
e.g.
tex2html_wrap_inline474
tex2html_wrap_inline476
tex2html_wrap_inline483
tex2html_wrap_inline480 useless

tex2html_wrap_inline482

tex2html_wrap_inline420
tex2html_wrap_inline486
A useless
tex2html_wrap_inline495

Otherwise, applying these two algorithms in reverse:

tex2html_wrap_inline420
tex2html_wrap_inline494
no useless symbols found.

tex2html_wrap_inline483
tex2html_wrap_inline498 useless
tex2html_wrap_inline505 still remains.



Sushil Prasad
Tue Jul 14 11:59:47 EDT 1998