Skip to content

Commit

Permalink
add Min exercise
Browse files Browse the repository at this point in the history
  • Loading branch information
kamalfarahani committed Jul 24, 2021
1 parent 9d49fa9 commit c4400ea
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions plf/Hoare2.v
Original file line number Diff line number Diff line change
Expand Up @@ -1052,24 +1052,24 @@ Definition manual_grade_for_decorations_in_factorial : option (nat*string) := No
(**
{{ True }} ->>
{{ }}
{{ 0 + min a b = min a b }}
X := a;
{{ }}
{{ 0 + min X b = min a b }}
Y := b;
{{ }}
{{ 0 + min X Y = min a b }}
Z := 0;
{{ }}
{{ Z + min X Y = min a b }}
while ~(X = 0) && ~(Y = 0) do
{{ }} ->>
{{ }}
{{ (Z + min X Y = min a b) && X <> 0 && Y <> 0 }} ->>
{{ (Z + 1) + min (X - 1) (Y - 1) = min a b }}
X := X - 1;
{{ }}
{{ (Z + 1) + min X (Y - 1) = min a b }}
Y := Y - 1;
{{ }}
{{ (Z + 1) + min X Y = min a b }}
Z := Z + 1
{{ }}
{{ Z + min X Y = min a b }}
end
{{ }} ->>
{{ (Z + min X Y = min a b) && ~(X <> 0 && Y <> 0) }} ->>
{{ Z = min a b }}
*)

Expand Down

0 comments on commit c4400ea

Please sign in to comment.