Question: For the coding part of the midterm 2 you need to write down a Chomsky normal form context free grammar that will solve the
For the coding part of the midterm 2 you need to write down a Chomsky normal form context free grammar that will solve the balanced parentheses problem from homework 3 including the bonus part. For this problem you are provided with a cyk code, and you just need to modify the rules, n_rules, states, and input string. If your grammar only works for normal parentheses, you will get 10 points. If your grammar works for both normal and squared parentheses, you will get 20 points. Don't forget the provided cyk code assumes every variable is an uppercase letter so you are limited with amount of variables you can have on your grammar. If you want to use another cyk implementation you can do that, but your grammar should be clearly stated in your code.
Step by Step Solution
There are 3 Steps involved in it
Variables S Start symbol representing a string of balanced parentheses Terminal symbols Left normal ... View full answer
Get step-by-step solutions from verified subject matter experts
