Bug in AIMA?
Aug. 15th, 2012 11:20 pmAIMA by Russel and Norvig, Third edition, page 894.
CYK-Parse program
when length = 2 (first iteration of outer loop), start = N-1 (last iteration of middle loop), and len1 = N-1 (last iteration of inner loop),
second index of the reference to P which is start + len1 equals
2*N - 2, that is out of the array bounds for N > 1
Shall I request a 2.56$ check or am I missing something trivial?
CYK-Parse program
P <- array of size [M, N, N]
...
for length = 2 to N do
for start = 1 to N - length + 1 do
for len1 = 1 to N-1 do
len2 <- length - len1
...
reference to P[Z, start + len1, len2]
...
when length = 2 (first iteration of outer loop), start = N-1 (last iteration of middle loop), and len1 = N-1 (last iteration of inner loop),
second index of the reference to P which is start + len1 equals
2*N - 2, that is out of the array bounds for N > 1
Shall I request a 2.56$ check or am I missing something trivial?