Fixpoint cur_perm (l: block * Z) (T: list mem_event): option permission :=
match T with
nil => None
| (mu :: R) =>
let popt := cur_perm l R in
match mu, l with
| (Read b ofs n bytes), (b',ofs') =>
pmax (if eq_block b b' && zle ofs ofs' && zlt ofs' (ofs+n)
then Some Readable else None) popt
| (Write b ofs bytes), (b',ofs') =>
pmax (if eq_block b b' && zle ofs ofs' && zlt ofs' (ofs+ Zlength bytes)
then Some Writable else None) popt
| (Alloc b lo hi), (b',ofs') =>  (*we don't add a constraint relating lo/hi/ofs*)
if eq_block b b' then None else popt
| (Free l), (b',ofs') =>
List.fold_right (fun tr qopt => match tr with (b,lo,hi) =>
if eq_block b b' && zle lo ofs' && zlt ofs' hi
then Some Freeable else qopt
end)
popt l
end
end.

Lemma po_None popt: Mem.perm_order'' popt None.