End SendBase.
(*  Defined the send-transition of the greeter  *)
Definition greeter_send_trans :=
SendTrans greet_safe_coh greet_safe_in greet_safe_def greet_step_coh.
End GreeterSend.
Variable l : Label.
(* Defining the protocol *)
Program Definition GreeterProt : protocol :=
@Protocol _ l _ [:: greeter_send_trans] [::] _ _.
End GreeterProtocol.
Module Exports.
Section Exports.
Definition getN := getN.
Definition getNK := getNK.
Definition GreeterProtocol := GreeterProt.
Definition gsend := greeter_send_trans.
Definition hello := hello.
Definition counter := counter.
Definition greet_safe_coh := greet_safe_coh.
End Exports.
End Exports.
End GreeterProtocol.
Export GreeterProtocol.Exports.
Section GreeterPrograms.
Variable l : Label.
Variable nodes : seq nid.
Definition gp := GreeterProtocol nodes l.
(* Simplest world with one protocol *)
(* TODO: simplify this using canonicals *)
Definition W : world := (l \\-> gp, Unit).
Variable this : nid.

Lemma grEq : (getProtocol W l) = gp.
Definition greeter_spec2 n to :=
DHT [this, W]
(fun i => loc i = counter :-> n /\ to \in nodes,
fun r m =>
loc m = counter :-> n.+2 /\ head 0 r = n.+1).