Question: Project Problem: Simplification of Context - Free Grammars We learned three context free grammar ( CFG ) simplification techniques in our classes removing e -

Project Problem: Simplification of Context-Free Grammars We learned three context free grammar (CFG) simplification techniques in our classes removing e-rules, unit rules, and useless rules. In this project, read a CFG from a txt ble simplify it by removing rules and useless rules, October 27,2021 Project 2 of CSC 471(F21. Dr. Zu) Page 2 of 2 and print out the simplified equivalent CEG. No need to care or remove unit-rules, For example, given the following CFG in a text file (O denotes empty string and denotes arrow head") S-ABB A-AAA B-B bbc C- After processing your program should print out the following simplified equivalent CFG: S-aAa A-aa The following are a few more examples you can use to test your program (I highly recommend that you come up with more examples to make sure the correctness of your program): (1) S.ABCD A-0a B-6b COC D-Old For the above CE, the print out should be S-aubah Bat/AaBaba AlbaBach/AaBabwbb/AshD|RahD|AaBubDCBD:AACHDBachd AaBach A-a B-b Cc D-d (2) S-AaB A-0 B-bu\Lambda \Iota \Omicron For the above CFG, the print out should be S-a Balaa B-ha (3) S-ASAB A-BS B-60 For the above part of the transition table of a NFA, the print out should be S-ASAB SAAS A-BS a B-b Note that your program must be able to work for any CPG, not only just for the above given examples

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!