Ltac packet_simpl :=
    first [do_in_map; subst; simpl in *;
           unfold add_ghost_msg in *;
           do_in_map; subst; simpl in *|subst; simpl in *].

Lemma sorted_entries_match_cons : forall l l' e, sorted (e :: l) -> entries_match l l' -> (~ exists e', eIndex e' = eIndex e /\ eTerm e' = eTerm e /\ In e' l') -> entries_match (e :: l) l'.