Program Correctness by Induction
Basis Step: sum(v,0) = 0. ?
Inductive Hypothesis (n=k): Assume sum(v,k) correctly returns sum of first k elements of v, i.e. v[0]+v[1]+…+v[k-1]
Inductive Step (n=k+1): sum(v,n) returns v[k]+sum(v,k) which is the sum of first k+1 elements of v. ?