program that converts CFG to CNF ?
I am a student, and I am taking a class (Computer Language Theory). The class was not supposed to involve programming, but now it does for a project that is worth 1/3 of the grade.
I am not advanced enough to even know where to beging with this one. If anyone can help (pseudo code or whatever) please do so. I understand the concept on paper, and that should be fine for the class, but the teacher assigned us this:
Create a program that reads in a Context Free Gammar (in text format) and does the following:
1. Removes useless productions
2. Removes Lamda productions
3. Removes unit products
4. Converts the grammar to Chomsky Normal Form and Greibech Normal Form.
I know this may be an odd question to post, but I am desperate.
Any help would be great. Even if it doesn't concern all those steps above. Thank You all for your help.