Inductive InternalOrExternal: MachState -> mem -> MachState -> mem -> Prop:=
  | IsInternal st st' m m':
      internal_step (fst (fst st)) (snd st) m (snd st') m'  ->
      InternalOrExternal st m st' m'
  | IsExternal st st' m m':
      external_step (fst (fst st)) (snd (fst st)) (snd st) m (fst (fst st')) (snd (fst st')) (snd st') m'  ->
      InternalOrExternal st m st' m'.Inductive InternalOrExternal: MachState -> mem -> MachState -> mem -> Prop:=
  | IsInternal st st' m m':
      internal_step (fst (fst st)) (snd st) m (snd st') m'  ->
      InternalOrExternal st m st' m'
  | IsExternal st st' m m':
      external_step (fst (fst st)) (snd (fst st)) (snd st) m (fst (fst st')) (snd (fst st')) (snd st') m'  ->
      InternalOrExternal st m st' m'.Inductive InternalOrExternal: MachState -> mem -> MachState -> mem -> Prop:=
  | IsInternal st st' m m':
      internal_step (fst (fst st)) (snd st) m (snd st') m'  ->
      InternalOrExternal st m st' m'
  | IsExternal st st' m m':
      external_step (fst (fst st)) (snd (fst st)) (snd st) m (fst (fst st')) (snd (fst st')) (snd st') m'  ->
      InternalOrExternal st m st' m'.

(* Specifications: *)
Lemma step_InternalOrExternal: forall st m st' m', MachStep st m st' m' -> InternalOrExternal st m st' m'.
Lemma safety_equivalence21: forall st m tr, (forall U, valid (tr, st, m) U -> safe_kstep (U, tr, st) m) -> forall U, valid (tr, st, m) U -> explicit_safety U tr st m.
Lemma safety_equivalence22: forall st m tr, (forall U, valid (tr, st, m) U -> explicit_safety U tr st m) -> (forall U, valid (tr, st, m) U -> safe_kstep (U, tr, st) m).
Lemma safety_equivalence2: forall st m tr, (forall U, valid (tr, st, m) U -> safe_kstep (U, tr, st) m) <-> (forall U, valid (tr, st, m) U -> explicit_safety U tr st m).
Lemma finite_state_preservation: forall P0 P' : SST kstate, konig.finite P0 -> SST_step kstate schedule kstep valid P0 P' -> konig.finite P'.
Lemma csafe_safety_trick: forall tr tp m, (forall U : schedule, valid (tr, tp,m) U) -> (forall (n : nat) U, csafe (U, tr, tp) m n) -> forall U : schedule, safe kstate schedule kstep valid (tr,tp,m) U.
Lemma csafe_safety: forall tr tp m, (forall (n : nat) U, valid (tr, tp,m) U -> csafe (U, tr, tp) m n) -> forall U : schedule, valid (tr, tp,m) U -> safe kstate schedule kstep valid (tr,tp,m) U.
Lemma safety_csafe_trick: forall tr tp m, (forall U : schedule, valid (tr, tp,m) U) -> (forall U : schedule, safe kstate schedule kstep valid (tr,tp,m) U) -> (forall (n : nat) U, csafe (U, tr, tp) m n).
Lemma safety_csafe: forall tr tp m, (forall U : schedule, valid (tr, tp,m) U -> safe kstate schedule kstep valid (tr,tp,m) U) -> (forall (n : nat) U, valid (tr, tp,m) U -> csafe (U, tr, tp) m n).
Lemma csafe_explicit_safety: forall tr tp m, (forall (n : nat) U, valid (tr, tp,m) U -> csafe (U, tr, tp) m n) -> forall U, valid (tr, tp,m) U -> explicit_safety U tr tp m.
Lemma explicit_safety_csafe: forall tr tp m, (forall U : schedule, valid (tr, tp,m) U -> explicit_safety U tr tp m) -> (forall (n : nat) U, valid (tr, tp,m) U -> csafe (U, tr, tp) m n).
Lemma csafe_explicit_safety': forall tr tp m, (forall U : schedule, valid (tr, tp,m) U) -> (forall (n : nat) U, csafe (U, tr, tp) m n) -> forall U : schedule, explicit_safety U tr tp m.
Lemma explicit_safety_csafe': forall tr tp m, (forall U : schedule, valid (tr, tp,m) U) -> (forall U : schedule, explicit_safety U tr tp m) -> (forall (n : nat) U, csafe (U, tr, tp) m n).