Question: Theorv of computations Write a program that can read a file that contains a context free grammar and does the following tasks. 1. Transform the

Theorv of computations Write a program that can read a file that contains a context free grammar and does the following tasks. 1. Transform the grammar into Chomsky Normal Form Example of the grammar format in the file is: S->ABab 2. Generate random sentences based on a context free grammar. The context free grammar from which you can generate random sentences is: S-NP VP NP ->N VP ->V N-Musa N ->Rania N ->Hiba N->Ali V->Loves V ->Eats V->Deceives Theorv of computations Write a program that can read a file that contains a context free grammar and does the following tasks. 1. Transform the grammar into Chomsky Normal Form Example of the grammar format in the file is: S->ABab 2. Generate random sentences based on a context free grammar. The context free grammar from which you can generate random sentences is: S-NP VP NP ->N VP ->V N-Musa N ->Rania N ->Hiba N->Ali V->Loves V ->Eats V->Deceives
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
