Assignment 5 Done

This commit is contained in:
static
2024-10-11 02:01:25 +00:00
parent dd37d10595
commit cb2fed1e48
3 changed files with 17 additions and 3 deletions

View File

@@ -28,7 +28,7 @@ module Max
invariant { 0 <= max_idx <= n-1 }
(* IMPORTANT: DON'T MODIFY THE ABOVE LINES *)
(* TODO: Replace `true` with your solution. Your solution MUST be a single line, at line 31. DON'T add more code above or below. *)
invariant { true }
invariant { forall j. 0 <= j < i -> a[j] <= a[max_idx] }
(* IMPORTANT: DON'T MODIFY THE BELOW LINES *)
if a[max_idx] < a[i] then max_idx <- i;
done;