Library probsa.rt.analysis.valid_pWCET_remains_valid
(* --------------------------------- Prosa ---------------------------------- *)
From prosa.model Require Import processor.ideal.
(* --------------------------------- ProBsa --------------------------------- *)
From probsa.util Require Export misc bigop_inf.
From probsa.probability Require Export pred law_of_total_prob.
From probsa.rt.model Require Export task events axiomatic_pWCET scheduler rt_monotonic.
From probsa.rt.analysis Require Export pETs_to_pWCETs partition_transfer
axiomatic_pWCET_step.
(* -------------------------------- SSReflect ------------------------------- *)
From mathcomp Require Import finfun.
(* ---------------------------------- Main ---------------------------------- *)
From prosa.model Require Import processor.ideal.
(* --------------------------------- ProBsa --------------------------------- *)
From probsa.util Require Export misc bigop_inf.
From probsa.probability Require Export pred law_of_total_prob.
From probsa.rt.model Require Export task events axiomatic_pWCET scheduler rt_monotonic.
From probsa.rt.analysis Require Export pETs_to_pWCETs partition_transfer
axiomatic_pWCET_step.
(* -------------------------------- SSReflect ------------------------------- *)
From mathcomp Require Import finfun.
(* ---------------------------------- Main ---------------------------------- *)
Valid pWCET Remains Valid
We plan to replace every single job cost using the procedure replace_job_pET repeated for each job. However, note that the assumption axiomatic_pWCET (ΞΌ_of S) is stated only for the initial system S. After we apply the transformation, we create a new system S' := replace_job_pET j S. Thus, in order to be able to use axiomatic_pWCET again on S', we must ensure that the pWCET remains axiomatic in the new system S'. In this section, we show that this is indeed the case.
Assume horizon defines the termination time of the system. If
horizon = None, the system does not terminate; however, it
still has a finite number of jobs.
Consider any type of tasks with a notion of pWCET ...
...and their jobs.
Consider a response-time monotonic scheduling algorithm ΞΆ,
where response-time monotonic means the following -- assuming
that all arrival times are fixed, an increase of the execution
cost of any job cannot cause a decrease of the response time of
any job. Recall that ΞΆ receives two vectors: a vector of
arrival times π and a vector of job costs π.
Variable ΞΆ : @schedulerππ Job.
Hypothesis H_rt_monotonic : rt_monotonic_scheduler horizon ΞΆ.
Hypothesis H_rt_monotonic : rt_monotonic_scheduler horizon ΞΆ.
For simplicity, let π‘ denote a function that maps π and π
to a function that computes the response time of any job ...
Auxiliary Lemmas
When we talk about axiomatic pWCET, we are interested in two properties: partition-independentness and partition-dominance. In this section, we prove two auxiliary lemmas which state that after transforming a system into a new system via function replace_job_pET, both properties are satisfied in the new system.
Variable Ξ© : countType.
Variable ΞΌ : measure Ξ©.
Variable π : JobArrivalRV Job Ξ© ΞΌ.
Variable π : JobCostRV Job Ξ© ΞΌ.
Variable ΞΌ : measure Ξ©.
Variable π : JobArrivalRV Job Ξ© ΞΌ.
Variable π : JobCostRV Job Ξ© ΞΌ.
Let us use these parameters to construct a system S.
Next, consider two arbitrary jobs: job j, for which we
compute the response time, and job j_rep, whose pET we
modify.
Suppose we use the construction replace_job_pET presented in
probsa/rt/analysis/pETs_to_pWCETs to replace the execution
cost of given job j_rep. Let S' denote the resulting system.
Similar to probsa/rt/analysis/axiomatic_pWCET_step.v,
consider an arrival sequence ΞΎ and two events corresponding
to Ο that realize this arrival sequence in systems S and
S', respectively.
Variable ΞΎ : arrival_sequence Job.
Let ΞΎf := ΞΎ_fix (arr_seq (job_arrival := π_of S)) ΞΎ.
Let ΞΎf' := ΞΎ_fix (arr_seq (job_arrival := π_of S')) ΞΎ.
Let ΞΎf := ΞΎ_fix (arr_seq (job_arrival := π_of S)) ΞΎ.
Let ΞΎf' := ΞΎ_fix (arr_seq (job_arrival := π_of S')) ΞΎ.
In this section, we show that if partition-dominance holds for
S w.r.t. partition P, then partition-dominance holds for
S' w.r.t. partition P'.
Section ConditionalBoundedness.
Hypothesis H_job_cost_cond_bounded_by_pWCET :
β (i : I P) (Ο : PosProb (ΞΌ_of S) (ΞΎf β© Pβ{i})),
π½<ΞΌ_of S, Ο>{[ odflt0 (π_of S j) | ΞΎf β© Pβ{i} ]} βͺ― pWCET_cdf (job_task j).
Lemma job_cost_cond_bounded_by_pWCET_respected :
β (i : I P') (Ο' : PosProb (ΞΌ_of S') (ΞΎf' β© P'β{i})),
π½<ΞΌ_of S', Ο'>{[ odflt0 (π_of S' j) | ΞΎf' β© P'β{i} ]} βͺ― pWCET_cdf (job_task j).
End ConditionalBoundedness.
Hypothesis H_job_cost_cond_bounded_by_pWCET :
β (i : I P) (Ο : PosProb (ΞΌ_of S) (ΞΎf β© Pβ{i})),
π½<ΞΌ_of S, Ο>{[ odflt0 (π_of S j) | ΞΎf β© Pβ{i} ]} βͺ― pWCET_cdf (job_task j).
Lemma job_cost_cond_bounded_by_pWCET_respected :
β (i : I P') (Ο' : PosProb (ΞΌ_of S') (ΞΎf' β© P'β{i})),
π½<ΞΌ_of S', Ο'>{[ odflt0 (π_of S' j) | ΞΎf' β© P'β{i} ]} βͺ― pWCET_cdf (job_task j).
End ConditionalBoundedness.
In this section, we show that if partition-independentness holds for
S w.r.t. partition P, then partition-independentness holds for
S' w.r.t. partition P'.
Consider an arbitrary vector of job costs π...
... and two events corresponding to Οs that realize this
vector of job costs in systems S and S',
respectively.
Let π_fix := events.π_fix (job_cost := π_of S) π.
Let π_fix' := events.π_fix (job_cost := π_of S') π.
Hypothesis H_job_cost_cond_independent :
β (i : I P) (jobs : seq Job) (Ο : PosProb (ΞΌ_of S) (ΞΎf β© Pβ{i})),
j \notin jobs β
β<ΞΌ_of S, Ο>{[ π_fix [:: j] β© π_fix jobs | ΞΎf β© Pβ{i} ]}
= β<ΞΌ_of S>{[ π_fix [:: j] | ΞΎf β© Pβ{i} ]} Γ β<ΞΌ_of S>{[ π_fix jobs | ΞΎf β© Pβ{i} ]}.
Lemma job_cost_cond_independent_respected :
β (i : I P') (jobs : seq Job) (Ο' : PosProb (ΞΌ_of S') (ΞΎf' β© P'β{i})),
j \notin jobs β
β<ΞΌ_of S', Ο'>{[ π_fix' [:: j] β© π_fix' jobs | ΞΎf' β© P'β{i} ]}
= β<ΞΌ_of S'>{[ π_fix' [:: j] | ΞΎf' β© P'β{i} ]} Γ β<ΞΌ_of S'>{[ π_fix' jobs | ΞΎf' β© P'β{i} ]}.
End ConditionalIndependence.
End ProofOfLemmas.
Let π_fix' := events.π_fix (job_cost := π_of S') π.
Hypothesis H_job_cost_cond_independent :
β (i : I P) (jobs : seq Job) (Ο : PosProb (ΞΌ_of S) (ΞΎf β© Pβ{i})),
j \notin jobs β
β<ΞΌ_of S, Ο>{[ π_fix [:: j] β© π_fix jobs | ΞΎf β© Pβ{i} ]}
= β<ΞΌ_of S>{[ π_fix [:: j] | ΞΎf β© Pβ{i} ]} Γ β<ΞΌ_of S>{[ π_fix jobs | ΞΎf β© Pβ{i} ]}.
Lemma job_cost_cond_independent_respected :
β (i : I P') (jobs : seq Job) (Ο' : PosProb (ΞΌ_of S') (ΞΎf' β© P'β{i})),
j \notin jobs β
β<ΞΌ_of S', Ο'>{[ π_fix' [:: j] β© π_fix' jobs | ΞΎf' β© P'β{i} ]}
= β<ΞΌ_of S'>{[ π_fix' [:: j] | ΞΎf' β© P'β{i} ]} Γ β<ΞΌ_of S'>{[ π_fix' jobs | ΞΎf' β© P'β{i} ]}.
End ConditionalIndependence.
End ProofOfLemmas.
Valid Axiomatic pWCET Remains Valid
We use the two auxiliary lemmas to prove a lemma that, given a system S, an axiomatic pWCET remains valid for a new system S' where pETs of an arbitrary set of jobs have been replaced by pWCETs.
Lemma valid_axiomatic_pWCET_remains_valid :
β (S : system) (jobs : seq Job),
let S' := foldr replace_job_pET S jobs in
axiomatic_pWCET (ΞΌ_of S) (job_arrival := π_of S) (job_cost := π_of S) β
axiomatic_pWCET (ΞΌ_of S') (job_arrival := π_of S') (job_cost := π_of S').
β (S : system) (jobs : seq Job),
let S' := foldr replace_job_pET S jobs in
axiomatic_pWCET (ΞΌ_of S) (job_arrival := π_of S) (job_cost := π_of S) β
axiomatic_pWCET (ΞΌ_of S') (job_arrival := π_of S') (job_cost := π_of S').
Iterative Application of Theorem 1
Consequently, one can use Theorem 1 iteratively to replace the pETs of all jobs in the system.
Theorem prob_rt_monotonic_axiomatic_pWCET_replace_all_pETs :
β (S : system),
let S' := replace_all_pETs S in
let sched S := compute_pr_schedule ΞΆ (job_arrival := π_of S) (job_cost := π_of S) in
axiomatic_pWCET (ΞΌ_of S) (job_arrival := π_of S) (job_cost := π_of S) β
probabilistic_response_time_monotone_transformation horizon
(sched S) (job_arrival := π_of S) (job_cost := π_of S)
(sched S') (job_arrival_s := π_of S') (job_cost_s := π_of S').
End ValidpWCETRemainsValid.
β (S : system),
let S' := replace_all_pETs S in
let sched S := compute_pr_schedule ΞΆ (job_arrival := π_of S) (job_cost := π_of S) in
axiomatic_pWCET (ΞΌ_of S) (job_arrival := π_of S) (job_cost := π_of S) β
probabilistic_response_time_monotone_transformation horizon
(sched S) (job_arrival := π_of S) (job_cost := π_of S)
(sched S') (job_arrival_s := π_of S') (job_cost_s := π_of S').
End ValidpWCETRemainsValid.