Question

Given the following Grammar G, S->ASB A-> AS a B-> Sbs Albb (a) Identify and remove the A-productions. (b) Identify and remov

0 0
Add a comment Improve this question Transcribed image text
Answer #1

S0 -> S
S -> ASB
A -> aAS | a | epsilon
B -> SbS | A | bb

a)

Removed A -> epsilon

S0 -> S
S -> ASB | SB
A -> aAS | a | aS
B -> SbS | A | bb | epsilon

Removed B -> epsilon

S0 -> S
S -> ASB | SB | S
A -> aAS | a | aS
B -> SbS | A | bb

b)

S0 -> ASB | SB
S -> ASB | SB
A -> aAS | a | aS
B -> SbS | aAS | a | aS | bb

c)

Remove mixed productions

S0 -> ASB | SB
S -> ASB | SB
A -> CAS | a | CS
B -> SDS | CAS | a | CS | DD
C -> a
D -> b

Change to CNF

S0 -> EB | SB
S -> EB | SB
A -> FS | a | CS
B -> GS | FS | a | CS | DD
C -> a
D -> b
E -> AS
F -> CA
G -> SD

PLEASE UP VOTE

Add a comment
Know the answer?
Add Answer to:
Given the following Grammar G, S->ASB A-> AS a B-> Sbs Albb (a) Identify and remove...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT