Program Definition greet2 n to : greeter_spec2 n to :=
Do (r <-- greet to;
greet to).
Next Obligation.
move=>i/=[H1 H2].
(* Switch to the continuation *)
apply: step.
apply: (gh_ex (g := n)); apply: call_rule=>//.
move=>? j[Hcount Hhead _] Cj.
apply: (gh_ex (g := n.+1)); apply: call_rule=>//.
by move=>r m[X1 X2 _].
Qed.
End GreeterPrograms.
Section CombineGreeters.
Variables (l1 l2 : Label) (nodes : seq nid) (this : nid).
Variable (lab_disj : l2 != l1).
Definition gp1 := GreeterProtocol nodes l1.
Definition gp2 := GreeterProtocol nodes l2.
Definition V := (W l1 nodes) \+ (W l2 nodes).

(* Specifications: *)
Lemma validV : valid V.
Notation loc i k := (getLocal this (getStatelet i k)).