edited by
251 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

1.5k
views
2 answers
1 votes
admin asked May 20, 2023
1,462 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]) 1$(Option ... $4[39304]) 4$Answer Given by Candidate : $2$
612
views
1 answers
0 votes
admin asked May 20, 2023
612 views
A relation '$R$ ' is defined on ordered pairs of integers as: $(x, y) R(u, v)$ if $x<u$ and $y>v$. Then $R$ isNeither a partial order nor an equivalence ... $3 [39307]) 3$(Option $4 [39308]) 4$Answer Given by Candidate : $4$
1.0k
views
1 answers
1 votes
admin asked May 20, 2023
1,019 views
Suppose you are married and you and your partner attend a party with three other married couples. Several handshakes took place. No one shook hands with himself (or herself) or ... $4 [39312]) 4$Answer Given by Candidate : $4$
569
views
1 answers
0 votes
admin asked May 20, 2023
569 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))$ ... $3 [39315]) 3$(Option $4 [39316]) 4$Answer Given by Candidate : $4$