CYK algorithm: Difference between revisions

Content deleted Content added
Line 21:
'''for each''' ''i'' = 1 to ''n''
'''for each''' unit production ''R''<sub>''j''</sub> -> ''a''<sub>''i''</sub>
set ''P''[''i1'',''1i'',''j''] = true
'''for each''' ''i'' = 2 to ''n'' ''-- Length of span''
'''for each''' ''j'' = 1 to ''n''-''i''+1 ''-- Start of span''
'''for each''' ''k'' = 1 to ''i''-1 ''-- Partition of span''
'''for each''' production ''R''<sub>''A''</sub> -> ''R''<sub>''B''</sub> ''R''<sub>''C''</sub>
'''if''' ''P''[''jk'',''kj'',''B''] and ''P''[''ji''+-''k'',''ij''-+''k'',''C''] '''then''' set ''P''[''ji'',''ij'',''A''] = true
'''if''' any of ''P''[1n,''n1'',''x''] is true (''x'' is iterated over the set ''s'', where ''s'' are all the indices for ''R''<sub>''s''</sub>) '''then'''
''S'' is member of language
'''else'''