analysis of frequent patterns and functions in ocaml