Inductive estepstar : program X -> store -> list (instr X) -> store -> list (instr X) ->  Prop :=
  | estepstar_O: forall p s i, estepstar p s i s i
  | estepstar_S: forall p s i s' i' s'' i'',
              estep p s i s' i' ->
              estepstar p s' i' s'' i'' ->
              estepstar p s i s'' i''.Inductive estepstar : program X -> store -> list (instr X) -> store -> list (instr X) ->  Prop :=
  | estepstar_O: forall p s i, estepstar p s i s i
  | estepstar_S: forall p s i s' i' s'' i'',
              estep p s i s' i' ->
              estepstar p s' i' s'' i'' ->
              estepstar p s i s'' i''.Inductive estepstar : program X -> store -> list (instr X) -> store -> list (instr X) ->  Prop :=
  | estepstar_O: forall p s i, estepstar p s i s i
  | estepstar_S: forall p s i s' i' s'' i'',
              estep p s i s' i' ->
              estepstar p s' i' s'' i'' ->
              estepstar p s i s'' i''.Definition eventually_ehalts (p:program X) (r:store) (s:list (instr X)) : Prop :=
    exists r', estepstar p r s r' nil.Definition erase_instr : instruction -> instr X :=
    fmap_instr (fun _ => x).Definition erase_prog := map_fmap _ _ erase_instr.

(* Specifications: *)
Theorem erase_step : forall p p' n r r' s s', step (K.squash (n,p)) p' r s r' s' -> estep (erase_prog p) r (List.map erase_instr s) r' (List.map erase_instr s') /\ exists n', p' = K.squash (n',p).
Lemma erase_halt' : forall n p p' r r' s, stepstar (K.squash (n,p)) p' r s r' nil -> estepstar (erase_prog p) r (List.map erase_instr s) r' nil.
Theorem erase_halt : forall p n r s, eventually_halts (K.squash (n,p)) r s -> eventually_ehalts (erase_prog p) r (List.map erase_instr s).
Theorem erase_step : forall p p' n r r' s s', step (K.squash (n,p)) p' r s r' s' -> estep (erase_prog p) r (List.map erase_instr s) r' (List.map erase_instr s') /\ exists n', p' = K.squash (n',p).
Lemma erase_halt' : forall n p p' r r' s, stepstar (K.squash (n,p)) p' r s r' nil -> estepstar (erase_prog p) r (List.map erase_instr s) r' nil.
Theorem erase_halt : forall p n r s, eventually_halts (K.squash (n,p)) r s -> eventually_ehalts (erase_prog p) r (List.map erase_instr s).