anchor.diff:                          printf "%.8f  " matrix.[i, j]
                       else
                           assert (matrix.[i, j] = 0.)
  +//                        printf "%.8f  " matrix.[i, j]
                           printf "----------  "
                   printfn ""
               printfn ""
  
positive.code:         printfn ""         
  
  
  
      // only for str size == 2^k-1
      // maxSearchLength ignored
      let recognize (strToParse: string) 
                    (complexRules: Dictionary<(NonTerminal * NonTerminal), (NonTerminal * double) list>)
                    (simpleRules: Dictionary<char, (NonTerminal * double) list>)
  
negative.code:             let actualCol2Count = (min (snd from2.Top) (stringSize + 1)) - snd from2.Left
              Array2D.init from1.Size actualCol2Count calcCell    
  
          let performMultiplication tasks = 
              let performOne task = 
                  let {where=where; from1=from1; from2=from2} = task
                  let completeOnePair (nt1, nt2) =
                          addToP (nt1, nt2) (subMatrixMult nt1 nt2 from1 from2) where
                  pMatrix |> Map.iter (fun nts _ -> completeOnePair nts)
              tasks |> Array.iter performOne
  
          let layerIsRedundant (layer: SubMatrix.T []) =
              if Array.length layer = 0 
              then true
              else 
                  let layerIsOutOfSearchZone = snd layer.[0].Bottom - fst layer.[0].Bottom + 1 >= maxSearchLength + 1
                  layerIsOutOfSearchZone
          
          let rec completeSubLayer layer matricesSize = 
              if matricesSize = 1 then
                  let headsFromTail (tail, tailProb) = 
                      if complexRules.ContainsKey tail then 
                          complexRules.Item tail |> List.map (fun (head, headProb) -> head, headProb * tailProb)
                      else 
                          []
  
                  let tails row col = pMatrix |> Map.map (fun _ probs -> probs.[row, col-1]) |> Map.filter (fun _ prob -> prob > 0.)
                  let heads (row, col) = tails row col |> Map.toList |> List.map headsFromTail |> List.concat
  
                  layer 
                  |> Array.map (fun (matrix: SubMatrix.T) -> matrix.Top)
                  |> Array.map (fun top -> top, heads top)
                  |> Array.iter (fun (top, heads) -> heads |> updateTMatrixCell (fst top) (snd top - 1))
  
              else
                  let halfMatricesSize = int(matricesSize / 2)
                  let zeroSubLayer = layer |> Array.map (fun (matrix: SubMatrix.T) -> matrix.BottomMatrix)                        
                  completeSubLayer zeroSubLayer halfMatricesSize
                  completeVLayer layer matricesSize
  
          and completeVLayer layer matricesSize =
              let halfMatricesSize = int(matricesSize / 2)
              let reducedLayer = 
                  if snd layer.[Array.length layer - 1].Top > stringSize + 1 
                  then layer.[0..Array.length layer - 2] 
                  else layer
  
              let firstSubLayer = 
                  if Array.length layer = Array.length reducedLayer
                  then
                      layer 
                      |> Array.collect (fun matrix -> [|matrix.LeftMatrix; matrix.RightMatrix|])
                  else
                      let reducedMatrix = layer.[Array.length layer - 1]
                      let allButOne = 
                          reducedLayer 
                          |> Array.collect (fun matrix -> [|matrix.LeftMatrix; matrix.RightMatrix|])
                      Array.append allButOne [| reducedMatrix.LeftMatrix |]   
  
              if not <| layerIsRedundant firstSubLayer
              then
                  let toMult = 
                      //todo: annotation?
                      let getMults i (matrix: SubMatrix.T) =
  