Section ReceiveInvWrapper.
Variable rt : receive_trans coh.
Definition receive_stepI: receive_step_t CohI :=
fun this from m d C pf => receive_step rt from m (proj1 C) pf.
Definition R_inv := forall d from this i (C : coh d) m
(pf: this \in nodes p d),
I d (nodes p d) ->
find i (dsoup d) = Some (Msg m from this true) ->
this \in dom (dstate d) ->
msg_wf rt C this from m -> tag m = t_rcv rt ->
let: loc' := receive_step rt from m C pf in
let: s'' := consume_msg (dsoup d) i in
let: f' := upd this loc' (dstate d) in
let: d' := (DStatelet f' s'') in
(forall z, z == this = false -> getLocal z d' = getLocal z d) ->
I d' (nodes p d').
Hypothesis HIstep : R_inv.
Notation msg_wfI := (fun d (C : CohI d) => msg_wf rt (proj1 C)).
Definition rcv_transI := @ReceiveTrans _ CohI _ msg_wfI _ r_step_cohI.
End ReceiveInvWrapper.
(* The client has to provide instances of the following two structures along with the proofs of Hs and Hr. *)
Structure SendInv := SI {
st : send_trans coh;
st_inv : S_inv st;
}.
Structure ReceiveInv := RI {
rt : receive_trans coh;
rt_inv : R_inv rt;
}.
Structure InductiveInv := II {
sts : seq SendInv;
rts : seq ReceiveInv;
_ : map st sts = snd_trans p;
_ : map rt rts = rcv_trans p
}.
(* Obtain new send/receive transitions *)
Definition stsI sts := map (fun stt =>
@snd_transI (st stt) (@st_inv stt)) sts.
Definition rtsI rts := map (fun rtt =>
@rcv_transI (rt rtt) (@rt_inv rtt)) rts.
Variable ii : InductiveInv.

Lemma ur : uniq (map (@t_rcv _ _) (rtsI (rts ii))).