anchor.diff:      //    B -> 'b', 0.4
       //    B -> 'b', 0.4
   
  +        let printMatrix (matrix: double [,]) strLen searchLen =
  +            let rowLength = matrix.GetLength(0)
  +            let colLength = matrix.GetLength(1)
  +
  +            for i in [0..rowLength-1] do
  +                for j in [0..colLength-1] do
  +                    if i <= strLen && j <= strLen && j > i && j-i <= searchLen then
  +                        printf "%.8f  " matrix.[i, j]
  +                    else
  +                        assert (matrix.[i, j] = 0.)
  +                        printf "----------  "
  +                printfn ""
  +            printfn ""
  +
  +        let isAnswerValid (matrix: double [,]) strLen searchLen = 
  +            let rowLength = matrix.GetLength(0)
  +            let colLength = matrix.GetLength(1)
  +            if rowLength <> colLength || rowLength <> strLen + 1 then
  +                false
  +            else
  +                let notRealCell (i, j) =
  +                        i > strLen 
  +                        || j > strLen 
  +                        || j <= i 
  +                        || j-i > searchLen 
  +
  +                [1..rowLength-1]
  +                |> List.map (fun i -> [1..colLength-1] |> List.map (fun j -> (i,j))) 
  +                |> List.concat
  +                |> List.filter notRealCell
  +                |> List.forall (fun (i, j) -> matrix.[i,j] = 0.)
  +
           let check str = 
  -            recognize str crl srl erl nonterminals S 0
  -
  -
  -//        check "abb"      
  -        check "aaabbcc"  
  +            let searchLen = String.length str
  +            let toCheck = recognize str crl srl erl nonterminals S searchLen
  +            assert (isAnswerValid toCheck (String.length str) searchLen)
  +            printMatrix toCheck (String.length str) searchLen
  +            
  +        check "abb"      
  +        check "aaabbcc"
   
           System.Console.ReadLine() |> ignore
           0
positive.code:                                             firstSubLayer 
                                              toMult
                                              
              // todo: do firstMultTasks  
              firstMultTasks |> Array.iter printTask
              printfn ""
              completeSubLayer firstSubLayer halfMatricesSize
                        
              let secondSubLayer = 
  
negative.code:             let secondMultTasks = Array.map2 (fun w (f1, f2) -> {where=w; from1=f1; from2=f2}) secondSubLayer secondToMult 
              let thirdMultTasks = Array.map2 (fun w (f1, f2) -> {where=w; from1=f1; from2=f2}) secondSubLayer thirdToMult 
                          
              secondMultTasks |> Array.iter performMultiplication
              thirdMultTasks  |> Array.iter performMultiplication          
              completeSubLayer secondSubLayer halfMatricesSize
  
  
  