Skip to content
Snippets Groups Projects
Commit c60e0ee3 authored by Brady James Garvin's avatar Brady James Garvin
Browse files

Verified the final algorithm.

parent 89e43a3a
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,16 @@ method CopyValues<T, U>(mapping: map<T, U>, sources: map<T, T>) returns (updated
{
var result := map[];
var remaining := set key | key in mapping :: key;
while |remaining| > 0 {
while |remaining| > 0
invariant
forall d | d in remaining ::
d in sources ==>
sources[d] in mapping
invariant
forall d | d in remaining ::
d !in sources ==>
d in mapping
{
var destinationKey :| destinationKey in remaining;
remaining := remaining - {destinationKey};
var sourceKey := destinationKey;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment