O(N log N)-space IPC solver in OCaml