module M

use int.Int
use ref.Ref

val x : ref int

val f () : unit writes {x} ensures { !x = 1 - old !x }

let p () =
  label Init in
  let _t = () in ();
  (f ());
  (f ());
  assert { !x = !x at Init };
  ()

end
