Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 3096628e6c82c1506f002e900cb23f5e > files > 269

why-2.26-1.fc14.x86_64.rpm


include "arrays.why"

let swap =
  fun (t:int array)(i,j:int) ->
    { 0 <= i < array_length(t) and 0 <= j < array_length(t) }
    (let v = t[i] in
     begin
       t[i] := t[j];
       t[j] := v
     end)
    { exchange(t, t@, i, j) }