Definition address : Type := (block * Z)%type.
Instance EqDec_block: EqDec block := eq_block.
Instance EqDec_address: EqDec address.
Instance EqDec_int: EqDec int := Int.eq_dec.
Instance EqDec_float: EqDec float := Float.eq_dec.
Instance EqDec_val: EqDec val.
Definition adr_range (base: address) (size: Z) (loc: address) : Prop :=
match base, loc with
| (b, ofs) , (b', ofs') => b=b' /\ (ofs <= ofs' < ofs + size)
end.
(* Definition size_chunk (chunk: memory_chunk) : Z := match chunk with | Mint8signed => 1 | Mint8unsigned => 1 | Mint16signed => 2 | Mint16unsigned => 2 | Mint32 => 4 | Mfloat32 => 4 | Mfloat64 => 8 | Mfloat64al32 => 4 end. *)
Remark size_chunk_pos:
forall chunk1, size_chunk chunk1 > 0.
Hint Resolve zero_in_chunk : mem.
Definition range_overlap (base1: address) (sz1: Z) (base2: address) (sz2: Z) : Prop :=
exists loc, adr_range base1 sz1 loc /\ adr_range base2 sz2 loc.
Definition adr_add (loc: address) (ofs: Z) : address := (fst loc, snd loc + ofs).
Definition val2adr (v: val) (l: address) : Prop :=
(*     match v with Vptr b ofs => l = (b, Int.unsigned ofs) | _ => False end.*)
match v with Vptr b ofs => l = (b, Ptrofs.unsigned ofs) | _ => False end.

Lemma adr_range_S_split: forall bl ofs n l, adr_range (bl, ofs) (Z.of_nat (S n)) l -> adr_range (bl, ofs + 1) (Z.of_nat n) l \/ l = (bl, ofs).