End IN_Q_EFFECT.
Section REDUCE_EFFECT.
Variable Message : Set.
Let Bag_of_message := Bag_of_Data Message.
Variable f : Message -> Z.

(* Specifications: *)
Lemma reduce_post_message :
forall (m : Message) (s1 s2 : Site) (b : Bag_of_message),
reduce Message f (Post_message Message m b s1 s2 s1 s2) =
(reduce Message f (b s1 s2) + f m)%Z.
Lemma reduce_collect_message :
forall (m : Message) (s1 s2 : Site) (b : Bag_of_message),
first Message (b s1 s2) = value Message m ->
reduce Message f (Collect_message Message b s1 s2 s1 s2) =
(reduce Message f (b s1 s2) - f m)%Z.
Lemma reduce_post_message_null :
forall (m : Message) (s1 s2 s3 s4 : Site) (b : Bag_of_message),
f m = 0%Z ->
reduce Message f (Post_message Message m b s1 s2 s3 s4) =
reduce Message f (b s3 s4).
Lemma reduce_collect_message_null :
forall (m : Message) (s1 s2 s3 s4 : Site) (b : Bag_of_message),
first Message (b s1 s2) = value Message m ->
f m = 0%Z ->
reduce Message f (Collect_message Message b s1 s2 s3 s4) =
reduce Message f (b s3 s4).