Definition ptr_ordMixin := OrdMixin ltn_ptr_irr ltn_ptr_trans ltn_ptr_total.Canonical ptr_ordType := OrdType ptr ptr_ordMixin.Inductive heap := 
  Undef | Def (finmap : {finMap ptr -> dynamic id}) of 
               null \notin supp finmap.Inductive heap := 
  Undef | Def (finmap : {finMap ptr -> dynamic id}) of 
               null \notin supp finmap.Inductive heap := 
  Undef | Def (finmap : {finMap ptr -> dynamic id}) of 
               null \notin supp finmap.

Lemma heapE (h1 h2 : heap) : h1 = h2 <-> match h1, h2 with Def f' pf, Def g' pg => f' = g' | Undef, Undef => true | _, _ => false end.