#NEWLINE# def alpha( self , x , l , t , u ) : #NEWLINE# #INDENT# if ( u < 0 ) : #NEWLINE# #INDENT# return 0.0 #NEWLINE# #UNINDENT# if ( t == 0 ) : #NEWLINE# #INDENT# if ( u == 0 ) : #NEWLINE# #INDENT# return x [ 0 ] [ self . blank_symbol ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( u == 1 ) : #NEWLINE# #INDENT# return x [ 0 ] [ l [ 1 ] ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return 0.0 #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( l [ u ] == self . blank_symbol ) or ( l [ u ] == l [ ( u - 2 ) ] ) ) : #NEWLINE# #INDENT# return ( x [ t ] [ l [ u ] ] * ( self . alpha ( x , l , ( t - 1 ) , ( u - 1 ) ) + self . alpha ( x , l , ( t - 1 ) , u ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( x [ t ] [ l [ u ] ] * ( ( self . alpha ( x , l , ( t - 1 ) , ( u - 2 ) ) + self . alpha ( x , l , ( t - 1 ) , ( u - 1 ) ) ) + self . alpha ( x , l , ( t - 1 ) , u ) ) )