SumVector = proc(a:array int,p:proctype (int) returns int) ; sum:int := 0 for x:int in array[int]$elements(a) do sum:=sum+p(x); end; end SumVector