From mathcomp.ssreflect
From mathcomp
From fcsl
From DiSeL
Require Classical_Prop.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
(* "Atomic" send/receive actions, coherent with the network semantics *)
Module Actions.
Section Actions.
Variable W : world.
Notation getS s l := (getStatelet s l).
(*  Action is defined with respect to the world (i.e., a number of protocols) and label.  It changes the state as a whole, but, in fact, affects only a specific statelet in it, associated with a specific label.   *)
Structure action (V : Type) (this : nid)
:= Action
{
(* a_lab : Label; *)
(* a_lab_dom : a_lab \in ddom W; *)
a_safe : state -> Prop;
a_safe_coh : forall s, a_safe s -> s \In Coh W;
(* safe_coh : forall s, a_safe s -> coh (getP a_lab) (getS s a_lab); *)
a_step : forall s1, (a_safe s1) -> state -> V -> Prop;
step_total : forall s (pf : a_safe s), exists s' r, a_step pf s' r;
(* step_coh  : forall s1 s2 r, Coh W s1 -> *)
(*     a_safe s1 -> a_step s1 s2 r -> coh (getP a_lab) (getS s2 a_lab); *)
(* step_frame : forall s1 s2 r z, *)
(*     a_lab != z -> Coh W s1 -> *)
(*     a_safe s1 -> a_step s1 s2 r -> getS s1 z  = getS s2 z; *)
(* Action step semantics respects the overall network semantics *)
step_sem  : forall s1 (pf : a_safe s1) s2 r,
a_step pf s2 r -> network_step W this s1 s2
}.

(* Framing follows from the network semantics *)
Lemma step_other this V (a : action V this) l s1 s2 r n (pf : a_safe a s1):
this != n -> a_step pf s2 r ->
getLocal n (getS s1 l) = getLocal n (getS s2 l).