val N:ℕ; val M:ℕ; type int = ℤ[-1,N]; type elem = ℕ[M]; type array = Array[N,elem]; proc minimumPosition(a:array,m:elem,n:int):int { var p:int ≔ -1; var e:elem ≔ m; var i:int ≔ 0; while i < n do { if a[i] ≤ e then { p ≔ i; e ≔ a[p]; } i ≔ i+1; } return p; }