for i = 1..n
for <tex>[B A \rightarrow \alpha \cdot a_{j} \beta, i] \in I_{j-1}</tex> <tex>I_j</tex> ∪= <tex>[B A \rightarrow \alpha a_{j} \cdot \beta, i]</tex> # Правило (1)
useful_loop(j)
function useful_loop(j):
for <tex>[A \rightarrow \alpha \cdot , i] \in I_j</tex>
for <tex>[B \rightarrow \gamma beta \cdot A \betagamma, k] \in I_{i}</tex> <tex>I_j</tex> ∪= <tex>[B \rightarrow \gamma beta A \cdot \betagamma, k]</tex> # Правило (2)
for <tex>[A \rightarrow \alpha \cdot B \beta, i] \in I_j</tex>