(************************************************************)
Definition coord_msg tag (from to : nid) : bool :=
[&& from == cn, to \in pts & tagFromCoordinator tag].
Definition participant_msg tag (from to : nid) : bool :=
[&& from \in pts, to == cn & tagFromParticipant tag].
Definition internal_msg (tag : nat) (from to : nid) : bool :=
coord_msg tag from to || participant_msg tag from to.

(* Specifications: *)
Lemma internal_msg_tagFromParticipant_to_cn tag from to :
internal_msg tag from to ->
tagFromParticipant tag ->
to == cn.
Lemma internal_msg_tagFromParticipant_from_pts tag from to :
internal_msg tag from to ->
tagFromParticipant tag ->
from \in pts.
Lemma internal_msg_tagFromCoordinator_to_pts tag from to :
internal_msg tag from to ->
tagFromCoordinator tag ->
to \in pts.
Lemma internal_msg_tagFromCoordinator_from_cn tag from to :
internal_msg tag from to ->
tagFromCoordinator tag ->
from == cn.
Lemma internal_msg_to_cn tag from :
internal_msg tag from cn ->
participant_msg tag from cn.
Lemma inv_msg_round d (C : coh d) i tag m from to round cs :
find i (dsoup d) =
Some {| content := {| tag := tag; tms_cont := m |};
from := from;
to := to;
active := true |} ->
internal_msg tag from to ->
Inv d ->
getStC C = (round, cs) ->
head 0 m == round.