Lecture 10: IronFleet II

Preparation

Apply the following changes to the Lock system. All file paths are relative to ironfleet/src/Dafny/Distributed/.

        && |s.history| > 0
        && new_lock_holder != s.history[|s.history|-1]   

Exercise

Update the refinement proof to prove that the protocol meets the new specification. To invoke Dafny, use the following command line from ironfleet:

./tools/Dafny/Dafny.exe /noNLarith /allowGlobals /z3opt:nlsat.randomize=false /compile:0 /timeLimit:30 /noCheating:1 /autoTriggers:1 /ironDafny src/Dafny/Distributed/Protocol/Lock/RefinementProof/RefinementProof.i.dfy

Hints

    lemma mod_identity(x:int, m:int)
        requires m > 1;
        ensures  x % m != (x+1) % m;
    {
        if x % m == (x+1) % m {
            lemma_mod_equivalence(x+1,x, m);
            lemma_mod_is_mod_recursive(1, m);
            assert false;
        }
    }