Section Stack.
Variable T : Set.
Record node : Set := Node {
data : T;
next : option ptr
}.
Fixpoint listRep (ls : list T) (hd : option ptr) {struct ls} : hprop :=
match ls with
| nil => [hd = None]
| h :: t =>
match hd with
| None => [False]
| Some hd' => Exists p :@ option ptr, hd' ---> Node h p * listRep t p
end
end%hprop.
Definition stack := ptr.
Definition rep q ls := (Exists po :@ option ptr, q ---> po * listRep ls po)%hprop.
Definition isExistential T (x : T) := True.

Theorem himp_ex_conc_trivial : forall T p p1 p2,
p ==> p1 * p2
-> T
-> p ==> hprop_ex (fun _ : T => p1) * p2.