### update a couple of sessions

parent cb07f364
 ... ... @@ -2,12 +2,12 @@ ... ... @@ -35,7 +35,7 @@ ... ...
No preview for this file type
 ... ... @@ -6,7 +6,7 @@ ... ... @@ -88,11 +88,11 @@ ... ... @@ -168,15 +168,15 @@ ... ... @@ -188,14 +188,14 @@ ... ...
No preview for this file type
 ... ... @@ -2,9 +2,9 @@ ... ...
No preview for this file type
 ... ... @@ -4,9 +4,9 @@ ... ...
No preview for this file type
 ... ... @@ -2,38 +2,43 @@ ... ...
No preview for this file type
 ... ... @@ -2,69 +2,21 @@ ... ...
No preview for this file type
 ... ... @@ -2,17 +2,16 @@ ... ...
No preview for this file type
 ... ... @@ -11,23 +11,19 @@ module BubbleSort use import array.ArrayPermut use import array.ArrayEq let bubble_sort (a: array int) ensures { permut_all (old a) a } ensures { sorted a } = label Init in for i = length a - 1 downto 1 do invariant { permut_all (a at Init) a } = for i = length a - 1 downto 1 do invariant { permut_all (old a) a } invariant { sorted_sub a i (length a) } invariant { forall k1 k2: int. 0 <= k1 <= i < k2 < length a -> a[k1] <= a[k2] } 0 <= k1 <= i < k2 < length a -> a[k1] <= a[k2] } for j = 0 to i - 1 do invariant { permut_all (a at Init) a } invariant { permut_all (old a) a } invariant { sorted_sub a i (length a) } invariant { forall k1 k2: int. 0 <= k1 <= i < k2 < length a -> a[k1] <= a[k2] } 0 <= k1 <= i < k2 < length a -> a[k1] <= a[k2] } invariant { forall k. 0 <= k <= j -> a[k] <= a[j] } if a[j] > a[j+1] then swap a j (j+1); done; ... ...
 ... ... @@ -2,9 +2,9 @@ ... ...
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!