Fill in a proof outline (repairing the program, if necessary) that
shows that this program finds the location k of the first positive element
(a[k]>0) in an array a[1:N] and returns N+1 if there is none such.
i1 := 1 i2 := 2 k := N+1 |
||
while i1 < k do if a[i1] > 0then k := i1 |
while i2 < k do if a[i2] > 0then k := i2 |