Commit 100795b2 authored by Lucien RAKOTOMALALA's avatar Lucien RAKOTOMALALA

Refrac complete of beta in F

The min-plus service doesn't need anymore of a Fplus function.
parent a622a142
......@@ -15,7 +15,7 @@
(* definition 5 in the paper. It is the same notation i and j as the *)
(* flow variables *)
(**************************************************************************)
(** * Case Study *)
Require Import Reals Rdefinitions Psatz .
......@@ -34,7 +34,7 @@ Require Import FunctionalExtensionality.
Add Printing Coercion nat_of_ord.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Open Scope Rbar_scope.
......@@ -60,6 +60,12 @@ Proof. by apply IZR_le. Qed.
Definition burst := mk_nnR 8000 burst_is_positive.
(* Arrival functions *)
(* Definition f1 := (gamma_h rate burst : F). *)
(* Definition f2 := (gamma_h rate burst : F). *)
(* Definition f3 := (gamma_h rate burst : F). *)
(* Definition f4 := (gamma_h rate burst : F). *)
(* Definition f5 := (gamma_h rate burst : F). *)
Definition f1 := gamma_h rate burst.
Definition f2 := gamma_h rate burst.
Definition f3 := gamma_h rate burst.
......@@ -129,7 +135,6 @@ Hypothesis H_server_S1 :
(* [ffun i => tnth [tuple F1; F2; F3] i : Fplus] *)
(* [ffun i => tnth [tuple F1_S1; F2_S1; F3_S1] i : Fplus]. *)
S1 [ffun i => F_S1_in i : Fplus] [ffun i => F_S1_out i : Fplus].
(** Server 2 - 1 ***************************************************)
Variables F1_S2 : dflow.
......@@ -157,7 +162,7 @@ Hypothesis H_server_S3 :
(** Server 4 ***************************************************)
Let F_S4_in : dflow^2 := [ffun i => tnth [tuple F3_S2; F5] i].
Variables (F3_S4 : dflow) (F5_S4 : dflow).
Let F_S4_out : dflow^2 := [ffun i => tnth [tuple F3_S4; F5_S4] i].
......@@ -186,25 +191,28 @@ Let F_S6_out : dflow^2 := [ffun i => tnth [tuple F4_S6; F5_S6] i].
Hypothesis H_server_S6 :
S6 [ffun i => F_S6_in i : Fplus][ffun i => F_S6_out i : Fplus].
Definition S1_FIFO_service : Fup := delta (WC_hDev (f1 + f2 + f3)%Fp beta_S1).
(* Definition S1_FIFO_service : F := delta (WC_hDev (f1 + f2 + f3)%F beta_S1). *)
Definition S1_FIFO_service : Fup := delta (WC_hDev (f1 + f2 + f3)%F beta_S1).
Definition f1_S1 := (f1 / S1_FIFO_service).
Definition f2_S1 := (f2 / S1_FIFO_service).
Definition f3_S1 := (f3 / S1_FIFO_service).
Definition f1_S1 := f1 / S1_FIFO_service.
Definition f2_S1 := f2 / S1_FIFO_service.
Definition f3_S1 := f3 / S1_FIFO_service.
(* Definition alpha_S1 : F^3 := *)
(* [ffun i => tnth [tuple f1; f2; f3] i]. *)
Definition alpha_S1 : Fup^3 :=
[ffun i => tnth [tuple f1; f2; f3] i].
Lemma min_residual_service_S1 i :
is_min_service (residual_server_constr S1 i alpha_S1) S1_FIFO_service.
is_min_service (residual_server_constr S1 i [ffun i =>alpha_S1 i : F]) S1_FIFO_service.
Proof.
move : (F0up_start0 beta_S1) => Hbeta0.
rewrite /S1_FIFO_service /Fplus_plus.
have <- : (fun t => (\sum_j (alpha_S1 j) t)%nnRbar) =
(fun t : nnR => (f1 t + f2 t + f3 t)%nnRbar).
rewrite /S1_FIFO_service /F_plus.
have <- : (fun t => (\sum_j (alpha_S1 j) t)%Rbar) =
(fun t : nnR => (f1 t + f2 t + f3 t)%Rbar).
{ apply functional_extensionality => t.
rewrite !big_ord_recl big_ord0 nnRbar_plus_0_r.
by rewrite !ffunE nnRbar_plus_assoc.
rewrite !big_ord_recl big_ord0 Rbar_plus_0_r.
by rewrite !ffunE Rbar_plus_assoc.
}
apply (FIFO_delay H_S1 (alpha:=alpha_S1) (i:= i) Hbeta_S1).
Qed.
......@@ -212,7 +220,7 @@ Qed.
Lemma alpha_S1_correct i :
is_maximal_arrival
([ffun i => tnth [tuple F1; F2; F3] i : Fplus] i)
(alpha_S1 i).
((alpha_S1 i : F)).
Proof.
case i => n. case n => {n} [|n].
{ move => ?.
......@@ -232,33 +240,13 @@ case n => {n} [|n].
by [].
Qed.
Let f_S1_out := [ffun i => tnth [tuple f1_S1; f2_S1; f3_S1] i].
Import GDioid.
Lemma Fplus_val_div (f g : Fplus) : Fplus_val (f / g) = (Fplus_val f / Fplus_val g).
Proof.
apply /led_antisym /andP; split.
{
rewrite -mul_div_equiv muldC.
rewrite -[_ * _ ]/(Fplus_val (g * (f / g))).
rewrite -[Fplus_val _ <= Fplus_val _]/(f <= g * (f / g)).
rewrite muldC mul_div_equiv.
apply led_reflexive.
}
(* Let f_S1_out := [ffun i => tnth [tuple (f1_S1 : F); (f2_S1 : F); (f3_S1 : F)] i]. *)
Let f_S1_out := [ffun i => tnth [tuple f1_S1; f2_S1 ; f3_S1] i].
(* rewrite -[Fplus_val _ <= Fplus_val _]/((f / g) <= (mk_Fplus H)). *)
(* rewrite -mul_div_equiv. muldC. *)
(* apply /Fup_leP => {H} t /=. *)
(* rewrite F_plus_val_min_conv. *)
(* move : t. *)
(* apply /Fplus_leP. *)
(* rewrite -Fplus_min_convE. *)
(* rewrite muldC mul_div_equiv . *)
(* apply led_reflexive. *)
(* Qed. *)
Ltac unfold_tnth :=
rewrite /tnth ![nth _ _ _]/=. (* TODO tactique (unfold_tnth) *)
Admitted.
Import GDioid.
Lemma UIB_departure_S1 i :
is_maximal_arrival (
......@@ -270,15 +258,14 @@ case i => n; case n => {n} [|n].
{
move => j.
rewrite /f1_S1.
rewrite Fup_val_div Fplus_val_div.
apply (@output_arrival_curve_mp (residual_server_constr S1 (Ordinal j) alpha_S1) F1);
unfold_tnth.
rewrite Fup_val_div.
apply (@output_arrival_curve_mp_Fplus (residual_server_constr S1 (Ordinal j)
[ffun i => alpha_S1 i : F]) F1);
[ |by apply min_residual_service_S1 | by []].
rewrite /residual_server_constr.
exists F1, F1_S1; split; [by []|split; [by []|]].
exists F_S1_in, F_S1_out; split; [|split; [|split]].
(* exists ([ffun i => tnth [tuple F1; F2; F3] i]), *)
(* [ffun i => tnth [tuple F1_S1; F2_S1; F3_S1] i] *)
{ by rewrite -nserver_FplusE. }
{ by rewrite ffunE. }
{ by rewrite ffunE. }
......@@ -293,8 +280,10 @@ case n => {n} [|n].
{
move => j.
rewrite /f2_S1.
rewrite Fup_val_div Fplus_val_div.
apply (@output_arrival_curve_mp (residual_server_constr S1 (Ordinal j) alpha_S1) F2);
rewrite /tnth ![nth _ _ _]/=. (* TODO tactique (unfold_tnth) *)
rewrite Fup_val_div.
apply (@output_arrival_curve_mp_Fplus (residual_server_constr S1 (Ordinal j)
[ffun i => alpha_S1 i : F]) F2);
[ | by apply min_residual_service_S1 | by [] ].
rewrite /residual_server_constr.
exists F2, F2_S1; split; [by []|split; [by []|]].
......@@ -313,8 +302,9 @@ case n => {n} [|n].
{
move => j.
rewrite /f3_S1.
rewrite Fup_val_div Fplus_val_div.
apply (@output_arrival_curve_mp (residual_server_constr S1 (Ordinal j) alpha_S1) F3);
rewrite /tnth ![nth _ _ _]/=. (* TODO tactique (unfold_tnth) *)
rewrite Fup_val_div.
apply (@output_arrival_curve_mp_Fplus (residual_server_constr S1 (Ordinal j) [ffun i => alpha_S1 i : F]) F3);
[ |by apply min_residual_service_S1 | by [] ].
rewrite /residual_server_constr.
exists F3, F3_S1; split; [by []|split; [by []|]].
......@@ -336,28 +326,34 @@ Hypothesis Hf_S2_1 : is_maximal_arrival F1_S1 f1_S1.
Definition S2_f1_FIFO_service : Fup := delta (WC_hDev f1_S1 beta_S2_1).
Definition f1_S2 := (f1_S1 / S2_f1_FIFO_service).
Definition f1_S2 := f1_S1 / S2_f1_FIFO_service.
Lemma min_residual_service_S2_1 i :
is_min_service (residual_server_constr S2_1 i [ffun _ => f1_S1]) S2_f1_FIFO_service.
is_min_service (residual_server_constr S2_1 i [ffun _ => f1_S1 : F]) S2_f1_FIFO_service.
Proof.
move : (F0up_start0 beta_S2_1) => Hbeta0.
rewrite /S2_f1_FIFO_service.
have <- : (fun t => (\sum_(j < 1) ([ffun=> f1_S1] j) t)%nnRbar) =
f1_S1.
{ apply functional_extensionality => t.
rewrite !big_ord_recl big_ord0 nnRbar_plus_0_r.
have {2}<- : (fun t => (\sum_(j < 1) ([ffun=> f1_S1] j) t)%Rbar) =
(f1_S1: F).
{
apply functional_extensionality => t.
rewrite !big_ord_recl big_ord0 Rbar_plus_0_r.
by rewrite ffunE.
}
have -> : [ffun => f1_S1 : F] = [ffun i=> [ffun _ : 'I_1 => f1_S1] i : F].
{
apply /ffunP => j.
by rewrite !ffunE.
}
by apply FIFO_delay; [apply FIFO_one_server|].
Qed.
Lemma UIB_departure_S2_1 :
is_maximal_arrival F1_S2 f1_S2.
Proof.
rewrite Fup_val_div Fplus_val_div.
apply (@output_arrival_curve_mp
(residual_server_constr S2_1 ord0 [ffun => f1_S1]) F1_S1);
rewrite Fup_val_div.
apply (@output_arrival_curve_mp_Fplus
(residual_server_constr S2_1 ord0 [ffun => f1_S1 : F]) F1_S1);
[ | by apply min_residual_service_S2_1 | by []].
rewrite /residual_server_constr.
exists F1_S1, F1_S2; split; [by []|split; [by []|]].
......@@ -408,25 +404,31 @@ by [].
Qed.
Lemma min_residual_service_S2_2 i :
is_min_service (residual_server_constr S2_2 i [ffun _ => f2_S1]) S2_f2_FIFO_service.
is_min_service (residual_server_constr S2_2 i [ffun _ => f2_S1 : F]) S2_f2_FIFO_service.
Proof.
move : (F0up_start0 beta_S2_2) => Hbeta0.
rewrite /S2_f2_FIFO_service.
have <- : (fun t => (\sum_(j < 1) ([ffun=> f2_S1] j) t)%nnRbar) =
f2_S1.
{ apply functional_extensionality => t.
rewrite !big_ord_recl big_ord0 nnRbar_plus_0_r.
have {2}<- : (fun t => (\sum_(j < 1) ([ffun=> f1_S1] j) t)%Rbar) =
(f1_S1: F).
{
apply functional_extensionality => t.
rewrite !big_ord_recl big_ord0 Rbar_plus_0_r.
by rewrite ffunE.
}
have -> : [ffun => f1_S1 : F] = [ffun i=> [ffun _ : 'I_1 => f1_S1] i : F].
{
apply /ffunP => j.
by rewrite !ffunE.
}
by apply FIFO_delay; [apply FIFO_one_server|].
Qed.
Lemma UIB_departure_S2_2 :
is_maximal_arrival F2_S2 f2_S2.
Proof.
rewrite Fup_val_div Fplus_val_div.
apply (@output_arrival_curve_mp
(residual_server_constr S2_2 ord0 [ffun => f2_S1]) F2_S1);
rewrite Fup_val_div.
apply (@output_arrival_curve_mp_Fplus
(residual_server_constr S2_2 ord0 [ffun => f2_S1 : F]) F2_S1);
[ | by apply min_residual_service_S2_2 | by []].
rewrite /residual_server_constr.
exists F2_S1, F2_S2; split; [by []|split; [by []|]].
......@@ -465,16 +467,19 @@ Definition f3_S2 := f3_S1 / S2_f3_FIFO_service.
Hypothesis Hf_S2_3 : is_maximal_arrival F3_S1 f3_S1.
Lemma min_residual_service_S2_3 i :
is_min_service (residual_server_constr S2_3 i [ffun _ => f3_S1]) S2_f3_FIFO_service.
is_min_service (residual_server_constr S2_3 i [ffun _ => f3_S1 : F])
S2_f3_FIFO_service.
Proof.
move : (F0up_start0 beta_S2_2) => Hbeta0.
rewrite /S2_f3_FIFO_service.
have <- : (fun t => (\sum_(j < 1) ([ffun=> f3_S1] j) t)%nnRbar) =
f3_S1.
have {2}<- : (fun t => (\sum_(j < 1) ([ffun=> f3_S1] j) t)%Rbar) =
(f3_S1 : F).
{ apply functional_extensionality => t.
rewrite !big_ord_recl big_ord0 nnRbar_plus_0_r.
rewrite !big_ord_recl big_ord0 Rbar_plus_0_r.
by rewrite ffunE.
}
have -> : [ffun => f3_S1 : F] = [ffun i=> [ffun _ : 'I_1 => f1_S1] i : F].
{ by apply /ffunP => j; rewrite !ffunE. }
by apply FIFO_delay; [apply FIFO_one_server|].
Qed.
......@@ -494,9 +499,9 @@ Qed.
Lemma UIB_departure_S2_3 :
is_maximal_arrival F3_S2 f3_S2.
Proof.
rewrite Fup_val_div Fplus_val_div.
apply (@output_arrival_curve_mp
(residual_server_constr S2_3 ord0 [ffun => f3_S1]) F3_S1);
rewrite Fup_val_div.
apply (@output_arrival_curve_mp_Fplus
(residual_server_constr S2_3 ord0 [ffun => f3_S1 : F]) F3_S1);
[ |by apply min_residual_service_S2_3 | by []].
rewrite /residual_server_constr.
exists F3_S1, F3_S2; split; [by []|split; [by []|]].
......@@ -536,14 +541,15 @@ Definition f4_S3 := (f4 / S3_FIFO_service).
Hypothesis Hf1_S2 : is_maximal_arrival F1_S2 f1_S2.
Lemma min_residual_service_S3 i :
is_min_service (residual_server_constr S3 i alpha_S3) S3_FIFO_service.
is_min_service (residual_server_constr S3 i [ffun i=> alpha_S3 i: F])
S3_FIFO_service.
Proof.
move : (F0up_start0 beta_S1) => Hbeta0.
rewrite /S3_FIFO_service /Fplus_plus.
have <- : (fun t => (\sum_j (alpha_S3 j) t)%nnRbar) =
rewrite /S3_FIFO_service /Fplus_plus /Fplus_val.
have <- : (fun t => (\sum_j (alpha_S3 j) t)%Rbar) =
(fun t : nnR => (f1_S2 t + f4 t)%nnRbar).
{ apply functional_extensionality => t.
rewrite !big_ord_recl big_ord0 nnRbar_plus_0_r.
rewrite !big_ord_recl big_ord0 Rbar_plus_0_r.
by rewrite !ffunE.
}
apply (FIFO_delay H_S3 (alpha:=alpha_S3) (i:= i) Hbeta_S3).
......@@ -575,8 +581,10 @@ case i => n; case n => {n} [|n].
{
move => j.
rewrite /f1_S3.
rewrite Fup_val_div Fplus_val_div.
apply (@output_arrival_curve_mp (residual_server_constr S3 (Ordinal j) alpha_S3) F1_S2);
rewrite Fup_val_div.
apply (@output_arrival_curve_mp_Fplus
(residual_server_constr S3 (Ordinal j)
[ffun i => alpha_S3 i : F]) F1_S2);
[ |by apply min_residual_service_S3 | by []].
rewrite /residual_server_constr.
exists F1_S2, F1_S3; split; [by []|split; [ by [] |]].
......@@ -595,8 +603,10 @@ case n => {n} [|n].
{
move => j.
rewrite /f4_S3.
rewrite Fup_val_div Fplus_val_div.
apply (@output_arrival_curve_mp (residual_server_constr S3 (Ordinal j) alpha_S3) F4);
rewrite Fup_val_div.
unfold_tnth.
apply (@output_arrival_curve_mp_Fplus (residual_server_constr
S3 (Ordinal j) [ffun i => alpha_S3 i : F]) F4);
[ |by apply min_residual_service_S3 | by []].
rewrite /residual_server_constr.
exists F4, F4_S3; split; [by []|split; [by []|]].
......@@ -620,19 +630,20 @@ Definition alpha_S4 : Fup^2 := [ffun i => tnth [tuple f3_S2; f5] i].
Definition S4_FIFO_service : Fup :=
delta (WC_hDev (f3_S2 + f5)%Fp beta_S4).
Definition f3_S4 := (f3_S2 / S4_FIFO_service).
Definition f5_S4 := (f5 / S4_FIFO_service).
Definition f3_S4 := f3_S2 / S4_FIFO_service.
Definition f5_S4 := f5 / S4_FIFO_service.
Lemma min_residual_service_S4 i :
is_min_service (residual_server_constr S4 i alpha_S4) S4_FIFO_service.
is_min_service (residual_server_constr S4 i [ffun i => alpha_S4 i : F])
S4_FIFO_service.
Proof.
move : (F0up_start0 beta_S1) => Hbeta0.
rewrite /S4_FIFO_service /Fplus_plus.
have <- : (fun t => (\sum_j (alpha_S4 j) t)%nnRbar) =
rewrite /S4_FIFO_service /Fplus_plus /Fplus_val.
have <- : (fun t => (\sum_j (alpha_S4 j) t)%Rbar) =
(fun t : nnR => (f3_S2 t + f5 t)%nnRbar).
{ apply functional_extensionality => t.
rewrite !big_ord_recl big_ord0 nnRbar_plus_0_r.
rewrite !big_ord_recl big_ord0 Rbar_plus_0_r.
by rewrite !ffunE.
}
apply (FIFO_delay H_S4 (alpha:=alpha_S4) (i:= i) Hbeta_S4).
......@@ -663,9 +674,10 @@ rewrite !ffunE.
case i => n; case n => {n} [|n].
{
move => j.
rewrite /f3_S4.
rewrite Fup_val_div Fplus_val_div.
apply (@output_arrival_curve_mp (residual_server_constr S4 (Ordinal j) alpha_S4) F3_S2);
rewrite /f3_S4 Fup_val_div.
apply (@output_arrival_curve_mp_Fplus
(residual_server_constr
S4 (Ordinal j) [ffun i => alpha_S4 i : F] ) F3_S2);
[ |by apply min_residual_service_S4 | by []].
rewrite /residual_server_constr.
exists F3_S2, F3_S4; split; [by []|split; [ by [] |]].
......@@ -683,9 +695,10 @@ case i => n; case n => {n} [|n].
case n => {n} [|n].
{
move => j.
rewrite /f5_S4.
rewrite Fup_val_div Fplus_val_div.
apply (@output_arrival_curve_mp (residual_server_constr S4 (Ordinal j) alpha_S4) F5);
rewrite /f5_S4 Fup_val_div.
apply (@output_arrival_curve_mp_Fplus
(residual_server_constr S4 (Ordinal j)
[ffun i => alpha_S4 i : F]) F5);
[ |by apply min_residual_service_S4 | by []].
rewrite /residual_server_constr.
exists F5, F5_S4; split; [by []|split; [by []|]].
......@@ -712,16 +725,23 @@ Definition alpha_S5 : Fup^3 := [ffun i => tnth [tuple f1_S3; f2_S2; f3_S4] i].
Definition S5_FIFO_service : Fup :=
delta (WC_hDev ((f1_S3 + f2_S2) + f3_S4)%Fp beta_S5).
(* ToDO move *)
Lemma Rbar_plus_nnRbar (a b : nnRbar) : (a + b)%Rbar = (a + b)%nnRbar.
Proof. by []. Qed.
Lemma min_residual_service_S5 i :
is_min_service (residual_server_constr S5 i alpha_S5) S5_FIFO_service.
is_min_service (residual_server_constr S5 i [ffun i => alpha_S5 i : F])
S5_FIFO_service.
Proof.
move : (F0up_start0 beta_S1) => Hbeta0.
rewrite /S5_FIFO_service /Fplus_plus .
have <- : (fun t => (\sum_j (alpha_S5 j) t)%nnRbar) =
(fun t : nnR => (f1_S3 t + f2_S2 t + f3_S4 t)%nnRbar).
rewrite /S5_FIFO_service /Fplus_plus /Fplus_val.
have <- : (fun t => (\sum_j (alpha_S5 j) t)%Rbar) =
(fun t : nnR => (f1_S3 t + f2_S2 t + f3_S4 t)%Rbar).
{ apply functional_extensionality => t.
rewrite !big_ord_recl big_ord0 nnRbar_plus_0_r.
by rewrite !ffunE nnRbar_plus_assoc.
rewrite !big_ord_recl big_ord0 Rbar_plus_0_r.
rewrite !ffunE; unfold_tnth.
(* TODO optimize : time = 6secondes ! *)
by rewrite ?Rbar_plus_nnRbar nnRbar_plus_assoc.
}
apply (FIFO_delay H_S5 (alpha:=alpha_S5) (i:= i) Hbeta_S5).
Qed.
......@@ -746,9 +766,9 @@ case n => {n} [|n].
by [].
Qed.
Definition f1_S5 := (f1_S3 / S5_FIFO_service).
Definition f2_S5 := (f2_S2 / S5_FIFO_service).
Definition f3_S5 := (f3_S4 / S5_FIFO_service).
Definition f1_S5 := f1_S3 / S5_FIFO_service.
Definition f2_S5 := f2_S2 / S5_FIFO_service.
Definition f3_S5 := f3_S4 / S5_FIFO_service.
(* Tuple construction *)
Let f_S5_out := [ffun i => tnth [tuple f1_S5; f2_S5; f3_S5] i].
......@@ -760,9 +780,10 @@ rewrite !ffunE.
case i => n; case n => {n} [|n].
{
move => j.
rewrite /f3_S4.
rewrite Fup_val_div Fplus_val_div.
apply (@output_arrival_curve_mp (residual_server_constr S5 (Ordinal j) alpha_S5) F1_S3);
rewrite /f3_S4 Fup_val_div.
apply (@output_arrival_curve_mp_Fplus
(residual_server_constr S5 (Ordinal j) [ffun i => alpha_S5 i : F])
F1_S3);
[ |by apply min_residual_service_S5 | by []].
rewrite /residual_server_constr.
exists F1_S3, F1_S5; split; [by []|split; [ by [] |]].
......@@ -771,18 +792,19 @@ case i => n; case n => {n} [|n].
{ by rewrite ffunE. }
{ by rewrite ffunE. }
move => [[ |k ] Hk].
{ apply alpha_S5_correct. }
{ rewrite ffunE; apply alpha_S5_correct. }
move: k Hk => [ |k ] Hk.
{ apply alpha_S5_correct. }
{ rewrite ffunE; apply alpha_S5_correct. }
move: k Hk => [ |//] Hk.
by rewrite !ffunE.
}
case n => {n} [|n].
{
move => j.
rewrite /f5_S4.
rewrite Fup_val_div Fplus_val_div.
apply (@output_arrival_curve_mp (residual_server_constr S5 (Ordinal j) alpha_S5) F2_S2);
rewrite /f5_S4 Fup_val_div.
apply (@output_arrival_curve_mp_Fplus
(residual_server_constr S5 (Ordinal j) [ffun i => alpha_S5 i : F])
F2_S2);
[ |by apply min_residual_service_S5 | by []].
rewrite /residual_server_constr.
exists F2_S2, F2_S5; split; [by []|split; [by []|]].
......@@ -791,18 +813,19 @@ case n => {n} [|n].
{ by rewrite ffunE. }
{ by rewrite ffunE. }
move => [[ |k ] Hk].
{ apply alpha_S5_correct. }
{ rewrite ffunE; apply alpha_S5_correct. }
move: k Hk => [ |k ] Hk.
{ apply alpha_S5_correct. }
{ rewrite ffunE; apply alpha_S5_correct. }
move: k Hk => [ |//] Hk.
by rewrite !ffunE.
}
case n => {n} [|n].
{
move => j.
rewrite /f3_S5.
rewrite Fup_val_div Fplus_val_div.
apply (@output_arrival_curve_mp (residual_server_constr S5 (Ordinal j) alpha_S5) F3_S4);
rewrite /f3_S5 Fup_val_div.
apply (@output_arrival_curve_mp_Fplus
(residual_server_constr S5 (Ordinal j) [ffun i => alpha_S5 i : F])
F3_S4);
[ |by apply min_residual_service_S5 | by []].
rewrite /residual_server_constr.
exists F3_S4, F3_S5; split; [by []|split; [by []|]].
......@@ -811,9 +834,9 @@ case n => {n} [|n].
{ by rewrite ffunE. }
{ by rewrite ffunE. }
move => [[ |k ] Hk].
{ apply alpha_S5_correct. }
{ rewrite ffunE; apply alpha_S5_correct. }
move: k Hk => [ |k ] Hk.
{ apply alpha_S5_correct. }
{ rewrite ffunE; apply alpha_S5_correct. }
move: k Hk => [ |//] Hk.
by rewrite !ffunE.
}
......@@ -829,14 +852,15 @@ Definition S6_FIFO_service : Fup :=
delta (WC_hDev (f4_S3 + f5_S4)%Fp beta_S6).
Lemma min_residual_service_S6 i :
is_min_service (residual_server_constr S6 i alpha_S6) S6_FIFO_service.
is_min_service (residual_server_constr S6 i [ffun i => alpha_S6 i : F])
S6_FIFO_service.
Proof.
move : (F0up_start0 beta_S1) => Hbeta0.
rewrite /S6_FIFO_service /Fplus_plus .
have <- : (fun t => (\sum_j (alpha_S6 j) t)%nnRbar) =
(fun t : nnR => (f4_S3 t + f5_S4 t)%nnRbar).
rewrite /S6_FIFO_service /Fplus_plus /Fplus_val.
have <- : (fun t => (\sum_j (alpha_S6 j) t)%Rbar) =
(fun t : nnR => (f4_S3 t + f5_S4 t)%Rbar).
{ apply functional_extensionality => t.
rewrite !big_ord_recl big_ord0 nnRbar_plus_0_r.
rewrite !big_ord_recl big_ord0 Rbar_plus_0_r.
by rewrite !ffunE.
}
apply (FIFO_delay H_S6 (alpha:=alpha_S6) (i:= i) Hbeta_S6).
......@@ -857,8 +881,8 @@ case n => {n} [|n].
by [].
Qed.
Definition f4_S6 := (f4_S3 / S6_FIFO_service).
Definition f5_S6 := (f5_S4 / S6_FIFO_service).
Definition f4_S6 := f4_S3 / S6_FIFO_service.
Definition f5_S6 := f5_S4 / S6_FIFO_service.
Let f_S6_out := [ffun i => tnth [tuple f4_S6 ; f5_S6] i].
......@@ -869,8 +893,10 @@ rewrite !ffunE.
case i => n; case n => {n} [|n].
{
move => j.
rewrite Fup_val_div Fplus_val_div.
apply (@output_arrival_curve_mp (residual_server_constr S6 (Ordinal j) alpha_S6) F4_S3);
rewrite Fup_val_div.
apply (@output_arrival_curve_mp_Fplus
(residual_server_constr S6 (Ordinal j) [ffun i => alpha_S6 i : F])
F4_S3);
[ |by apply min_residual_service_S6 | by []].
rewrite /residual_server_constr.
exists F4_S3, F4_S6; split; [by []|split; [ by [] |]].
......@@ -879,17 +905,19 @@ case i => n; case n => {n} [|n].
{ by rewrite ffunE. }
{ by rewrite ffunE. }
move => [[ |k ] Hk].
{ apply alpha_S6_correct. }
{ rewrite ffunE; apply alpha_S6_correct. }
move: k Hk => [ |k ] Hk.
{ apply alpha_S6_correct. }
{ rewrite ffunE; apply alpha_S6_correct. }
move: k Hk => [ |//] Hk.
by rewrite !ffunE.
}
case n => {n} [|n].
{
move => j.
rewrite Fup_val_div Fplus_val_div.
apply (@output_arrival_curve_mp (residual_server_constr S6 (Ordinal j) alpha_S6) F5_S4);
rewrite Fup_val_div.
apply (@output_arrival_curve_mp_Fplus
(residual_server_constr S6 (Ordinal j) [ffun i => alpha_S6 i : F])
F5_S4);
[ |by apply min_residual_service_S6 | by []].
rewrite /residual_server_constr.
exists F5_S4, F5_S6; split; [by []|split; [ by [] |]].
......@@ -898,9 +926,9 @@ case n => {n} [|n].
{ by rewrite ffunE. }
{ by rewrite ffunE. }
move => [[ |k ] Hk].
{ apply alpha_S6_correct. }
{ rewrite ffunE; apply alpha_S6_correct. }
move: k Hk => [ |k ] Hk.
{ apply alpha_S6_correct. }
{ rewrite ffunE; apply alpha_S6_correct. }
move: k Hk => [ |//] Hk.
by rewrite !ffunE.
}
......@@ -913,10 +941,10 @@ Qed.
(* Then proof of these servers have a min plus service *)
(* fi_endToend *)
Definition f1_servers :=
(residual_server_constr S1 (inord 0) alpha_S1 *
residual_server_constr S2_1 (inord 0) [ffun _ => f1_S1] *
residual_server_constr S3 (inord 0) alpha_S3 *
residual_server_constr S5 (inord 0) alpha_S5)%S.
(residual_server_constr S1 (inord 0) [ffun i => alpha_S1 i : F]*
residual_server_constr S2_1 (inord 0) [ffun _ => f1_S1 : F] *
residual_server_constr S3 (inord 0) [ffun i => alpha_S3 i : F] *
residual_server_constr S5 (inord 0) [ffun i => alpha_S5 i : F])%S.
(* faire pareil pour tout server. *)
Lemma f1_servers_crossed : (f1_servers F1 F1_S5).
Proof.
......@@ -950,24 +978,22 @@ split.
move => j.
rewrite /F_S1_in !ffunE.
apply Hf_S2_1.
}
}
rewrite residual_server_constrE.
exists [ffun i => F_S3_in i : Fplus], [ffun i => F_S3_out i :Fplus].
split; [by []|].
split; rewrite !ffunE /inord /insubd insubT.
{ by []. }
split; [by []|].
move => j; rewrite ffunE; move : j.
apply alpha_S3_correct.
split; [by []|].
move => j; do 2 rewrite ffunE; apply alpha_S3_correct.
}
rewrite residual_server_constrE.
exists [ffun i => F_S5_in i : Fplus], [ffun i => F_S5_out i :Fplus].
split; [by []|].
split; rewrite !ffunE /inord /insubd insubT.
{ by []. }
split; [by []|].
move => j; rewrite ffunE; move : j.
apply alpha_S5_correct.
split; [by []|].
move => j; do 2 rewrite ffunE; apply alpha_S5_correct.
Qed.
Definition f1_E2E_service := (S1_FIFO_service * S2_f1_FIFO_service *
......@@ -985,9 +1011,9 @@ apply server_concat_conv;
Qed.
Definition f2_servers :=
(residual_server_constr S1 (inord 1) alpha_S1 *
residual_server_constr S2_2(inord 0) [ffun => f2_S1] *
residual_server_constr S5 (inord 1) alpha_S5 )%S.
(residual_server_constr S1 (inord 1) [ffun i => alpha_S1 i : F] *
residual_server_constr S2_2(inord 0) [ffun => f2_S1 : F] *
residual_server_constr S5 (inord 1) [ffun i => alpha_S5 i : F])%S.
Lemma f2_servers_crossed : (f2_servers F2 F2_S5).
Proof.
......@@ -1016,16 +1042,15 @@ split.
{ by []. }
move => j.
rewrite !ffunE.
apply Hf_S2_2.
}