// Notice the use of @assert just before break. This is needed // for the proof to go through. @requires n >= 1 @ensures all(x==0 && i= 0) { j = 0; swapped = false; @invariant all(k, 0:j, a[k] =< a[j]) && j>=0 && j==1 && i= a[j+1]) { temp = a[j]; a[j] = a[j+1]; a[j+1] = temp; swapped = true; } j = j + 1; } if(not(swapped)) { @assert all(x=