Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions