The Google OR-Tools are a suite of tools for solving optimization problems. They include, in particular, CP-SAT, which is a powerful constraint solver and optimizer for integer linear programming and boolean satisfiability problems.
The ocaml-ortools package provides an OCaml interface to a subset of CP-SAT constraints. It comprises two parts ortools, which allows modelling constraint problems in OCaml and translating them to a protocol buffer format (thanks to ocaml-protc), and ortools_solvers, which allows an embedded version of CP-SAT to be called directly from OCaml. Both parts can be installed using opam or built with dune. The latter includes the source of OR-Tools 9.15 which is built together with most of its libraries and installed as part of the opam package.
Some simple examples can be found in the online documentation and source code. They can be built using the following commands.
opam install ortools ortools_solvers
ocamlfind ocamlopt -o prog -package ortools -package ortools_solvers -linkpkg prog.ml
I would be happy to accept pull requests for the missing CP-SAT constraints (I think it best to develop the interface together with real applications, and I only need the ILP and boolean parts at the moment), to translate more of the standard example programs (an easy way to contribute), and to include other solvers from the suite (likely to involve solving tedious compilation and compatibility problems across multiple platforms).
Thanks to @nojb, @Rucikir , and others for their help with dune, and @xvw and @panglesd for their help with odoc. Thanks to @jmid , @mseri , and @avsm for discussing and merging my opam-repository pull requests.