(* Pre/poscondition and  *)
Definition pre := state -> Prop.
(* Postconditions are binary *)
Definition post A := state -> A -> state -> Prop.
Definition cont A := A -> state -> Prop.
Definition spec A := prod pre (post A).
(* What does it mean for a program to have a specification s *)
Definition has_spec (s : spec A) :=
[Pred T : prog W A this | forall i t,
s.1 i -> i \In Coh W -> t \In T -> after i t (s.2 i)].
End Programs.
Module DTbin.
Section DTbin.
Variable this : nid.
Structure DTbin (W : world) A (s : spec A) := DTbin_make {
prog_of : prog W A this;
_ : prog_of \In has_spec this W s}.
End DTbin.
End DTbin.
Notation DTbin := DTbin.DTbin.
Notation DTbin_make := DTbin.DTbin_make.
Coercion DTbin.prog_of : DTbin >-> prog.
Section Specs.
Variable this : nid.

(* Specifications: *)
Lemma stsepE (W : world) A (s : spec A) (e1 e2 : DTbin this W s) :
e1 = e2 <-> e1 = e2 :> prog W A this.
(* Unfinished satisfies any specification *)
Lemma prog_unfin (W : world) A (s : spec A) (e : DTbin this W s) :
Unfinished \In DTbin.prog_of e.