Section SIMULATION_SEQUENCES.
Context L1 L2 index order match_states (S: fsim_properties L1 L2 index order match_states).
End SIMULATION_SEQUENCES.
(** ** Composing two forward simulations *)
Ltac supertransitivity:=
repeat match goal with
|[|- ?x = ?y] =>
match goal with
| [|- x = x] => reflexivity
| [ H: x = _ |- _ ] => rewrite H in *; clear H
| [ H: _ = x |- _ ] => rewrite H in *; clear H
end
end.
(** * Receptiveness and determinacy *)
Definition single_events (L: semantics) : Prop :=
forall s t s', Step L s t s' -> (length t <= 1)%nat.
Record receptive (L: semantics) : Prop :=
Receptive {
sr_receptive: forall s t1 s1 t2,
Step L s t1 s1 -> match_traces (symbolenv L) t1 t2 -> exists s2, Step L s t2 s2;
sr_traces:
single_events L
}.
Record determinate (L: semantics) : Prop :=
Determinate {
sd_determ: forall s t1 s1 t2 s2,
Step L s t1 s1 -> Step L s t2 s2 ->
match_traces (symbolenv L) t1 t2 /\ (t1 = t2 -> s1 = s2);
sd_traces:
single_events L;
sd_initial_determ: forall s1 s2 f arg m0,
entry_point L m0 s1 f arg -> entry_point L m0 s2 f arg ->
s1 = s2;
sd_final_nostep: forall s r,
final_state L s r -> Nostep L s;
sd_final_determ: forall s r1 r2,
final_state L s r1 -> final_state L s r2 -> r1 = r2
}.

Lemma sd_initial_state_determ:
forall L, determinate L ->
forall s1 s2, initial_state L s1 -> initial_state L s2 ->
s1 = s2.