Definition freeable_blocks: list (block * BinInt.Z * BinInt.Z) -> mpred :=
  fold_right (fun (bb: block*BinInt.Z * BinInt.Z) a => 
                        match bb with (b,lo,hi) => 
                                          sepcon (VALspec_range (hi-lo) Share.top (b,lo)) a
                        end)
                    emp.

Lemma perm_of_res_val : forall r, perm_of_res r = Some Freeable -> exists v pp, r = YES Share.top readable_share_top (VAL v) pp.