177
 правок
Изменения
м
Введем функцию <tex> getTheTypeOfMutualRecursiveSet(N_i): P \rightarrow  \{left, right, self, cycle\}  </tex>:
 
→Идея алгоритма
Пусть, <tex> P = \{N_1,N_2,...,N_K\} </tex> разбиение <tex> N^*</tex> на <tex> k </tex> дизъюнктных множеств взаимно рекурсивных терминалов, 
<tex> N_1 \cup N_2 \cup ... \cup N_k = N^* \land \forall i N_i \neq \emptyset </tex>. 
 '''function''' IsLeftType(<tex>N_i</tex>)
     '''return''' <tex> \exists (A \Rightarrow \alpha B \beta) \in P[ A \in N_i \land B \in N_i \land \alpha \neq \varepsilon ]</tex>
     '''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> getTheTypeOfMutualRecursiveSet(N_i): P \rightarrow  \{left, right, self, cycle\}  </tex>:
 '''function''' getTheTypeOfMutualRecursiveSet (<tex>N_i</tex>):
    '''if''' !IsLeftType(<tex>N_i</tex>) && IsRightType(<tex>N_i</tex>) 
