(* This program is free software; you can redistribute it and/or      *)
(* modify it under the terms of the GNU Lesser General Public License *)
(* as published by the Free Software Foundation; either version 2.1   *)
(* of the License, or (at your option) any later version.             *)
(*                                                                    *)
(* This program is distributed in the hope that it will be useful,    *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of     *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      *)
(* GNU General Public License for more details.                       *)
(*                                                                    *)
(* You should have received a copy of the GNU Lesser General Public   *)
(* License along with this program; if not, write to the Free         *)
(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *)
(* 02110-1301 USA                                                     *)
(* TABLE ACTIONS *)
(*definit les actions elementaires sur les tables et leurs consequences*)
Require Export DistributedReferenceCounting.machine0.machine.
Section T_ACTION.
Definition Update_table (d0 : Date_table) (s0 : Site)
(new_date : nat) := change_site nat d0 s0 new_date.
Definition Set_rec_table (r0 : Rec_table) (s0 : Site) :=
change_site bool r0 s0 true.
Definition Reset_rec_table (r0 : Rec_table) (s0 : Site) :=
change_site bool r0 s0 false.
Definition Inc_send_table (t0 : Send_table) (s0 : Site) :=
change_site Z t0 s0 (t0 s0 + 1)%Z.
Definition Dec_send_table (t0 : Send_table) (s0 : Site) :=
change_site Z t0 s0 (t0 s0 - 1)%Z.
End T_ACTION.
Section DT_EFFECT.

Lemma update_elsewhere :
forall (d0 : Date_table) (s0 s1 : Site) (newdate : nat),
s0 <> s1 -> Update_table d0 s0 newdate s1 = d0 s1.