Lecture 06

lecture notes

Earley Parser

Continued in Lecture 07

Exercise 1

Given the following grammar:

S → AaB | aBb
A → a | C
B → FAb |  bA
C → CDB | ϵ
D → A | B | ab
E → b | A
F → aF 

Exercise 2

A CYK parser is parsing the input “Int , Int ⇒ Int”. The incomplete tables for two different grammars are given below.

a)

b)

Exercise 3

Consider a context-free grammar without unit or ε-productions. Assume that the maximum number of symbols on the right hand side of any production is $k$. Show that there exists an equivalent grammar in Chomsky normal form with no more than $(k - 1)|P| +  |T|$ production rules. The set $P$ is the set of production rules and $T$ is the set of terminals.