Exercises on the Chomsky Normal Form and the CYK algorithm

29 downloads 395 Views 31KB Size Report
Exercises on the Chomsky Normal Form and the CYK algorithm. 1. Convert the following context-free grammar to Chomsky Normal Form: S → ab | A. A → bAaA  ...
Exercises on the Chomsky Normal Form and the CYK algorithm

1. Convert the following context-free grammar to Chomsky Normal Form: S → ab | A A → bAaA | 

2. Convert the following context-free grammar to Chomsky Normal Form: S → aSSa | AA A → AB | a |  B → b

3. Construct CYK-tables for the strings aabb and abbb using the following grammar:

S0 → Xa Z1 | Xb S | b | e S → Xa Z1 | Xb S | b Z1 → SXb | b Xb → b Xa → a

4. Construct CYK-tables for the strings abbba and aaaba using the following grammar:

S → AY | BZ | a | b X → AY | BZ | a | b Z → XB Y

→ XA

B → b A → a

Suggest Documents