[Bug] Simple for-loop
verification fails
#15265
Labels
bug
Something isn't working
move-prover
stale-exempt
Prevents issues from being automatically marked and closed as stale
🐛 Bug
This bug is related to the use the Move Prover.
There seems to be some issues with the encoding of
for-loops
in Boogie.Any
for-loop
seems to have anabort
path, leading toEXECUTION_FAILURE
. The problem is illustrated below with a minimal example (a loop that with an empty body). Hopefully, this will help to fix the problem.To reproduce
Code snippet to reproduce
The code snippet to reproduce the error is:
Stack trace/error message
The same behaviour is observed with the Move-2 version (running
Aptos move prove --move-2
.Expected Behavior
The expected behaviour is that the spec verifies as there is no overflow and no code in the body.
System information
Please complete the following information:
NA
MacOS.
Additional context
In a separate discussion (Tg/slack) I already reported some difficulties in proving loop invariants with
for-loops
. It looks likefor-loops
are not translated into equivalentwhile-loops
: for example I can provewhile-loop
invariants using a loop counter that I update manually, but I am unable to prove the same properties with afor-loop
.@rahxephon89 explained the limitation to me, but the problem I reported above seems to suggest that the
for-loop
encoding into boogie is flawed.Related issue: issue #15022
The text was updated successfully, but these errors were encountered: