Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > 4a989cf09a4b4c5f3273c280e92c6313 > files > 68

why-2.23-2.fc13.i686.rpm


include "arrays.why"

(***
   	
C. A. R. Hoare 	 
Elliott Brothers Ltd., Hertfordshire, England, U.K.

Communications of the ACM  archive
Volume 4 ,  Issue 7  (July 1961) table of contents
Pages: 321 - 322   

***)

(* Algorithm 63 *)

parameter partition : 
  a : int array -> m:int -> n:int -> i:int ref -> j:int ref ->
  { m < n } 
  unit writes a,i,j
  { m <= j and j < i and i <= n and permut(a@,a,m,n) and
    exists x:int.
      (forall r:int. m <= r <= j -> a[r] <= x) and
      (forall r:int. j < r < i -> a[r] = x) and
      (forall r:int. i <= r <= n -> a[r] >= x) }