1
votes

Given the context-free grammar G = ( {S, A, B, C} , {0, 1} , P , S), where the set of productions P is:

S → 0A0 | 1B1 | BB
A → C
B → S | A
C → S | λ

I am supposed to remove the useless symbols.

My questions is should I consider the empty string λ a terminal here while applying the algorithm where I create a new set V' containing symbols resulting in direct derivations then adding to V' symbols that produce a combination of terminals and variables in V'. Any guidance is appreciated, Thanks

1

1 Answers

0
votes

λ is not a terminal, and you should not make it one. It is, however, a (trivial) "combination of terminals and non-terminals".