Proof using.
intros net failed tr H_st h d dsk H_reboot.
apply disk_correct_invariant with (h := h) in H_st.
unfold disk_correct in *.
break_exists. intuition.
simpl in *.
unfold do_log_reboot, channel_to_log, disk_to_channel in *. find_inversion.
simpl.
repeat match goal with
| H : nwdoDisk net h _ = Some _ |- _ => rewrite H
end.
unfold from_channel.
repeat rewrite IOStreamWriter.channel_wrap_unwrap in *.
rewrite serialize_deserialize_id_nil.
rewrite <- (app_nil_r (IOStreamWriter.unwrap _)).
match goal with
| H : IOStreamWriter.unwrap _ = IOStreamWriter.unwrap _ |- _ => rewrite H
end.
rewrite nat_serialize_deserialize_id.
rewrite (app_nil_end (IOStreamWriter.unwrap _)).
rewrite list_serialize_deserialize_id_rec.
find_rewrite.
reflexivity.
Qed.
Definition orig_packet := @packet _ orig_multi_params.
Definition orig_network := @network _ orig_multi_params.
Definition log_packet := @do_packet _ log_multi_params.
Definition log_network := @do_network _ log_multi_params.
Definition revertPacket (p : log_packet) : orig_packet :=
@mkPacket _ orig_multi_params (do_pSrc p) (do_pDst p) (do_pBody p).
Definition revertLogNetwork (net: log_network) : orig_network :=
mkNetwork (map revertPacket (nwdoPackets net)) (fun h => (log_data (nwdoState net h))).

(* Specifications: *)
Theorem log_step_failure_step :
forall net net' failed failed' tr tr',
@step_failure_disk_ops_star _ _ log_failure_params step_failure_disk_ops_init (failed, net) tr ->
@step_failure_disk_ops _ _ log_failure_params (failed, net) (failed', net') tr' ->
step_failure (failed, revertLogNetwork net) (failed', revertLogNetwork net') tr'.