177
 правок
Изменения
м
 
→Идея алгоритма
 '''bool''' isRightType(<tex>N_i</tex>: '''nonterminal'''): 
     '''return''' <tex> \exists (A \Rightarrow \alpha B \beta) \in P[ A \in N_i \land B \in N_i \land \beta \neq \varepsilon ]</tex>
Будем называть <tex>\mathtt {typeRecursive}</tex> набор четырех величин <tex>\{left, right, self, cycle\}  </tex>
Определим функцию <tex>\mathtt {getTheTypeOfMutualRecursiveSet}(N_i): P \rightarrow  \mathtt {left, right, self, cycle\typeRecursive}  </tex>: '''function''' getTheTypeOfMutualRecursiveSet(<tex>N_i</tex>: '''nonterminal'''): '''inttypeRecurcive'''
    '''if''' !isLeftType(<tex>N_i</tex>) '''and''' isRightType(<tex>N_i</tex>) 
        '''return''' left