End FORWARD_TRACE.
Module ForwardTrace (F: FORWARD) <: FORWARD_TRACE with Module F := F.
Module F := F.
Export F.
Definition forward_trace {state: Type} {state_R: Relation state}: traces state :=
fun tr => is_fin_stream tr /\ forall n s ms, tr n = Some (s, ms) -> forward (Terminating s) ms.
Definition forward_trace_with_test {state: Type} {state_R: Relation state} (P: state -> Prop) : traces state :=
fun tr => forward_trace tr /\ exists s, begin_state tr s /\ P s.

(* Specifications: *)
Lemma singleton_trace_forward {state: Type} {state_R: Relation state}: forall s ms,
F.forward (Terminating s) ms ->
forward_trace (singleton_trace s ms).
Lemma singleton_trace_forward_test {state: Type} {state_R: Relation state}: forall (P: _ -> Prop) s ms,
F.forward (Terminating s) ms ->
P s ->
forward_trace_with_test P (singleton_trace s ms).