It seems incorrect that the following simple function is accepted as a terminating one:
val fnc : (nw: nat) -> (ni: nat) -> (ni_max: nat) -> bool
let rec fnc nw ni ni_max =
match ni with
| ni_max -> false
| _ -> fnc nw (nw + ni) ni_max
Surprisingly, the function does terminate upon evaluating it, for instance, by fnc 0 0 1
and returns false
. What am I missing out?