Next:
Unit Productions
Up:
Simplification of CFG
Previous:
Useless Symbols
-Productions:
Nullable Variables:
Algorithm to determine Nullable Variables
Iteratively
if
, and all symbols in
,
then
e.g.
because
because
Removal of
-Productions
If
, then add all productions
where
if
is not nullable, then
if
nullable, then
is either
or
.
not all
are
.
e.g. P:
Since
must be present.
P' :
- If
L
(
G
) does not contain
, then
G
can be converted to equivalent
G
' without any
-produtions.
Sushil Prasad
Tue Jul 14 11:59:47 EDT 1998