Definition getBlocks (V:list val) (b: block): bool :=
in_dec eq_block b
(fold_right (fun v L => match v with Vptr b' z => b'::L | _ => L end) nil V).

(* Specifications: *)
Lemma getBlocksD: forall v V b,
getBlocks (v:: V) b =
match v with
Vptr b' _  => orb (eq_block b' b) (getBlocks V b)
| _ => getBlocks V b
end.
Lemma getBlocksD_nil: forall b,
getBlocks nil b = false.
Lemma getBlocks_char: forall V b, getBlocks V b = true <->
exists off, In (Vptr b off) V.
Lemma getBlocks_inject: forall j vals1 vals2
(ValInjMu : Forall2 (val_inject j) vals1 vals2)
b (B: getBlocks vals1 b = true),
exists jb d, j b = Some (jb, d) /\ getBlocks vals2 jb = true.
Lemma getBlocksD: forall v V b,
getBlocks (v:: V) b =
match v with
Vptr b' _  => orb (eq_block b' b) (getBlocks V b)
| _ => getBlocks V b
end.
Lemma getBlocksD_nil: forall b,
getBlocks nil b = false.
Lemma getBlocks_char: forall V b, getBlocks V b = true <->
exists off, In (Vptr b off) V.
Lemma getBlocks_inject: forall j vals1 vals2
(ValInjMu : Forall2 (val_inject j) vals1 vals2)
b (B: getBlocks vals1 b = true),
exists jb d, j b = Some (jb, d) /\ getBlocks vals2 jb = true.