Modification of the completion step follows a similar pattern.
First, the unit-production relation has to be extended to allow for
unit-production chains due to null productions.
A rule
can effectively
act as a unit production that links X and
if all other nonterminals
on the RHS can expand to
.
Its contribution to the unit production relation
will
then be
From the resulting revised
matrix we compute the closure
as usual.
The second modification is another instance of spontaneous dot shifting.
When completing a state
and moving the dot
to get
, additional states have
to be added, obtained by moving the dot further over any nonterminals in
that have non-zero
-expansion probability.
As in prediction,
forward and inner probabilities are multiplied by the corresponding
-expansion probabilities.