The CYK Algorithm
The CYK Algorithm
w1 w2 w3 w4 w5
Theorem:
The CYK Algorithm correctly computes X i j for all i and j; thus w is in L(G) if
and only if S is in X1n.
The running time of the algorithm is O(n 3).
Question
Show the CYK Algorithm with the following example:
CNF grammar G
S AB | BC
A BA | a
B CC | b
C AB | a
w is ababa
Question Is ababa in L(G)?
Basics of CYK Algorithm
The Structure of the rules in a Chomsky Normal Form grammar
Uses a dynamic programming or table-filling algorithm
Complexity O(n3)