class LoopTargets { method M() returns (y) { y := 0 while (y < 100) { y := y + 1 } assert y == 0 // error (139) } method N() returns (t: LoopTargets) lockchange t { t := new LoopTargets share t acquire t var s := true while (s) lockchange t { release t // error: loop invariant does not say holds(t) (252) s := false } } method P() { var t := new LoopTargets share t acquire t var s := true while (s) invariant acc(t.mu) && waitlevel == t.mu lockchange t { release t // error: loop invariant does not say holds(t) (414) acquire t s := false } release t } method Q() { var t := new LoopTargets share t acquire t var s := true while (s) invariant rd(t.mu) invariant holds(t) && waitlevel == t.mu lockchange t { release t acquire t s := false } assert holds(t) // there we are release t } }