(*************************************)
(* the automation of the PtUn lemmas *)
(*************************************)
(* First, the mechanism for search-and-replace for the overloaded lemas, *)
(* pattern-matching on heap expressions.                                 *)
Structure tagged_heap := Tag {untag :> heap}.
Definition right_tag := Tag.
Definition left_tag := right_tag.
Canonical found_tag i := left_tag i.
Definition partition_axiom k r (h : tagged_heap) := untag h = k \+ r.
Structure partition (k r : heap) :=
Partition {heap_of :> tagged_heap;
_ : partition_axiom k r heap_of}.

Lemma llist_null A (xs : seq A) h :
valid h -> llist null xs h -> xs = [::] /\ h = Unit.