Hi there,
Here is a sample which pass type‑checking:
fun loop {step: nat} .<step>. (n: int step): void =
if n = 0 then () else loop(n - 1)
This one don't:
fun loop {step: nat} .<step>. (n: int step): void =
case+ n of
| 0 => ()
| _ => loop(n - 1)
So I wanted to try to be explicit:
fun loop {step: nat} .<step>. (n: int step): void =
case+ n of
| 0 => ()
| _ =>
let prval () = prop_verify_and_add{step > 0}()
in loop{step - 1}(n - 1)
end
It seems not ovious to the checker, that `step` is greater than zero. It knows it when an `if` statement is used, and don't when a `case` statement is used.
This raises the question: what are the assumptions automatically generated by a case statement, if there are?
Or may be to be more general: what statements generates what assumptions?
A question aside: the “add” in `prop_verify_and_add` means “add to the store of available assumptions”, isn't it? (just to be sure)