End EvalDeallocR.
Class Find1 (h k : heap) :=
{ rest1 : heap; heq1 : h = k :+ rest1}.
Program
Instance ffound_struct1 k : Find1 k k | 1 := {| rest1 := empty|}.
Next Obligation. by rewrite unh0. Qed.
Program
Instance fleft_struct1 l r k (f : Find1 l k) :
Find1 (l :+ r) k | 2 := {| rest1 := rest1 :+ r |}.
Next Obligation. by rewrite unA -heq1.  Qed.
Program
Instance fright_struct1 l r k (f : Find1 r k) :
Find1 (l :+ r) k | 2 := {| rest1 :=  l :+ rest1 |}.
Next Obligation. by rewrite unCA -heq1. Qed.
Section EvalDoR.
Variables (A B : Type).

(* Specifications: *)
Lemma val_doR (s : spec A) h i (r : cont A) (f : Find1 h i) :
s.1 i ->
(forall x m,
s.2 (Val x) i m -> def (m :+ rest1) -> r (Val x) (m :+ rest1)) ->
(forall e m,
s.2 (Exn e) i m -> def (m :+ rest1) -> r (Exn e) (m :+ rest1)) ->
verify s h r.