This can be proven (using alt-ergo 0.95.1) if you weaken your loop assignments.
@loop assigns i, array [0..length-1];
The precondition i >= 0 also necessary, because it is not implied \valid(array+(0..length-1) . array+(0..length-1) is a valid set of locations with length <= 0 , although it is empty.
The fact that your source loop assigns does not mean that your precondition is a limitation of the current version of the WP plugin.
byako source share