Skip to content
Snippets Groups Projects
Commit 75c93014 authored by Régis Blanc's avatar Régis Blanc
Browse files

some fixes in the invariants

parent 6a35548e
Branches
Tags
No related merge requests found
...@@ -17,7 +17,9 @@ object Bubble { ...@@ -17,7 +17,9 @@ object Bubble {
} }
j = j + 1 j = j + 1
}) invariant( }) invariant(
j >= 0 &&
j <= i && j <= i &&
i < size &&
isArray(sortedArray, size) && isArray(sortedArray, size) &&
partitioned(sortedArray, size, 0, i, i+1, size-1) && partitioned(sortedArray, size, 0, i, i+1, size-1) &&
partitioned(sortedArray, size, 0, j-1, j, j) && partitioned(sortedArray, size, 0, j-1, j, j) &&
...@@ -25,7 +27,8 @@ object Bubble { ...@@ -25,7 +27,8 @@ object Bubble {
) )
i = i - 1 i = i - 1
}) invariant( }) invariant(
i >= 0 && i >= -1 &&
i < size &&
isArray(sortedArray, size) && isArray(sortedArray, size) &&
partitioned(sortedArray, size, 0, i, i+1, size-1) && partitioned(sortedArray, size, 0, i, i+1, size-1) &&
sorted(sortedArray, size, i, size-1) sorted(sortedArray, size, i, size-1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment