anchor.diff: -#light 
  +﻿#light 
   #nowarn "40"
   open IL
   open Production
  
positive.code:               | [] -> buf,[]
          let (red,n_tree) = to_Label (if tree<>[] then kill_label tree else tree)  []     
          Label::(Node(red,item.prod_name,[item.prod_name]))::n_tree
      let tree2 item tree = ((Leaf(text,[text]))::(function (Label::tree)-> tree| x-> x) tree)
      let new_states = Set.filter (fun (item,tree) -> (item.next_num=None))states
      let result_states states _tree = Set.map (fun (item,tree) -> (item,(_tree item tree))) states
      union_all
  
negative.code:    printfn "Closure and goto calculation.\nStart time: %A" System.DateTime.Now
      
  let items = PreCalculation.items
  let rec kill_label lst = (function Label::tl -> kill_label tl| x -> x) lst 
  //С_С'Р_ РїС_РчР_РїС_Р_С_С+С'С' goto. С_Р°Р_ Р°Р_Р°Р>РёР·Р°С'Р_С_ С'Р_Р_Р_Р° С_Р°Р+Р_С'Р°РчС' Р+С<С_С'С_РчРч. (closure - Р_С+РчР_С_ Р_Р_С_Р_Р_Р°С_ Р_РїРчС_Р°С+РёС_)           
  let goto (states,symbol) =  Set.union_all (Set.map (fun (y,tree) -> Set.map(print_any tree;System.Console.WriteLine();
                                                      fun z -> (z, if exists (fun item -> 
                                                                                  ((*List.hd tree <> Label &&*)(item.item_num = z.s)(* && PreCalculation.getText item.symb = symbol*))) 
                                                                                  (PreCalculation.prevItem z)
                                                                   then ((function (*(Leaf(_) as x)::Label::tree)->x::Label::tree|*)((Leaf(_) as x)::tree)->x::Label::tree|x->x)tree) 
                                                                   else ((function ((Leaf(_) as x)::Label::tree)-> Label::x::tree| (Leaf(_) as y)::x-> Label::y::x|x->x) tree)))(PreCalculation.goto_set.[(y,symbol)]))states )                         
     
  let union_from_Some set = set |> List.filter Option.is_some |> List.map Option.get |> Set.of_list                              
     
  