Removal of Unit Productions
The removal of unit productions involves two steps:
Each step must be done in order. Below is a picture of the unit production removal window:
Step 1: Visualizing the unit productions
When you press the "Visualize Productions" button, the
visualization window is invoked. In order to visualize unit
productions, a dependency diagram must be created. Each arrow
represents a unit production from one variable to another
variable.
Step 2: Modifying the grammar to remove the unit
productions
Modifying the grammar involves removing and adding new
productions. In the left pane, the grammar that is being modified
is shown. In the right pane, the initial grammar is provided
for reference. Four operations can be performed when modifying
a grammar:
Removing unit productions involves removing the productions that are unit productions, then adding new productions that exclude the productions that are unit productions. For example, if a grammar contained the rules:
A->C
B->cAd
C->a
Then you would remove A->C and add A->a.
Step 3: Continuing
To continue on to the next transformation press the "Next
Transformation" button. If you want to parse the grammar to
see the derivation of an acceptance string then press the
"Parse" button.