Content deleted Content added
→As pseudocode: fixed pseudocode |
→As pseudocode: fix pseudocode |
||
Line 42:
'''if''' ''P''[n,''1'',''1''] is true '''then'''
''I'' is member of language
'''return''' ''back'' -- by ''retracing the steps through back, one can easily construct all possible parse trees of the string.''
'''else'''
'''return''' "not a member of language"
Line 64:
'''for each''' production ''R''<sub>''a''</sub> → ''R''<sub>''b''</sub> ''R''<sub>''c''</sub>
prob_splitting = Pr(''R''<sub>''a''</sub> →''R''<sub>''b''</sub> ''R''<sub>''c''</sub>) * ''P''[''p'',''s'',''b''] * ''P''[''l''-''p'',''s''+''p'',''c'']
'''if'''
'''set''' ''P''[''l'',''s'',''a''] = prob_splitting
'''set''' ''back''[''l'',''s'',''a''] = <p,b,c>
Line 70:
'''if''' ''P''[n,''1'',''1''] > 0 '''then'''
find the parse tree by retracing through ''back''
'''return''' the parse tree
'''else'''
'''return''' "not a member of language"
|