(* Verifying function bodies and entire programs *)
Definition verify_prog (t:terminationMeasure) (G:pred world) (psi:program K.assert) (G':pred world) :=
forall n r,
agedfrom (K.squash (n,psi),(r,t)) && |>(box K.expandM (closed G))
|-- box K.expandM (closed G').

Lemma end_assert_lemma : forall Q t n p p' r r' stk,
stepN n t p p' r (stk++(instr_assert Q ;; instr_return ;; instr_nil _) :: nil) r' nil ->
stepstar t p p' r (stk++(instr_return ;; instr_nil _) :: nil) r' nil /\ proj1_sig Q (p',(r',t)).