Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Context Free Grammar Related Question Question: Eliminate ? productions, unit productions, useless symbols and then rewrite the resulting grammar in the Chomsky Normal Form (in

Context Free Grammar Related Question

Question:

Eliminate ? productions, unit productions, useless symbols and then rewrite the resulting grammar in the Chomsky Normal Form (in that order) for the following two input grammars:

S -> 0E0 | 1FF | ?

E -> G

F -> S | E

G -> S | ?

_____________________________________________________________________________________________________________________

I am having trouble answering this question, mainly because I find that the Grammer just loops through itself no matter the derivation. When you remove null productions for start state S, you go through removing the null productions in G, and then E, and then F, and then S again, or when you are removing useless Unit Productions, I don't know when to stop. What I've got so far is after reducing the unit productions, before we begin converting to Chomsky Normal Form, I get:

S' -> 0E0 | 1FF | 00 | 1F | 1

S -> 0E0 | 1FF | 00 | 1F | 1

F -> 0E0 | 1FF | 00 | 1F | 1

E-> 0E0 | 1FF | 00 | 1F | 1

I don't have time to show my work, I just followed the standard rules of reduction for Null and Unit productions before converting to Chomsky Normal Form, this just doesn't look correct. I'd appreciate any help I can get. Thanks in advance!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial And Temporal Databases 8th International Symposium Sstd 2003 Santorini Island Greece July 2003 Proceedings Lncs 2750

Authors: Thanasis Hadzilacos ,Yannis Manolopoulos ,John F. Roddick ,Yannis Theodoridis

2003rd Edition

3540405356, 978-3540405351

More Books

Students also viewed these Databases questions

Question

Explain how to find the slope of a straight line.

Answered: 1 week ago

Question

=+1. Who produces your service/product?

Answered: 1 week ago