heapbuild(S,m) is
{@$ S(0..m-1) \in Int \land m\gt 0$@}
@$\bb$@ Var j @$\in$@ Int;
  initially j=m-2
  do 
     m@$ \ge $@0 @$\rightarrow$@  heapsink(S,j,m)
            ;j:=j-1 
  od
@$\be$@



