Answered step by step
Verified Expert Solution
Question
1 Approved Answer
USE JAVA PLEASE AND MAKE IT SO IT PROMPTS THE USER FOR A TEXT FILE AND READS THE FILE PLEASE Project Problem: Simplification of Context
USE JAVA PLEASE AND MAKE IT SO IT PROMPTS THE USER FOR A TEXT FILE AND READS THE FILE PLEASE Project Problem: Simplification of ContextFree Grammars We learned three contextfree grammar CFG simplification techniques in our classes: removing epsi rules, unit rules, and useless rules. In this project, read a CFG from a txt file, simplify it by removing epsi rules and useless rules, and print out the simplified equivalent CFG No need to care or remove unitrules. For example, given the following CFG in a txt file denotes empty string and denotes arrow head : SaAaBB AaaA BbBbbC CB After processing, your program should print out the following simplified equivalent CFG: SaAa AaaAaa 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: SAaBaCbD Aa Bb Cc Dd For the above CFG the print out should be SaabAaabaBabAaBabaaCbAaaCbaBaCbAaBaCbaabDAaabDaBabDAaBabDaaCbDAaaCbDaBaCbDAaBaCbD Aa Bb Cc Dd
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started