anchor.diff:  
   //--Функция для удаления цепных правил-------------------------------------------------------------
                   
  -let deleteChainRule (ruleList: Rule.t<_, _> list) = ruleList
  +let deleteChainRule (ruleList: Rule.t<_, _> list) = 
  +    
  +    let rec newRule (mainRule: Rule.t<_, _>) (name: string)  = 
  +        ruleList |> List.collect
  +            (fun rule ->
  +
  +                let isOneRule rule = 
  +                    match rule.body with
  +                    |PSeq(elements, actionCode, lbl) 
  +                        when elements.Length = 1
  +                        && (match elements.Head.rule with PRef(t, _) -> true | x -> false) -> true
  +                    |x -> false
  +
  +                if rule.name = name then 
  +                    if isOneRule rule then
  +                        newRule mainRule 
  +                            (match rule.body with
  +                             |PSeq(elements, actionCode, lbl) -> (match elements.Head.rule with PRef(t, _) -> (fst t) | x -> "")
  +                             |x -> ""
  +                            )
  +                    else
  +                        [{
  +                            name=mainRule.name
  +                            args=rule.args
  +                            _public=mainRule._public
  +                            metaArgs=rule.metaArgs
  +                            body=rule.body
  +                        }] 
  +                else
  +                    []
  +            )
  +        
  +
  +    ruleList |> List.collect
  +        (fun rule -> 
  +            match rule.body with
  +            |PSeq(elements, actionCode, lbl) 
  +                when elements.Length = 1
  +                && (match elements.Head.rule with PRef(t, _) -> true | x -> false) -> 
  +                newRule rule (match elements.Head.rule with PRef(t, _) -> (fst t) | x -> "")
  +            |x -> [rule]
  +        )
  +
  +//--Переименование терминалов в нетерминалы в неподходящих правилах---------------------------
  +
  +let renameTerm (ruleList: Rule.t<_, _> list) = ruleList
   
   //--Преобразование в КНФ---------------------------------------------------------------------------
   
  
positive.code: open Yard.Core.IL
  open Yard.Core.IL.Production
  open System.Collections.Generic
  
  //--Тестовые функции-------------------------------------------------------------------------------
  
  
negative.code:     //--Функция для добавления нового правила------------------------------------------------------
  
      let newRule (rule: Rule.t<_, _>) (epsRef: string list) = 
          
          if not epsRef.IsEmpty then
              incr index
              [{
                  name=rule.name
                  args=[]
                  _public=rule._public
                  metaArgs=[]
                  body=PSeq(
                                  (match rule.body with PSeq(e, a, l) -> e | x -> []) |> List.collect 
                                      (fun elem ->
                                          match elem.rule with
                                          |PRef(t, _) when not (isEps (fst t)).IsEmpty -> []
                                          |x -> [elem]
                                      )
                                  ,
                                  (match rule.body with PSeq(e, a, l) -> a | x -> None), 
                                  (match rule.body with PSeq(e, a, l) -> l | x -> None))
              }]
          else
              []
  
      //--Добавляем новые правила--------------------------------------------------------------------
      
      ruleList |> List.collect
          (fun rule -> 
              match rule.body with
              |PSeq(elements, actionCode, lbl) when not elements.IsEmpty -> 
  