
use int.Int

type t = { mutable c : int }

let f () =
  let x1 = { c = 0 } in
  let x2 = { c = 0 } in
  for i = 0 to 1 do
    invariant { i > 0 -> x1.c = 1 }
    if i = 0 then
      x1.c <- x1.c + 1
    else
      x2.c <- x2.c + 1
  done


(*
counterexamle: `x1 = -1`, `i = 0` at the beggining of the loop.

The execution of `f` with the counterexample:
- terminates normally if executed concretly;
- terminates in error if executed abstractly (invariant preservation
  fails)

It is a real counterexample due to underspecification (weak loop
invariant).
*)
