Local Notation cont A := (ans A -> heap -> Prop).
Section EvalDo.
Variables (A B : Type).

(* Specifications: *)
Lemma val_do (s : spec A) i j (r : cont A) :
s.1 i ->
(forall x m, s.2 (Val x) i m -> def (m :+ j) -> r (Val x) (m :+ j)) ->
(forall e m, s.2 (Exn e) i m -> def (m :+ j) -> r (Exn e) (m :+ j)) ->
verify s (i :+ j) r.
Lemma try_do (s : spec A) s1 s2 i j (r : cont B) :
s.1 i ->
(forall x m, s.2 (Val x) i m -> verify (s1 x) (m :+ j) r) ->
(forall e m, s.2 (Exn e) i m -> verify (s2 e) (m :+ j) r) ->
verify (try_s s s1 s2) (i :+ j) r.
Lemma bnd_do (s : spec A) s2 i j (r : cont B) :
s.1 i ->
(forall x m, s.2 (Val x) i m -> verify (s2 x) (m :+ j) r) ->
(forall e m, s.2 (Exn e) i m -> def (m :+ j) -> r (Exn e) (m :+ j)) ->
verify (bind_s s s2) (i :+ j) r.