Skip to content

Casting #1224

Answered by axch
pharringtonp19 asked this question in Q&A
Casting #1224
Feb 8, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

No, but the proof is a little subtle: if Dex executes unsafe_i_to_n ((n_to_i depth) - 1), it must be the case that depth > 0, because otherwise the enclosing for would never run. Ergo, (n_to_i depth) - 1 is non-negative, so we have discharged the proof obligation imposed by unsafe_i_to_n.

That said, why not just avoid this situation by computing ordinal i + 1 == depth instead?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pharringtonp19
Comment options

Answer selected by pharringtonp19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants