The permitted array indices for a length- array are under zero-based indexing. A one-past-the-end index can describe an empty remaining segment but cannot be dereferenced. Proving bounds safety requires showing that every executed read and write uses a permitted index, including evaluations in a loop guard. A known target inside the array can sometimes supply a stronger loop invariant than an explicit bounds test.
New to topics? Read the docs here!