(* poset structure on ST *)

(* Specifications: *)
Lemma st_refl e : st_leq e e.
Lemma st_trans e1 e2 e3 : st_leq e1 e2 -> st_leq e2 e3 -> st_leq e1 e3.
Definition st_bot' := bot : [poset of prog A s.1].
Lemma st_bot_coherent : coherent st_bot'.
Lemma st_sup_dstrict u : def_strict (st_sup' u).
Lemma st_sup_has_spec u : st_sup' u \In has_spec s.
Definition st_sup u :=
STprog (@st_sup_coherent u) (@st_sup_dstrict u) (@st_sup_has_spec u).
Lemma st_supP (u : Pred ST) e : e \In u -> st_leq e (st_sup u).
Lemma def_runs i y m (e : ST) :
(i, y, m) \In runs_of (model e) -> [/\ def i, i \In s.1 & def m].
Lemma spec_runs i y m (e : ST) :
(i, y, m) \In runs_of (model e) -> s.2 y i m.
Lemma ret_dstrict : def_strict ret_sp.
Lemma throw_dstrict : def_strict throw_sp.
Lemma bind_dstrict : def_strict bind_sp.
Lemma bind_has_spec : bind_sp \In has_spec bind_s.
Definition bind := STprog bind_coherent bind_dstrict bind_has_spec.