Proof using.
apply true_in_reachable_reqs;
unfold sequence_equality; simpl in *; intuition.
match goal with
H : reachable _ _ _ |- _ =>
apply reachable_sane in H
end.
unfold sequence_sane, sequence_equality in *.
intros.
match goal with H : step_dup _ _ _ |- _ => invcs H end; simpl in *; find_inversion.
- unfold seq_num_net_handlers in *.
repeat do_in_app.
repeat find_rewrite.
repeat break_match; find_inversion; simpl in *; intuition;
repeat do_in_map; subst; simpl in *.
+ repeat do_in_app. intuition.
+ find_inversion.
match goal with
| x : prod _ _, x' : prod _ _ |- _ =>
replace x with x' by (eapply processPackets_seq_eq; eauto)
end; auto.
+ match goal with H : processPackets _ _ = _ |- _ =>
eapply processPackets_ge_start in H
end; eauto.
match goal with
_ : In ?p _, H : forall _ : packet, In _ _ -> _ |- _ =>
specialize (H p); forward H; [in_crush|]; [concludes]
end. simpl in *. repeat find_rewrite. omega.
+ find_inversion.
match goal with H : processPackets _ _ = _ |- _ =>
eapply processPackets_ge_start in H
end; eauto.
match goal with
_ : In ?p _, H : forall _ : packet, In _ _ -> _ |- _ =>
specialize (H p); forward H; [in_crush|]; [concludes]
end. simpl in *. repeat find_rewrite. omega.
+ match goal with
H : forall _ _ : packet, In _ _ -> _ |- ?p = ?p' =>
specialize (H p p'); repeat (forward H; [in_crush|]; concludes)
end; auto.
- unfold seq_num_input_handlers in *.
repeat do_in_app.
repeat break_match; find_inversion; simpl in *; intuition;
repeat do_in_map; subst; simpl in *.
+ find_inversion.
match goal with
| x : prod _ _, x' : prod _ _ |- _ =>
replace x with x' by (eapply processPackets_seq_eq; eauto)
end; auto.
+ match goal with H : processPackets _ _ = _ |- _ =>
eapply processPackets_ge_start in H
end; eauto.
match goal with
_ : In ?p _, H : forall _ : packet, In _ _ -> _ |- _ =>
specialize (H p); forward H; [in_crush|]; [concludes]
end. simpl in *. repeat find_rewrite. omega.
+ find_inversion.
match goal with H : processPackets _ _ = _ |- _ =>
eapply processPackets_ge_start in H
end; eauto.
match goal with
_ : In ?p _, H : forall _ : packet, In _ _ -> _ |- _ =>
specialize (H p); forward H; [in_crush|]; [concludes]
end. simpl in *. repeat find_rewrite. omega.
- repeat find_rewrite. in_crush.
Qed.

(* Specifications: *)
Lemma revertNetwork_In :
forall net (p : seq_num_packet),
In p (nwPackets net) ->
~ In (tmNum (pBody p)) (assoc_default name_eq_dec (tdSeen (nwState net (pDst p))) (pSrc p) []) ->
In (revertPacket p) (nwPackets (revertNetwork net)).