Local Open Scope logic.
Instance CompSpecs : compspecs.
(* a list initialized with 0 except its last i elements *)
Definition list_zero_except (i : Z) (size : Z) : list val :=
(list_repeat (Z.to_nat (size-i)) (Vint Int.zero)) ++ (list_repeat (Z.to_nat i) Vundef).

(* TODO add to library *)
(* TODO generalize: special case of (replace 0 by m) *)
Lemma Z_repr_0_unsigned: forall n,
0 <= n <= Int.max_unsigned ->
Int.repr n = Int.zero ->
n = 0.