(* Fundamental liveness theorem.  A verified function, when started in a state satisfying its precondition, will halt in a state satisfying its postcondition. *)

(* Weaker corallary: a program with a safe entry point will eventually halt. *)
Corollary verify_halts : forall t G psi l,
verify_prog t G psi G ->
G |-- funptr l unit (fun _ => TT) (fun _ => TT) ->
forall r, exists n,
eventually_halts t (K.squash (n,psi)) r
((instr_getlabel l (L 0) ;; instr_call (L 0) ;; instr_return ;; instr_nil _)::nil).