[ocaml] define {sfdomain,sftype}.mli; refactor codes