Set Implicit Arguments.
Class LabeledMultiParams (P : BaseParams) :=
{
lb_name : Type ;
lb_msg : Type ;
lb_msg_eq_dec : forall x y : lb_msg, {x = y} + {x <> y} ;
lb_name_eq_dec : forall x y : lb_name, {x = y} + {x <> y} ;
lb_nodes : list lb_name ;
lb_all_names_nodes : forall n, In n lb_nodes ;
lb_no_dup_nodes : NoDup lb_nodes ;
label : Type ;
label_silent : label ;
lb_init_handlers : lb_name -> data ;
lb_net_handlers : lb_name -> lb_name -> lb_msg -> data -> label * (list output) * data * list (lb_name * lb_msg) ;
lb_input_handlers : lb_name -> input -> data -> label * (list output) * data * list (lb_name * lb_msg)
}.
Section UnlabeledParams.
Context {base_params : BaseParams}.
Context {labeled_multi_params : LabeledMultiParams base_params}.
Definition unlabeled_net_handlers me src m st :=
let '(lb, out, st', ps) := lb_net_handlers me src m st in (out, st', ps).
Definition unlabeled_input_handlers me inp st :=
let '(lb, out, st', ps) := lb_input_handlers me inp st in (out, st', ps).
Global Instance unlabeled_multi_params : MultiParams base_params :=
{
name := lb_name ;
msg := lb_msg ;
msg_eq_dec := lb_msg_eq_dec ;
name_eq_dec := lb_name_eq_dec ;
nodes := lb_nodes ;
all_names_nodes := lb_all_names_nodes ;
no_dup_nodes := lb_no_dup_nodes ;
init_handlers := lb_init_handlers;
net_handlers := unlabeled_net_handlers ;
input_handlers := unlabeled_input_handlers
}.
End UnlabeledParams.
Section LabeledStepExecution.
Variable A : Type.
Variable L : Type.
Variable trace : Type.
Definition lb_step_relation := A -> L -> A -> list trace -> Prop.
Definition lb_step_ex (step : lb_step_relation) (l : L) (a : A) : Prop :=
exists a' tr, step a l a' tr.
Record event := { evt_a : A ; evt_l : L ; evt_trace : list trace }.
Definition enabled (step : lb_step_relation) (l : L) (e : event) : Prop :=
lb_step_ex step l (evt_a e).
Definition occurred (l : L) (e : event) : Prop := l = evt_l e.
Definition inf_enabled (step : lb_step_relation) (l : L) (s : infseq event) : Prop :=
inf_often (now (enabled step l)) s.
Definition cont_enabled (step : lb_step_relation) (l : L) (s : infseq event) : Prop :=
continuously (now (enabled step l)) s.
Definition inf_occurred (l : L) (s : infseq event) : Prop :=
inf_often (now (occurred l)) s.
Definition strong_fairness (step : lb_step_relation) (silent : L) (s : infseq event) : Prop :=
forall l : L, l <> silent -> inf_enabled step l s -> inf_occurred l s.
Definition weak_fairness (step : lb_step_relation) (silent : L) (s : infseq event) : Prop :=
forall l : L, l <> silent -> cont_enabled step l s -> inf_occurred l s.

Lemma strong_fairness_invar :
forall step e silent s, strong_fairness step silent (Cons e s) -> strong_fairness step silent s.