text: Мы можем написать следующую функцию преобразования: T {\displaystyle T} (ins( p 1 , c 1 , s i d 1 {\displaystyle p_{1},c_{1},sid_{1}} ),ins( p 2 , c 2 , s i d 2 {\displaystyle p_{2},c_{2},sid_{2}} )) :- if ( p 1 < p 2 {\displaystyle p_{1}<p_{2}} ) return ins( p 1 , c 1 , s i d 1 {\displaystyle p_{1},c_{1},sid_{1}} ) else if ( p 1 = p 2 {\displaystyle p_{1}=p_{2}} and s i d 1 < s i d 2 {\displaystyle sid_{1}<sid_{2}} ) return ins( p 1 , c 1 , s i d 1 {\displaystyle p_{1},c_{1},sid_{1}} ) else return ins( p 1 + 1 , c 1 , s i d 1 {\displaystyle p_{1}+1,c_{1},sid_{1}} ) T − 1 {\displaystyle T^{-1}} (ins( p 1 , c 1 , s i d 1 {\displaystyle p_{1},c_{1},sid_{1}} ),ins( p 2 , c 2 , s i d 2 {\displaystyle p_{2},c_{2},sid_{2}} )) :- if ( p 1 < p 2 {\displaystyle p_{1}<p_{2}} ) return ins( p 1 , c 1 , s i d 1 {\displaystyle p_{1},c_{1},sid_{1}} ) else if ( p 1 = p 2 {\displaystyle p_{1}=p_{2}} and s i d 1 < s i d 2 {\displaystyle sid_{1}<sid_{2}} ) return ins( p 1 , c 1 , s i d 1 {\displaystyle p_{1},c_{1},sid_{1}} ) else return ins( p 1 − 1 , c 1 , s i d 1 {\displaystyle p_{1}-1,c_{1},sid_{1}} ) Некоторые системы ОП используют обе функции: IT и ET, а некоторые используют только IT функцию.