edited by
196 views
0 votes
0 votes

 

What is the safest order while simplifying Context Free Grammar?

  1. Elimination of $\varepsilon$-productions, Unit productions and then Useless symbols \& productions.
  2. Elimination of useless symbols \& productions, $\varepsilon$-productions and then Unit productions.
  3. Elimination of Unit productions, $\varepsilon$-productions and then Useless symbols and productions.
  4. Elimination of $\varepsilon$-productions, Useless symbols and productions and then Unit productions.

(Option $1[39629]) 1$
(Option $2[39630]) 2$
(Option $3[39631]) 3$
(Option $4 [39632]) 4$

Answer Given by Candidate: $2$

edited by

1 Answer

0 votes
0 votes

$(A)$ 

  1. Elimination of ε-productions (A): ε-productions can potentially introduce new unit productions into the grammar, so it’s usually better to eliminate these first.
  2. Elimination of unit productions (B): The removal of unit productions could potentially make a previously useful production into a useless one, so it’s better to handle unit productions before dealing with useless ones.
  3. Elimination of useless symbols & productions (C): This is typically done last, as the previous elimination steps could potentially create new useless symbols or productions that need to be eliminated.

Related questions

0 votes
0 votes
2 answers
1
admin asked May 20, 2023
1,302 views
The negation of "Some students like hockey" is:Some students dislike hockeyEvery student dislike hockeyEvery student like hockeyAll students like hockey(Option $1[39301])...
0 votes
0 votes
1 answer
4
admin asked May 20, 2023
508 views
Consider the following conditional code, which returns a Boolean valuesif $((x>25) \& \&(y>100))$return 'false';else iff $(x \leq 25) \& \& \&(y \leq 100))$return 'true';...