Q)
S -> ASB
A -> aAS | a |
B -> SbS | A | bb
a) Removing productions where we have to remove A ->
S -> SB | ASB
A -> aS | aAS | a
B -> SbS | A | bb |
Remove B -> produnction :
S -> SB | ASB | AS
A -> aS | aAS | a
B -> SbS | A | bb
b) Removing unit produnction, which we have to remove B -> A
S -> SB | SA | ASB | ASA | AS
A -> aS | aAS | a
B -> SbS | bb
c) Converting them into chomsky normal form
S -> SB | SA | XB | XA | AS
X -> AS
A -> YS | YX | a
Y -> a
B -> SZS | ZZ
Z -> b
Have to remove B -> SZS
S -> SB | SA | XB | XA | AS
X -> AS
A -> YS | YX | a
Y -> a
B -> SP | ZZ
Z -> b
P -> ZS
ANSWER :
S -> SB | SA | XB | XA | AS
X -> AS
A -> YS | YX | a
Y -> a
B -> SP | ZZ
Z -> b
P -> ZS
Given the following Grammar G, S->ASB A -> AAS | a B -> Sbs | A|bb...
1. (20 points) Given the following Grammar G, S->ASB A -> aAS | a | λ B -> SbS | A|bb (a) Identify and remove the λ-productions. (b) Identify and remove unit-productions from the result of (a). (c) Convert it to Chomsky Normal Form. 1. (20 points) Given the following Grammar G, S->ASB A -> AS | a 1a B -> Sbs | Albb (a) Identify and remove the -productions. (b) Identify and remove unit-productions from the result of (a)....
Given the following Grammar G, S->ASB A-> AS a B-> Sbs Albb (a) Identify and remove the A-productions. (b) Identify and remove unit-productions from the result of (a). (c) Convert it to Chomsky Normal Form.
Given the following Grammar G, S->ASB A-> AS a B-> Sbs Albb Identify and remove the -productions. Identify and remove unit-productions Convert it to Chomsky Normal Form.
S->ASB A-> AS a B -> Sbs Albb (a) Identify and remove the l-productions. (b) Identify and remove unit-productions from the result of (a). (c) Convert it to Chomsky Normal Form.
please show full work and answer! 1. (20 points) Given the following Grammar G, S->ASB A -> AS | a | 1 B -> Sbs | Albb (a) Identify and remove the N-productions. (b) Identify and remove unit-productions from the result of (a). (c) Convert it to Chomsky Normal Form.
Consider a grammar: S --> | aS | SS SSb | Sbs, Where T={a,b} V={S }. Show that the grammar is ambiguous. What is the language generated by this grammar?
Consider a grammar: S --> | as SS SSb Sbs, Where T={a,b} V={S}. a. Show that the grammar is ambiguous. b. What is the language generated by this grammar?
6.(20) Let G=(V, S, R, S) be a grammar with V = {Q, R, T}; { = {q, r,ts}; and the set of rules: SQ Qq RqT R~rrt Qor T>t | ST a. (5) Convert G to a PDA using the method we described. b. (15) Convert G to Chomsky normal form.
Consider a grammar : S --> a | aS | bSS | SSb | SbS, Where T={a,b} V={S }. a. Show that the grammar is ambiguous. b. What is the language generated by this grammar? 2. (20 points) Consider a grammar: S -->a | aS | SS | Ssb | Sbs, Where T={a,b} V={S}. a. Show that the grammar is ambiguous. b. What is the language generated by this grammar?
Let G = (V, S, R, S) be a grammar with V = {Q, R, T}; { = {q, r,ts}; and the set of rules: SQ Q→ RqT RrrT QQr T>t | StT b. (15) Convert G to Chomsky normal form.