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 

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

1 Expert Approved Answer
Step: 1 Unlock

Variables S Start symbol representing a string of balanced parentheses Terminal symbols Left normal ... View full answer

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 Economics Questions!