I wanted to see an example that was the simplest for mutual recursion. I saw this:
(* https://ocaml.org/learn/tutorials/labels.html#Mutually-recursive-functions *) let rec even n = match n with | 0 -> true | x -> odd (x-1) and odd n = match n with | 0 -> false | x -> even (x-1);;
which is correct but personally I end u having to reason to much about the example and why its correct. If the initial call is of a certain parity (say u call odd) then u insert an even number then it ends up with the same call as the initial parity function and depending on that it will be true or false. e.g. if odd n_odd then the final number will end with even 0 so it returns true as desired. Similarly if odd n_even then it ends with odd 0 and returns false. If it does even n_odd then it ends with odd 0 which is false and even n_even ends with even 0 which is true. Just to much reasoning going around and the example is NOT evident to me why its correct.
If anyone can provide a simpler example (less contrived) that would be great!