var b0,b1,turn0,turn1:bool; initial not b0 and not b1; proc acquire(tid:bool) returns () var local:bool; begin if not tid then b0 = true; yield; local = turn1; turn0 = local; yield; assume (not b1 or local!=turn1); else b1 = true; yield; local = not turn0; turn1 = local; yield; assume (not b0 or local==turn0); endif; yield; end proc release (tid:bool) returns () begin if not tid then b0 = false; else b1 = false; endif; end proc main(tid:bool) returns () begin while true do acquire(tid); release(tid); done; end thread T0: var tid:bool; begin tid = false; main(tid); end thread T1: var tid:bool; begin tid = true; main(tid); end