Have trouble understand the use of reveal_with_fuel in the fibo example #1379
-
Why |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Dear @KaminariOS I recommend asking on Zulip for quicker responses: https://verus-lang.zulipchat.com/ |
Beta Was this translation helpful? Give feedback.
-
I recall discussing this same question before. Verus proves this case as follows:
Putting these all together, we get We could consider changing this behavior; I don't think it's intentional. |
Beta Was this translation helpful? Give feedback.
I recall discussing this same question before.
Verus proves this case as follows:
lemma_fibo_is_monotonic(i, (j - 1) as nat);
we get thatfibo(i) <= fibo(j-1)
.fibo(j) == fibo(j-1) + fibo(j-2)
.fibo(j-2)
is a nat, thusfibo(j-2) >= 0
.Putting these all together, we get
fibo(i) <= fibo(j)
. Presumably, the confusing thing is the third bullet point; most people do not expect that an "unfolding" is required to deduce thatfibo(j-2)
is a nat.We could consider changing this behavior; I don't think it's intentional.