[ocaml] refactor codes
[ocaml] implement compilation of global constraints