147 views

Consider the following context-free grammar:

Find the number of unique productions in {Goto (A → D.BC, B) U Goto (A → .DBC, D)}

In the union, we’ll get A → DB.C and A → D.BC. Will they be considered as different productions? The answer key has taken them as two different productions. I think that they shouldn’t be considered different because the root production in both cases is the same i.e., A → DBC.

Will they be considered as different productions?

Yes.

### Subscribe to GO Classes for GATE CSE 2022

Goto (A → D.BC, B) = {A → DB.C , C→ .c , C→ eps}

Goto (A → .DBC, D) = {A → D.BC , B→ .Bb, B→ eps}

Goto (A → D.BC, B) U Goto (A → .DBC, D) =  {A → DB.C , C→ .c , C→ eps} U {A → D.BC , B→ .Bb, B→ eps}

There is no duplicate production , so answer is 6.

X→ eps. = X→ .eps = X→ .   because all are having same meaning.