<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
the	O
Cocke	B-Application
–	I-Application
Younger	I-Application
–	I-Application
Kasami	I-Application
algorithm	I-Application
(	O
alternatively	O
called	O
CYK	B-Application
,	O
or	O
CKY	O
)	O
is	O
a	O
parsing	B-Language
algorithm	O
for	O
context-free	O
grammars	O
published	O
by	O
Itiroo	O
Sakai	O
in	O
1961	O
.	O
</s>
<s>
It	O
employs	O
bottom-up	B-Application
parsing	I-Application
and	O
dynamic	B-Algorithm
programming	I-Algorithm
.	O
</s>
<s>
The	O
standard	O
version	O
of	O
CYK	B-Application
operates	O
only	O
on	O
context-free	O
grammars	O
given	O
in	O
Chomsky	O
normal	O
form	O
(	O
CNF	O
)	O
.	O
</s>
<s>
The	O
importance	O
of	O
the	O
CYK	B-Application
algorithm	I-Application
stems	O
from	O
its	O
high	O
efficiency	O
in	O
certain	O
situations	O
.	O
</s>
<s>
Using	O
big	O
O	O
notation	O
,	O
the	O
worst	B-General_Concept
case	I-General_Concept
running	I-General_Concept
time	I-General_Concept
of	O
CYK	B-Application
is	O
,	O
where	O
is	O
the	O
length	O
of	O
the	O
parsed	B-Language
string	O
and	O
is	O
the	O
size	O
of	O
the	O
CNF	O
grammar	O
.	O
</s>
<s>
This	O
makes	O
it	O
one	O
of	O
the	O
most	O
efficient	O
parsing	B-Language
algorithms	O
in	O
terms	O
of	O
worst-case	O
asymptotic	O
complexity	O
,	O
although	O
other	O
algorithms	O
exist	O
with	O
better	O
average	O
running	O
time	O
in	O
many	O
practical	O
scenarios	O
.	O
</s>
<s>
The	O
dynamic	B-Algorithm
programming	I-Algorithm
algorithm	O
requires	O
the	O
context-free	O
grammar	O
to	O
be	O
rendered	O
into	O
Chomsky	O
normal	O
form	O
(	O
CNF	O
)	O
,	O
because	O
it	O
tests	O
for	O
possibilities	O
to	O
split	O
the	O
current	O
sequence	O
into	O
two	O
smaller	O
sequences	O
.	O
</s>
<s>
The	O
algorithm	O
in	O
pseudocode	B-Language
is	O
as	O
follows	O
:	O
</s>
<s>
return	O
back	O
--	O
by	O
retracing	O
the	O
steps	O
through	O
back	O
,	O
one	O
can	O
easily	O
construct	O
all	O
possible	O
parse	B-Language
trees	O
of	O
the	O
string	O
.	O
</s>
<s>
Allows	O
to	O
recover	O
the	O
most	O
probable	O
parse	B-Language
given	O
the	O
probabilities	O
of	O
all	O
productions	O
.	O
</s>
<s>
Now	O
the	O
sentence	O
she	O
eats	O
a	O
fish	O
with	O
a	O
fork	O
is	O
analyzed	O
using	O
the	O
CYK	B-Application
algorithm	I-Application
.	O
</s>
<s>
+CYK	O
table	O
S	O
VP	O
S	O
VP	O
PP	O
S	O
NP	O
NP	O
NP	O
V	O
,	O
VP	O
Det	O
.	O
</s>
<s>
For	O
readability	O
,	O
the	O
CYK	B-Application
table	O
for	O
P	O
is	O
represented	O
here	O
as	O
a	O
2-dimensional	O
matrix	O
M	O
containing	O
a	O
set	O
of	O
non-terminal	O
symbols	O
,	O
such	O
that	O
is	O
in	O
if	O
,	O
and	O
only	O
if	O
,	O
.	O
</s>
<s>
It	O
is	O
simple	O
to	O
extend	O
it	O
into	O
a	O
parser	B-Language
that	O
also	O
constructs	O
a	O
parse	B-Language
tree	O
,	O
by	O
storing	O
parse	B-Language
tree	O
nodes	O
as	O
elements	O
of	O
the	O
array	O
,	O
instead	O
of	O
the	O
boolean	O
1	O
.	O
</s>
<s>
Only	O
one	O
such	O
node	O
in	O
each	O
array	O
element	O
is	O
needed	O
if	O
only	O
one	O
parse	B-Language
tree	O
is	O
to	O
be	O
produced	O
.	O
</s>
<s>
However	O
,	O
if	O
all	O
parse	B-Language
trees	O
of	O
an	O
ambiguous	O
sentence	O
are	O
to	O
be	O
kept	O
,	O
it	O
is	O
necessary	O
to	O
store	O
in	O
the	O
array	O
element	O
a	O
list	O
of	O
all	O
the	O
ways	O
the	O
corresponding	O
node	O
can	O
be	O
obtained	O
in	O
the	O
parsing	B-Language
process	O
.	O
</s>
<s>
The	O
end	O
result	O
is	O
then	O
a	O
shared-forest	O
of	O
possible	O
parse	B-Language
trees	O
,	O
where	O
common	O
trees	O
parts	O
are	O
factored	O
between	O
the	O
various	O
parses	B-Language
.	O
</s>
<s>
This	O
shared	O
forest	O
can	O
conveniently	O
be	O
read	O
as	O
an	O
ambiguous	O
grammar	O
generating	O
only	O
the	O
sentence	O
parsed	B-Language
,	O
but	O
with	O
the	O
same	O
ambiguity	O
as	O
the	O
original	O
grammar	O
,	O
and	O
the	O
same	O
parse	B-Language
trees	O
up	O
to	O
a	O
very	O
simple	O
renaming	O
of	O
non-terminals	O
,	O
as	O
shown	O
by	O
.	O
</s>
<s>
For	O
the	O
use	O
in	O
teaching	O
,	O
Lange	O
and	O
Leiß	O
propose	O
a	O
slight	O
generalization	O
of	O
the	O
CYK	B-Application
algorithm	I-Application
,	O
"	O
without	O
compromising	O
efficiency	O
of	O
the	O
algorithm	O
,	O
clarity	O
of	O
its	O
presentation	O
,	O
or	O
simplicity	O
of	O
proofs	O
"	O
.	O
</s>
<s>
It	O
is	O
also	O
possible	O
to	O
extend	O
the	O
CYK	B-Application
algorithm	I-Application
to	O
parse	B-Language
strings	O
using	O
weighted	O
and	O
stochastic	B-General_Concept
context-free	I-General_Concept
grammars	I-General_Concept
.	O
</s>
<s>
Further	O
extensions	O
of	O
the	O
algorithm	O
allow	O
all	O
parses	B-Language
of	O
a	O
string	O
to	O
be	O
enumerated	O
from	O
lowest	O
to	O
highest	O
weight	O
(	O
highest	O
to	O
lowest	O
probability	O
)	O
.	O
</s>
<s>
When	O
the	O
probabilistic	O
CYK	B-Application
algorithm	I-Application
is	O
applied	O
to	O
a	O
long	O
string	O
,	O
the	O
splitting	O
probability	O
can	O
become	O
very	O
small	O
due	O
to	O
multiplying	O
many	O
probabilities	O
together	O
.	O
</s>
<s>
The	O
worst	B-General_Concept
case	I-General_Concept
running	I-General_Concept
time	I-General_Concept
of	O
CYK	B-Application
is	O
,	O
where	O
n	O
is	O
the	O
length	O
of	O
the	O
parsed	B-Language
string	O
and	O
|G|	O
is	O
the	O
size	O
of	O
the	O
CNF	O
grammar	O
G	O
.	O
This	O
makes	O
it	O
one	O
of	O
the	O
most	O
efficient	O
algorithms	O
for	O
recognizing	O
general	O
context-free	O
languages	O
in	O
practice	O
.	O
</s>
<s>
gave	O
an	O
extension	O
of	O
the	O
CYK	B-Application
algorithm	I-Application
.	O
</s>
<s>
as	O
the	O
CYK	B-Application
algorithm	I-Application
;	O
yet	O
he	O
showed	O
that	O
algorithms	O
for	O
efficient	O
multiplication	O
of	O
matrices	B-Algorithm
with	I-Algorithm
0-1-entries	I-Algorithm
can	O
be	O
utilized	O
for	O
performing	O
this	O
computation	O
.	O
</s>
<s>
The	O
dependence	O
on	O
efficient	O
matrix	O
multiplication	O
cannot	O
be	O
avoided	O
altogether	O
:	O
has	O
proved	O
that	O
any	O
parser	B-Language
for	O
context-free	O
grammars	O
working	O
in	O
time	O
can	O
be	O
effectively	O
converted	O
into	O
an	O
algorithm	O
computing	O
the	O
product	O
of	O
-matrices	O
with	O
0-1-entries	O
in	O
time	O
,	O
and	O
this	O
was	O
extended	O
by	O
Abboud	O
et	O
al	O
.	O
</s>
