(** ** Backward simulation diagrams. *)
(** Various simulation diagrams that imply backward simulation. *)
Section BACKWARD_SIMU_DIAGRAMS.
Variable L1: semantics.
Variable L2: semantics.
Hypothesis public_preserved:
forall id, Senv.public_symbol (symbolenv L2) id = Senv.public_symbol (symbolenv L1) id.
Variable match_states: state L1 -> state L2 -> Prop.
Hypothesis start_stacks_exist:
forall s1 f arg m0, start_stack L1 m0 s1 f arg ->
exists s2, start_stack L2 m0 s2 f arg.
Hypothesis initial_states_exist:
forall s1, initial_state L1 s1 ->
exists s2, initial_state L2 s2.
Hypothesis match_start_stacks:
forall s1 s2 f arg m0, start_stack L1 m0 s1 f arg  ->
start_stack L2 m0 s2 f arg  ->
exists s1', start_stack L1 m0 s1' f arg /\ match_states s1' s2.
Hypothesis match_initial_state:
forall s1 s2, initial_state L1 s1  ->
initial_state L2 s2  ->
exists s1', initial_state L1 s1' /\ match_states s1' s2.
Hypothesis match_final_states:
forall s1 s2 r,
match_states s1 s2 -> final_state L2 s2 r -> final_state L1 s1 r.
Hypothesis progress:
forall s1 s2,
match_states s1 s2 -> safe L1 s1 ->
(exists r, final_state L2 s2 r) \/
(exists t, exists s2', Step L2 s2 t s2').
Section BACKWARD_SIMULATION_PLUS.
Hypothesis simulation:
forall s2 t s2', Step L2 s2 t s2' ->
forall s1, match_states s1 s2 -> safe L1 s1 ->
exists s1', Plus L1 s1 t s1' /\ match_states s1' s2'.

Lemma backward_simulation_plus: backward_simulation L1 L2.
End BACKWARD_SIMULATION_PLUS.