Notation "'{{' m 'in' s 'at' id '}}'" := (find id s = Some m).Definition nid := nat.(* A particular statelet instance.
     The Label and the PCM are the parameters and are defined by the protocol.
     The lstate and dsop are subject of the evolution.
   *)
  Structure dstatelet  :=
    DStatelet {
        (* Not sure if it's the best way to represent information
           about kinds of messages in this particular dstatelet, but
           let's think of tags as of integers for now, so dTagToCont
           will map the tags to specific types. *)

        (* Local state for each node as a pair of heaps; first heap is
           real, second heap is a ghost one. Let's deal with this
           model for now before we figure out how to discharge
           equalities in a better way *)
        dstate     : lstate_type heap;
        dsoup      : soup
    }.(* A particular statelet instance.
     The Label and the PCM are the parameters and are defined by the protocol.
     The lstate and dsop are subject of the evolution.
   *)
  Structure dstatelet  :=
    DStatelet {
        (* Not sure if it's the best way to represent information
           about kinds of messages in this particular dstatelet, but
           let's think of tags as of integers for now, so dTagToCont
           will map the tags to specific types. *)

        (* Local state for each node as a pair of heaps; first heap is
           real, second heap is a ghost one. Let's deal with this
           model for now before we figure out how to discharge
           equalities in a better way *)
        dstate     : lstate_type heap;
        dsoup      : soup
    }.(* A particular statelet instance.
     The Label and the PCM are the parameters and are defined by the protocol.
     The lstate and dsop are subject of the evolution.
   *)
  Structure dstatelet  :=
    DStatelet {
        (* Not sure if it's the best way to represent information
           about kinds of messages in this particular dstatelet, but
           let's think of tags as of integers for now, so dTagToCont
           will map the tags to specific types. *)

        (* Local state for each node as a pair of heaps; first heap is
           real, second heap is a ghost one. Let's deal with this
           model for now before we figure out how to discharge
           equalities in a better way *)
        dstate     : lstate_type heap;
        dsoup      : soup
    }.(* A particular statelet instance.
     The Label and the PCM are the parameters and are defined by the protocol.
     The lstate and dsop are subject of the evolution.
   *)
  Structure dstatelet  :=
    DStatelet {
        (* Not sure if it's the best way to represent information
           about kinds of messages in this particular dstatelet, but
           let's think of tags as of integers for now, so dTagToCont
           will map the tags to specific types. *)

        (* Local state for each node as a pair of heaps; first heap is
           real, second heap is a ghost one. Let's deal with this
           model for now before we figure out how to discharge
           equalities in a better way *)
        dstate     : lstate_type heap;
        dsoup      : soup
    }.

(* Specifications: *)
Lemma valid_mt_soup : valid (dsoup empty_dstatelet).
Lemma valid_mt_state : valid (dstate empty_dstatelet).