
use int.Int

val randomb () : bool

val id (input:bool) (src: int) (ref tgt: int) : unit
writes { tgt }
ensures { (input = True /\ tgt = src) \/ (input = False /\ tgt = old tgt) }

val ref d0 : int
val ref d1 : int

let s [@bddinfer] ()
  diverges
  requires { d0 = 0 }
  requires { d1 = 0 }
  =
  (* gives d1 in [0], that's OK (see precision1.mlw)  *)
  while true do
     id (randomb()) d0 d1;
  done
