CYK algorithm: Difference between revisions

Content deleted Content added
Undid revision 290086064 by 130.225.0.251 (talk)
m Reverted 1 edit by 193.136.166.125 identified as vandalism to last revision by 130.225.0.251. (TW)
Line 19:
The algorithm as given in [[pseudocode]] is as follows:
===As pseudocode===
'''Let''' the variableinput be a string ''CarlosS'' be the input string consisting of ''n'' letters,characters: ''a''<sub>1</sub> ... ''a''<sub>''n''</sub>.
'''Let''' the grammar contain ''r'' nonterminal symbols ''R''<sub>1</sub> ... ''R''<sub>''r''</sub>.
This grammar contains the subset R<sub>s</sub> which is the set of start symbols.
Line 31:
'''If''' P[j,k,B] and P[j+k,i-k,C] '''then''' set P[j,i,A] = true
'''If''' any of P[1,n,x] is true (x is iterated over the set s, where s are all the indices for R<sub>s</sub>)
'''Then''' CarlosS is member of language
'''Else''' CarlosS is not member of language
 
===As prose===