Simplifying a function OCaml

Try to write it in SMT and run the solver against it.