Skip to content
Discussion options

You must be logged in to vote

for i := l to u excludes the end, so u is excluded. In your while loop though, u is included. If you change for i := l to u to for i := l to u + 1, it'll verify. You can find the precise meaning of the for statement in the documentation: https://dafny.org/dafny/DafnyRef/DafnyRef#g-for-statement

Replies: 1 comment 1 reply

Comment options

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

Answer selected by KihongHeo
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