End DETERM_SEM.
(** * Integrating an external world in a semantics. *)
(** Given a transition semantics, we can build another semantics that integrates an external world in its state and allows only world-possible transitions. *)
Section WORLD_SEM.
Variable L: semantics.
Variable initial_world: world.
Notation "s #1" := (fst s) (at level 9, format "s '#1'") : pair_scope.
Notation "s #2" := (snd s) (at level 9, format "s '#2'") : pair_scope.
Local Open Scope pair_scope.
Definition world_sem : semantics := @Semantics_gen
(state L * world)%type
(genvtype L)
(fun ge s t s' => step L ge s#1 t s'#1 /\ possible_trace s#2 t s'#2)
(fun s => initial_state L s#1 /\ s#2 = initial_world)
(fun s r => final_state L s#1 r)
(globalenv L)
(symbolenv L).
(** If the original semantics is determinate, the world-aware semantics is deterministic. *)
Hypothesis D: determinate L.

Theorem world_sem_deterministic: sem_deterministic world_sem.
End WORLD_SEM.