Definition input := seq nat.(* All nodes *)
Notation nodes := (cs ++ cls).(* Protocol:

- "Clients" can send messages with requests as long as the request
  satisfies the precondition prec.

- "Clients" can receive messages from "servers" (i.e., calculators).

- "Servers" can receive messages as long as they satisfy the
  precondition and record the sender and the arguments in the
  permission list.

- "Servers" can respond to clients accordingly, given that the result
  satisfies the arguments.

*)


(* Defining state-space *)

(* Calculator server state *)
Definition st := ptr_nat 1.(* 
Calculator state: 
  - client node id
  - server node id
  - client-provided id (e.g., hash of the input)
  - client input
*)

Definition perm := (nid * nat * (seq nat))%type.Definition cstate := seq perm.(* Tags *)
Definition req : nat := 0.Definition resp : nat := 1.

Lemma l1 d: calcoh d -> valid (dstate d).