type tree = B of tree | W of tree | Dec of tree * tree | Leaf;;   let rec gen w b = match (w,b) with | (0,0) -> Some Leaf | (w,b) when (w < 0 || b < 0) -> None | (w,b) ->         let l = gen (w-1) b in         let r = (                 if w = 0 then                         (if b = 1 then Some Leaf                         else None)                 else match gen (w-1) (b-1) with                 | None -> None                 | Some x -> Some (W x)) in         match (l,r) with         | (None, None) -> None         | (Some x, None) -> Some (W x)         | (None, Some x) -> Some (B x)         | (Some x, Some y) -> Some (Dec (x, y));;                   let rec prof s = function | B a -> prof ('B'::s) a | W b -> prof ('W'::s) b | Dec (a,b) -> (prof ('W'::s) a) @ (prof ('B'::s) b) | Leaf -> [s]           let a = gen 5 3;; let l = (function Some x -> x) a;; let nbr = List.length (prof [] l);;