/** * [PingPong-counting.bpl] * * Two asynchronous procedures which can enter a coupled * infinite posting loop. */ var x: bool; var i: int; procedure Ping () { if (!x) { call {:async} Ping (); x := true; i := (i+1); if (i > 1) { i := 0; } } return; } procedure Pong () { if (x) { call {:async} Pong (); x := false; } return; } procedure Main () { x := false; i := 0; call {:async} Ping (); call {:async} Pong (); return; }