Commit a58b283a authored by Felipe Cerqueira's avatar Felipe Cerqueira

Remove JobIn to simplify specification

parent 9295617e
......@@ -14,7 +14,7 @@
#
# This Makefile was generated by the command line :
# coq_makefile -f _CoqProject ./util/ssromega.v ./util/seqset.v ./util/sorting.v ./util/step_function.v ./util/minmax.v ./util/powerset.v ./util/all.v ./util/ord_quantifier.v ./util/nat.v ./util/sum.v ./util/bigord.v ./util/counting.v ./util/tactics.v ./util/induction.v ./util/list.v ./util/divround.v ./util/bigcat.v ./util/fixedpoint.v ./util/notation.v ./analysis/global/jitter/bertogna_fp_comp.v ./analysis/global/jitter/interference_bound_edf.v ./analysis/global/jitter/workload_bound.v ./analysis/global/jitter/bertogna_edf_comp.v ./analysis/global/jitter/bertogna_fp_theory.v ./analysis/global/jitter/interference_bound.v ./analysis/global/jitter/interference_bound_fp.v ./analysis/global/jitter/bertogna_edf_theory.v ./analysis/global/parallel/bertogna_fp_comp.v ./analysis/global/parallel/interference_bound_edf.v ./analysis/global/parallel/workload_bound.v ./analysis/global/parallel/bertogna_edf_comp.v ./analysis/global/parallel/bertogna_fp_theory.v ./analysis/global/parallel/interference_bound.v ./analysis/global/parallel/interference_bound_fp.v ./analysis/global/parallel/bertogna_edf_theory.v ./analysis/global/basic/bertogna_fp_comp.v ./analysis/global/basic/interference_bound_edf.v ./analysis/global/basic/workload_bound.v ./analysis/global/basic/bertogna_edf_comp.v ./analysis/global/basic/bertogna_fp_theory.v ./analysis/global/basic/interference_bound.v ./analysis/global/basic/interference_bound_fp.v ./analysis/global/basic/bertogna_edf_theory.v ./analysis/apa/bertogna_fp_comp.v ./analysis/apa/interference_bound_edf.v ./analysis/apa/workload_bound.v ./analysis/apa/bertogna_edf_comp.v ./analysis/apa/bertogna_fp_theory.v ./analysis/apa/interference_bound.v ./analysis/apa/interference_bound_fp.v ./analysis/apa/bertogna_edf_theory.v ./analysis/uni/susp/dynamic/oblivious/fp_rta.v ./analysis/uni/susp/dynamic/oblivious/reduction.v ./analysis/uni/jitter/workload_bound_fp.v ./analysis/uni/jitter/fp_rta_comp.v ./analysis/uni/jitter/fp_rta_theory.v ./analysis/uni/basic/workload_bound_fp.v ./analysis/uni/basic/fp_rta_comp.v ./analysis/uni/basic/fp_rta_theory.v ./model/suspension.v ./model/schedule/partitioned/schedulability.v ./model/schedule/partitioned/schedule.v ./model/schedule/global/workload.v ./model/schedule/global/schedulability.v ./model/schedule/global/jitter/interference_edf.v ./model/schedule/global/jitter/interference.v ./model/schedule/global/jitter/job.v ./model/schedule/global/jitter/constrained_deadlines.v ./model/schedule/global/jitter/schedule.v ./model/schedule/global/jitter/platform.v ./model/schedule/global/response_time.v ./model/schedule/global/basic/interference_edf.v ./model/schedule/global/basic/interference.v ./model/schedule/global/basic/constrained_deadlines.v ./model/schedule/global/basic/schedule.v ./model/schedule/global/basic/platform.v ./model/schedule/apa/interference_edf.v ./model/schedule/apa/interference.v ./model/schedule/apa/affinity.v ./model/schedule/apa/constrained_deadlines.v ./model/schedule/apa/platform.v ./model/schedule/uni/workload.v ./model/schedule/uni/transformation/construction.v ./model/schedule/uni/susp/suspension_intervals.v ./model/schedule/uni/susp/last_execution.v ./model/schedule/uni/susp/schedule.v ./model/schedule/uni/susp/platform.v ./model/schedule/uni/schedulability.v ./model/schedule/uni/jitter/workload.v ./model/schedule/uni/jitter/busy_interval.v ./model/schedule/uni/jitter/schedule.v ./model/schedule/uni/jitter/platform.v ./model/schedule/uni/jitter/service.v ./model/schedule/uni/schedule_of_task.v ./model/schedule/uni/response_time.v ./model/schedule/uni/schedule.v ./model/schedule/uni/basic/busy_interval.v ./model/schedule/uni/basic/platform.v ./model/schedule/uni/service.v ./model/arrival/jitter/arrival_sequence.v ./model/arrival/jitter/task_arrival.v ./model/arrival/jitter/job.v ./model/arrival/jitter/arrival_bounds.v ./model/arrival/basic/arrival_sequence.v ./model/arrival/basic/task.v ./model/arrival/basic/task_arrival.v ./model/arrival/basic/job.v ./model/arrival/basic/arrival_bounds.v ./model/priority.v ./model/time.v ./implementation/arrival_sequence.v ./implementation/task.v ./implementation/global/jitter/arrival_sequence.v ./implementation/global/jitter/task.v ./implementation/global/jitter/bertogna_edf_example.v ./implementation/global/jitter/job.v ./implementation/global/jitter/bertogna_fp_example.v ./implementation/global/jitter/schedule.v ./implementation/global/parallel/bertogna_edf_example.v ./implementation/global/parallel/bertogna_fp_example.v ./implementation/global/basic/bertogna_edf_example.v ./implementation/global/basic/bertogna_fp_example.v ./implementation/global/basic/schedule.v ./implementation/job.v ./implementation/apa/arrival_sequence.v ./implementation/apa/task.v ./implementation/apa/bertogna_edf_example.v ./implementation/apa/job.v ./implementation/apa/bertogna_fp_example.v ./implementation/apa/schedule.v ./implementation/uni/susp/dynamic/arrival_sequence.v ./implementation/uni/susp/dynamic/task.v ./implementation/uni/susp/dynamic/job.v ./implementation/uni/susp/dynamic/oblivious/fp_rta_example.v ./implementation/uni/susp/schedule.v ./implementation/uni/jitter/arrival_sequence.v ./implementation/uni/jitter/task.v ./implementation/uni/jitter/job.v ./implementation/uni/jitter/fp_rta_example.v ./implementation/uni/jitter/schedule.v ./implementation/uni/basic/fp_rta_example.v ./implementation/uni/basic/schedule.v -o Makefile
# coq_makefile -f _CoqProject ./util/ssromega.v ./util/seqset.v ./util/sorting.v ./util/step_function.v ./util/minmax.v ./util/powerset.v ./util/all.v ./util/ord_quantifier.v ./util/nat.v ./util/sum.v ./util/bigord.v ./util/counting.v ./util/tactics.v ./util/induction.v ./util/list.v ./util/divround.v ./util/bigcat.v ./util/fixedpoint.v ./util/notation.v ./analysis/global/jitter/bertogna_fp_comp.v ./analysis/global/jitter/interference_bound_edf.v ./analysis/global/jitter/workload_bound.v ./analysis/global/jitter/bertogna_edf_comp.v ./analysis/global/jitter/bertogna_fp_theory.v ./analysis/global/jitter/interference_bound.v ./analysis/global/jitter/interference_bound_fp.v ./analysis/global/jitter/bertogna_edf_theory.v ./analysis/global/parallel/bertogna_fp_comp.v ./analysis/global/parallel/interference_bound_edf.v ./analysis/global/parallel/workload_bound.v ./analysis/global/parallel/bertogna_edf_comp.v ./analysis/global/parallel/bertogna_fp_theory.v ./analysis/global/parallel/interference_bound.v ./analysis/global/parallel/interference_bound_fp.v ./analysis/global/parallel/bertogna_edf_theory.v ./analysis/global/basic/bertogna_fp_comp.v ./analysis/global/basic/interference_bound_edf.v ./analysis/global/basic/workload_bound.v ./analysis/global/basic/bertogna_edf_comp.v ./analysis/global/basic/bertogna_fp_theory.v ./analysis/global/basic/interference_bound.v ./analysis/global/basic/interference_bound_fp.v ./analysis/global/basic/bertogna_edf_theory.v ./analysis/apa/bertogna_fp_comp.v ./analysis/apa/interference_bound_edf.v ./analysis/apa/workload_bound.v ./analysis/apa/bertogna_edf_comp.v ./analysis/apa/bertogna_fp_theory.v ./analysis/apa/interference_bound.v ./analysis/apa/interference_bound_fp.v ./analysis/apa/bertogna_edf_theory.v ./analysis/uni/susp/dynamic/oblivious/fp_rta.v ./analysis/uni/susp/dynamic/oblivious/reduction.v ./analysis/uni/jitter/workload_bound_fp.v ./analysis/uni/jitter/fp_rta_comp.v ./analysis/uni/jitter/fp_rta_theory.v ./analysis/uni/basic/workload_bound_fp.v ./analysis/uni/basic/fp_rta_comp.v ./analysis/uni/basic/fp_rta_theory.v ./model/suspension.v ./model/schedule/partitioned/schedulability.v ./model/schedule/partitioned/schedule.v ./model/schedule/global/workload.v ./model/schedule/global/transformation/construction.v ./model/schedule/global/schedulability.v ./model/schedule/global/jitter/interference_edf.v ./model/schedule/global/jitter/interference.v ./model/schedule/global/jitter/job.v ./model/schedule/global/jitter/constrained_deadlines.v ./model/schedule/global/jitter/schedule.v ./model/schedule/global/jitter/platform.v ./model/schedule/global/response_time.v ./model/schedule/global/basic/interference_edf.v ./model/schedule/global/basic/interference.v ./model/schedule/global/basic/constrained_deadlines.v ./model/schedule/global/basic/schedule.v ./model/schedule/global/basic/platform.v ./model/schedule/apa/interference_edf.v ./model/schedule/apa/interference.v ./model/schedule/apa/affinity.v ./model/schedule/apa/constrained_deadlines.v ./model/schedule/apa/platform.v ./model/schedule/uni/workload.v ./model/schedule/uni/transformation/construction.v ./model/schedule/uni/susp/suspension_intervals.v ./model/schedule/uni/susp/last_execution.v ./model/schedule/uni/susp/schedule.v ./model/schedule/uni/susp/platform.v ./model/schedule/uni/schedulability.v ./model/schedule/uni/jitter/busy_interval.v ./model/schedule/uni/jitter/schedule.v ./model/schedule/uni/jitter/platform.v ./model/schedule/uni/schedule_of_task.v ./model/schedule/uni/response_time.v ./model/schedule/uni/schedule.v ./model/schedule/uni/basic/busy_interval.v ./model/schedule/uni/basic/platform.v ./model/schedule/uni/service.v ./model/arrival/jitter/arrival_sequence.v ./model/arrival/jitter/task_arrival.v ./model/arrival/jitter/job.v ./model/arrival/jitter/arrival_bounds.v ./model/arrival/basic/arrival_sequence.v ./model/arrival/basic/task.v ./model/arrival/basic/task_arrival.v ./model/arrival/basic/job.v ./model/arrival/basic/arrival_bounds.v ./model/priority.v ./model/time.v ./implementation/arrival_sequence.v ./implementation/task.v ./implementation/global/jitter/arrival_sequence.v ./implementation/global/jitter/task.v ./implementation/global/jitter/bertogna_edf_example.v ./implementation/global/jitter/job.v ./implementation/global/jitter/bertogna_fp_example.v ./implementation/global/jitter/schedule.v ./implementation/global/parallel/bertogna_edf_example.v ./implementation/global/parallel/bertogna_fp_example.v ./implementation/global/basic/bertogna_edf_example.v ./implementation/global/basic/bertogna_fp_example.v ./implementation/global/basic/schedule.v ./implementation/job.v ./implementation/apa/arrival_sequence.v ./implementation/apa/task.v ./implementation/apa/bertogna_edf_example.v ./implementation/apa/job.v ./implementation/apa/bertogna_fp_example.v ./implementation/apa/schedule.v ./implementation/uni/susp/dynamic/arrival_sequence.v ./implementation/uni/susp/dynamic/task.v ./implementation/uni/susp/dynamic/job.v ./implementation/uni/susp/dynamic/oblivious/fp_rta_example.v ./implementation/uni/susp/schedule.v ./implementation/uni/jitter/arrival_sequence.v ./implementation/uni/jitter/task.v ./implementation/uni/jitter/job.v ./implementation/uni/jitter/fp_rta_example.v ./implementation/uni/jitter/schedule.v ./implementation/uni/basic/fp_rta_example.v ./implementation/uni/basic/schedule.v -o Makefile
#
.DEFAULT_GOAL := all
......@@ -157,6 +157,7 @@ VFILES:=util/ssromega.v\
model/schedule/partitioned/schedulability.v\
model/schedule/partitioned/schedule.v\
model/schedule/global/workload.v\
model/schedule/global/transformation/construction.v\
model/schedule/global/schedulability.v\
model/schedule/global/jitter/interference_edf.v\
model/schedule/global/jitter/interference.v\
......@@ -182,11 +183,9 @@ VFILES:=util/ssromega.v\
model/schedule/uni/susp/schedule.v\
model/schedule/uni/susp/platform.v\
model/schedule/uni/schedulability.v\
model/schedule/uni/jitter/workload.v\
model/schedule/uni/jitter/busy_interval.v\
model/schedule/uni/jitter/schedule.v\
model/schedule/uni/jitter/platform.v\
model/schedule/uni/jitter/service.v\
model/schedule/uni/schedule_of_task.v\
model/schedule/uni/response_time.v\
model/schedule/uni/schedule.v\
......
......@@ -16,6 +16,7 @@ Module ResponseTimeIterationEDF.
Variable task_deadline: sporadic_task -> time.
Context {Job: eqType}.
Variable job_arrival: Job -> time.
Variable job_cost: Job -> time.
Variable job_deadline: Job -> time.
Variable job_task: Job -> sporadic_task.
......@@ -883,46 +884,51 @@ Module ResponseTimeIterationEDF.
forall tsk, tsk \in ts -> is_subaffinity (alpha' tsk) (alpha tsk).
(* Next, consider any arrival sequence such that...*)
Context {arr_seq: arrival_sequence Job}.
Variable arr_seq: arrival_sequence Job.
(* ...all jobs come from task set ts, ...*)
Hypothesis H_all_jobs_from_taskset:
forall (j: JobIn arr_seq), job_task j \in ts.
forall j,
arrives_in arr_seq j -> job_task j \in ts.
(* ...they have valid parameters,...*)
Hypothesis H_valid_job_parameters:
forall (j: JobIn arr_seq),
forall j,
arrives_in arr_seq j ->
valid_sporadic_job task_cost task_deadline job_cost job_deadline job_task j.
(* ... and satisfy the sporadic task model.*)
Hypothesis H_sporadic_tasks:
sporadic_task_model task_period arr_seq job_task.
sporadic_task_model task_period job_arrival job_task arr_seq.
(* Then, consider any schedule with at least one CPU such that...*)
Variable sched: schedule num_cpus arr_seq.
Variable sched: schedule Job num_cpus.
Hypothesis H_jobs_come_from_arrival_sequence:
jobs_come_from_arrival_sequence sched arr_seq.
(* ...jobs only execute after they arrived and no longer
than their execution costs,... *)
Hypothesis H_jobs_must_arrive_to_execute:
jobs_must_arrive_to_execute sched.
Hypothesis H_completed_jobs_dont_execute:
completed_jobs_dont_execute job_cost sched.
Hypothesis H_jobs_must_arrive_to_execute: jobs_must_arrive_to_execute job_arrival sched.
Hypothesis H_completed_jobs_dont_execute: completed_jobs_dont_execute job_cost sched.
(* ...and jobs are sequential. *)
Hypothesis H_sequential_jobs: sequential_jobs sched.
(* Assume a work-conserving APA scheduler that respects EDF policy. *)
Hypothesis H_respects_affinity: respects_affinity job_task sched alpha.
Hypothesis H_work_conserving: apa_work_conserving job_cost job_task sched alpha.
Hypothesis H_edf_policy: respects_JLFP_policy_under_weak_APA job_cost job_task sched alpha (EDF job_deadline).
Hypothesis H_work_conserving: apa_work_conserving job_arrival job_cost job_task arr_seq
sched alpha.
Hypothesis H_edf_policy:
respects_JLFP_policy_under_weak_APA job_arrival job_cost job_task
arr_seq sched alpha (EDF job_arrival job_deadline).
(* To avoid a long list of parameters, we provide some local definitions. *)
Definition no_deadline_missed_by_task (tsk: sporadic_task) :=
task_misses_no_deadline job_cost job_deadline job_task sched tsk.
task_misses_no_deadline job_arrival job_cost job_deadline job_task arr_seq sched tsk.
Definition no_deadline_missed_by_job :=
job_misses_no_deadline job_cost job_deadline sched.
job_misses_no_deadline job_arrival job_cost job_deadline sched.
Let response_time_bounded_by (tsk: sporadic_task) :=
is_response_time_bound_of_task job_cost job_task tsk sched.
is_response_time_bound_of_task job_arrival job_cost job_task arr_seq sched tsk.
(* In the following theorem, we prove that any response-time bound contained
in edf_claimed_bounds is safe. The proof follows by direct application of
......@@ -933,12 +939,12 @@ Module ResponseTimeIterationEDF.
response_time_bounded_by tsk R.
Proof.
have BOUND := bertogna_cirinei_response_time_bound_edf.
intros tsk R IN j JOBj.
intros tsk R IN j ARRj JOBj.
destruct (edf_claimed_bounds ts) as [rt_bounds |] eqn:SOME; last by done.
unfold edf_rta_iteration in *.
unfold is_response_time_bound_of_task in *.
apply BOUND with (task_cost := task_cost) (task_period := task_period)
(task_deadline := task_deadline) (job_deadline := job_deadline)
(arr_seq := arr_seq) (task_deadline := task_deadline) (job_deadline := job_deadline)
(job_task := job_task) (ts := ts) (tsk := tsk) (rt_bounds := rt_bounds) (alpha := alpha) (alpha' := alpha'); try (by ins).
by unfold edf_claimed_bounds in SOME; desf; rewrite edf_claimed_bounds_unzip1_iteration.
by ins; apply edf_claimed_bounds_finds_fixed_point_for_each_bound with (ts := ts).
......@@ -960,10 +966,10 @@ Module ResponseTimeIterationEDF.
edf_schedulable,
valid_sporadic_job in *.
rename H_valid_job_parameters into JOBPARAMS.
intros tsk INtsk j JOBtsk.
intros tsk INtsk j ARRj JOBtsk.
destruct (edf_claimed_bounds ts) as [rt_bounds |] eqn:SOME; last by ins.
exploit (HAS rt_bounds tsk); [by ins | by ins | clear HAS; intro HAS; des].
have COMPLETED := RLIST tsk R HAS j JOBtsk.
have COMPLETED := RLIST tsk R HAS j ARRj JOBtsk.
exploit (DL rt_bounds tsk R);
[by ins | by ins | clear DL; intro DL].
......@@ -972,7 +978,7 @@ Module ResponseTimeIterationEDF.
{
unfold valid_sporadic_taskset, is_valid_sporadic_task in *.
apply extend_sum; rewrite // leq_add2l.
specialize (JOBPARAMS j); des; rewrite JOBPARAMS1.
specialize (JOBPARAMS j ARRj); des; rewrite JOBPARAMS1.
by rewrite JOBtsk.
}
rewrite leq_eqVlt; apply/orP; left; rewrite eq_sym.
......@@ -983,12 +989,12 @@ Module ResponseTimeIterationEDF.
are spawned by the task set, we conclude that no job misses
its deadline. *)
Theorem jobs_schedulable_by_edf_rta :
forall (j: JobIn arr_seq), no_deadline_missed_by_job j.
forall j, arrives_in arr_seq j -> no_deadline_missed_by_job j.
Proof.
intros j.
intros j ARRj.
have SCHED := taskset_schedulable_by_edf_rta.
unfold no_deadline_missed_by_task, task_misses_no_deadline in *.
apply SCHED with (tsk := job_task j); last by done.
apply SCHED with (tsk := job_task j); try (by done).
by apply H_all_jobs_from_taskset.
Qed.
......
......@@ -26,18 +26,20 @@ Module ResponseTimeAnalysisEDF.
Variable task_deadline: sporadic_task -> time.
Context {Job: eqType}.
Variable job_arrival: Job -> time.
Variable job_cost: Job -> time.
Variable job_deadline: Job -> time.
Variable job_task: Job -> sporadic_task.
(* Assume any job arrival sequence... *)
Context {arr_seq: arrival_sequence Job}.
Variable arr_seq: arrival_sequence Job.
(* ... in which jobs arrive sporadically and have valid parameters. *)
Hypothesis H_sporadic_tasks:
sporadic_task_model task_period arr_seq job_task.
sporadic_task_model task_period job_arrival job_task arr_seq.
Hypothesis H_valid_job_parameters:
forall (j: JobIn arr_seq),
forall j,
arrives_in arr_seq j ->
valid_sporadic_job task_cost task_deadline job_cost job_deadline job_task j.
(* Consider a task set ts where all tasks have valid parameters
......@@ -50,35 +52,37 @@ Module ResponseTimeAnalysisEDF.
(* ... and assume that all jobs in the arrival sequence come from the task set. *)
Hypothesis H_all_jobs_from_taskset:
forall (j: JobIn arr_seq), job_task j \in ts.
forall j, arrives_in arr_seq j -> job_task j \in ts.
(* Also assume that every task has a non-empty processor affinity alpha. *)
Context {num_cpus: nat}.
Variable alpha: task_affinity sporadic_task num_cpus.
(* Next, consider any schedule such that...*)
Variable sched: schedule num_cpus arr_seq.
Variable sched: schedule Job num_cpus.
Hypothesis H_jobs_come_from_arrival_sequence:
jobs_come_from_arrival_sequence sched arr_seq.
(* ...jobs are sequential and do not execute before their
arrival times nor longer than their execution costs. *)
Hypothesis H_sequential_jobs: sequential_jobs sched.
Hypothesis H_jobs_must_arrive_to_execute:
jobs_must_arrive_to_execute sched.
Hypothesis H_completed_jobs_dont_execute:
completed_jobs_dont_execute job_cost sched.
Hypothesis H_jobs_must_arrive_to_execute: jobs_must_arrive_to_execute job_arrival sched.
Hypothesis H_completed_jobs_dont_execute: completed_jobs_dont_execute job_cost sched.
(* Assume that the schedule is an work-conserving APA schedule that
respects EDF priorities. *)
Hypothesis H_respects_affinity: respects_affinity job_task sched alpha.
Hypothesis H_work_conserving: apa_work_conserving job_cost job_task sched alpha.
Hypothesis H_work_conserving: apa_work_conserving job_arrival job_cost job_task arr_seq
sched alpha.
Hypothesis H_edf_policy:
respects_JLFP_policy_under_weak_APA job_cost job_task sched alpha (EDF job_deadline).
respects_JLFP_policy_under_weak_APA job_arrival job_cost job_task arr_seq
sched alpha (EDF job_arrival job_deadline).
(* Let's define some local names to avoid passing many parameters. *)
Let no_deadline_is_missed_by_tsk (tsk: sporadic_task) :=
task_misses_no_deadline job_cost job_deadline job_task sched tsk.
task_misses_no_deadline job_arrival job_cost job_deadline job_task arr_seq sched tsk.
Let response_time_bounded_by (tsk: sporadic_task) :=
is_response_time_bound_of_task job_cost job_task tsk sched.
is_response_time_bound_of_task job_arrival job_cost job_task arr_seq sched tsk.
(* Now we consider the response-time recurrence. In the computation of
the response-time bound, we assume that each task under analysis has
......@@ -119,7 +123,8 @@ Module ResponseTimeAnalysisEDF.
Hypothesis H_tsk_R_in_rt_bounds: (tsk, R) \in rt_bounds.
(* Consider any job j of tsk ... *)
Variable j: JobIn arr_seq.
Variable j: Job.
Hypothesis H_j_arrives: arrives_in arr_seq j.
Hypothesis H_job_of_tsk: job_task j = tsk.
(* ... that did not complete on time, ... *)
......@@ -127,7 +132,8 @@ Module ResponseTimeAnalysisEDF.
(* ... and that is the first job not to satisfy its response-time bound. *)
Hypothesis H_all_previous_jobs_completed_on_time :
forall (j_other: JobIn arr_seq) tsk_other R_other,
forall j_other tsk_other R_other,
arrives_in arr_seq j_other ->
job_task j_other = tsk_other ->
(tsk_other, R_other) \in rt_bounds ->
job_arrival j_other + R_other < job_arrival j + R ->
......@@ -135,11 +141,11 @@ Module ResponseTimeAnalysisEDF.
(* Let's call x the interference incurred by job j due to tsk_other, ...*)
Let x (tsk_other: sporadic_task) :=
task_interference job_cost job_task sched alpha j
task_interference job_arrival job_cost job_task sched alpha j
tsk_other (job_arrival j) (job_arrival j + R).
(* and X the total interference incurred by job j due to any task. *)
Let X := total_interference job_cost sched j (job_arrival j) (job_arrival j + R).
Let X := total_interference job_arrival job_cost sched j (job_arrival j) (job_arrival j + R).
(* Recall Bertogna and Cirinei's workload bound ... *)
Let workload_bound (tsk_other: sporadic_task) (R_other: time) :=
......@@ -201,7 +207,8 @@ Module ResponseTimeAnalysisEDF.
(job_arrival j) (job_arrival j + R));
first by apply task_interference_le_workload.
by apply workload_bounded_by_W with (task_deadline0 := task_deadline)
(job_cost0 := job_cost) (job_deadline0 := job_deadline); try (by ins); last 2 first;
(job_arrival0 := job_arrival) (arr_seq0 := arr_seq)
(job_cost0 := job_cost) (job_deadline0 := job_deadline); try (by ins); last 2 first;
[ by apply bertogna_edf_R_other_ge_cost
| by ins; apply NOMISS
| by ins; apply TASK_PARAMS
......@@ -214,7 +221,7 @@ Module ResponseTimeAnalysisEDF.
x tsk_other <= edf_specific_bound tsk_other R_other.
Proof.
apply interference_bound_edf_bounds_interference with (job_deadline0 := job_deadline)
(ts0 := ts); try (by done);
(arr_seq0 := arr_seq) (ts0 := ts); try (by done);
[ by apply bertogna_edf_tsk_other_in_ts
| by apply H_tasks_miss_no_deadlines
| by apply H_tasks_miss_no_deadlines | ].
......@@ -246,12 +253,12 @@ Module ResponseTimeAnalysisEDF.
by apply cumulative_service_le_job_cost.
}
apply leq_ltn_trans with (n := (\sum_(job_arrival j <= t < job_arrival j + R)
backlogged job_cost sched j t) +
backlogged job_arrival job_cost sched j t) +
service sched j (job_arrival j + R)); last first.
{
rewrite -addn1 -addnA leq_add2l addn1.
apply leq_trans with (n := job_cost j); first by done.
by specialize (PARAMS j); des; rewrite -JOBtsk.
by specialize (PARAMS j H_j_arrives); des; rewrite -JOBtsk.
}
unfold service; rewrite service_before_arrival_eq_service_during //.
rewrite -big_split /=.
......@@ -259,7 +266,7 @@ Module ResponseTimeAnalysisEDF.
first by rewrite big_const_nat iter_addn mul1n addn0 addKn.
rewrite big_nat_cond [\sum_(_ <= _ < _ | true) _]big_nat_cond.
apply leq_sum; move => i /andP [/andP [GEi LTi] _].
destruct (backlogged job_cost sched j i) eqn:BACK;
destruct (backlogged job_arrival job_cost sched j i) eqn:BACK;
first by rewrite -addn1 addnC; apply leq_add.
apply negbT in BACK.
rewrite add0n lt0n -not_scheduled_no_service negbK.
......@@ -278,7 +285,8 @@ Module ResponseTimeAnalysisEDF.
Lemma bertogna_edf_interference_by_different_tasks :
forall t j_other,
job_arrival j <= t < job_arrival j + R ->
backlogged job_cost sched j t ->
arrives_in arr_seq j_other ->
backlogged job_arrival job_cost sched j t ->
scheduled sched j_other t ->
job_task j_other != tsk.
Proof.
......@@ -290,18 +298,19 @@ Module ResponseTimeAnalysisEDF.
H_all_previous_jobs_completed_on_time into BEFOREok,
H_tasks_miss_no_deadlines into NOMISS,
H_constrained_deadlines into RESTR.
move => t j_other /andP [LEt GEt] BACK SCHED.
move => t j_other /andP [LEt GEt] ARRother BACK SCHED.
apply/eqP; red; intro SAMEtsk.
move: SCHED => /existsP [cpu SCHED].
assert (SCHED': scheduled sched j_other t).
by apply/existsP; exists cpu.
clear SCHED; rename SCHED' into SCHED.
move: (SCHED) => PENDING.
apply scheduled_implies_pending with (job_cost0 := job_cost) in PENDING; try (by done).
apply scheduled_implies_pending with (job_arrival0 := job_arrival) (job_cost0 := job_cost)
in PENDING; try (by done).
destruct (ltnP (job_arrival j_other) (job_arrival j)) as [BEFOREother | BEFOREj].
{
move: (BEFOREother) => LT; rewrite -(ltn_add2r R) in LT.
specialize (BEFOREok j_other tsk R SAMEtsk INbounds LT).
specialize (BEFOREok j_other tsk R ARRother SAMEtsk INbounds LT).
move: PENDING => /andP [_ /negP NOTCOMP]; apply NOTCOMP.
apply completion_monotonic with (t0 := job_arrival j_other + R); try (by done).
apply leq_trans with (n := job_arrival j); last by done.
......@@ -309,12 +318,12 @@ Module ResponseTimeAnalysisEDF.
first by rewrite leq_add2l; apply NOMISS.
apply leq_trans with (n := job_arrival j_other + task_period tsk);
first by rewrite leq_add2l; apply RESTR; rewrite -JOBtsk FROMTS.
rewrite -SAMEtsk; apply SPO; [ | by rewrite JOBtsk | by apply ltnW].
rewrite -SAMEtsk; apply SPO; try (by done); [ | by rewrite JOBtsk | by apply ltnW].
by red; intro EQ; subst; rewrite ltnn in BEFOREother.
}
{
move: PENDING => /andP [ARRIVED _].
exploit (SPO j j_other); [ | by rewrite SAMEtsk | by done | ]; last first.
exploit (SPO j j_other); try (by done); [ | by rewrite SAMEtsk | ]; last first.
{
apply/negP; rewrite -ltnNge.
apply leq_ltn_trans with (n := t); first by done.
......@@ -333,7 +342,8 @@ Module ResponseTimeAnalysisEDF.
With this lemma, we can conclude that during job j's scheduling
window there cannot be multiple pending jobs of each task.*)
Lemma bertogna_edf_all_previous_jobs_complete_by_their_period:
forall t (j0: JobIn arr_seq),
forall t j0,
arrives_in arr_seq j0 ->
t < job_arrival j + R ->
job_arrival j0 + task_period (job_task j0) <= t ->
completed job_cost sched j0
......@@ -344,7 +354,7 @@ Module ResponseTimeAnalysisEDF.
H_tasks_miss_no_deadlines into NOMISS,
H_all_jobs_from_taskset into FROMTS,
H_all_previous_jobs_completed_on_time into BEFOREok.
intros t j0 LEt LE.
intros t j0 ARR0 LEt LE.
cut ((job_task j0) \in unzip1 rt_bounds = true); last by rewrite UNZIP FROMTS.
move => /mapP [p IN EQ]; destruct p as [tsk' R0]; simpl in *; subst tsk'.
apply completion_monotonic with (t0 := job_arrival j0 + R0); first by done.
......@@ -370,7 +380,7 @@ Module ResponseTimeAnalysisEDF.
Proof.
have DIFFTASK := bertogna_edf_interference_by_different_tasks.
rename H_all_jobs_from_taskset into FROMTS,
H_valid_task_parameters into PARAMS,
H_valid_task_parameters into PARAMS, H_jobs_come_from_arrival_sequence into FROMSEQ,
H_job_of_tsk into JOBtsk, H_sporadic_tasks into SPO,
H_work_conserving into WORK,
H_tsk_R_in_rt_bounds into INbounds,
......@@ -382,9 +392,9 @@ Module ResponseTimeAnalysisEDF.
unfold sporadic_task_model in *.
unfold x, X, total_interference, task_interference.
rewrite -big_mkcond -exchange_big big_distrl /= mul1n.
rewrite [\sum_(_ <= _ < _ | backlogged _ _ _ _) _]big_mkcond.
rewrite [\sum_(_ <= _ < _ | backlogged _ _ _ _ _) _]big_mkcond.
apply eq_big_nat; move => t /andP [GEt LTt].
destruct (backlogged job_cost sched j t) eqn:BACK; last first.
destruct (backlogged job_arrival job_cost sched j t) eqn:BACK; last first.
{
rewrite (eq_bigr (fun i => 0));
first by rewrite big_const_seq iter_addn mul0n addn0.
......@@ -401,7 +411,9 @@ Module ResponseTimeAnalysisEDF.
destruct (cpu \in alpha (job_task j)) eqn:ALPHA; rewrite -?JOBtsk ALPHA;
last by rewrite big_filter (eq_bigr (fun x => 0));
[by simpl_sum_const | by ins].
move: (WORK j t BACK cpu ALPHA) => [j_other /eqP SCHED]; unfold scheduled_on in *.
move: (WORK j t H_j_arrives BACK cpu ALPHA) => [j_other /eqP SCHED]; unfold scheduled_on in *.
have ARRother: arrives_in arr_seq j_other.
by apply (FROMSEQ j_other t); apply/existsP; exists cpu; apply/eqP.
rewrite (bigD1_seq (job_task j_other)) /=; last by rewrite filter_uniq; destruct ts.
{
rewrite (eq_bigr (fun i => 0));
......@@ -416,7 +428,7 @@ Module ResponseTimeAnalysisEDF.
apply/existsP; exists cpu; rewrite -JOBtsk ALPHA andTb.
by apply APA with (t := t); apply/eqP.
}
apply DIFFTASK with (t := t); [by auto | by done |].
apply DIFFTASK with (t := t); try (by done); first by auto.
by apply/existsP; exists cpu; apply/eqP.
Qed.
......@@ -442,9 +454,9 @@ Module ResponseTimeAnalysisEDF.
unfold sporadic_task_model in *.
unfold x, X, total_interference, task_interference.
rewrite -big_mkcond -exchange_big big_distrl /= mul1n.
rewrite [\sum_(_ <= _ < _ | backlogged _ _ _ _) _]big_mkcond /=.
rewrite [\sum_(_ <= _ < _ | backlogged _ _ _ _ _) _]big_mkcond /=.
apply leq_sum_nat; move => t /andP [GEt LTt] _.
destruct (backlogged job_cost sched j t) eqn:BACK; last first.
destruct (backlogged job_arrival job_cost sched j t) eqn:BACK; last first.
{
rewrite (eq_bigr (fun i => 0));
first by rewrite big_const_seq iter_addn mul0n addn0.
......@@ -460,11 +472,14 @@ Module ResponseTimeAnalysisEDF.
unfold can_execute_on in *.
destruct (cpu \in alpha' (job_task j)) eqn:ALPHA'; rewrite -?JOBtsk ALPHA';
last by done.
move: (SUB (job_task j) (FROMTS j) cpu ALPHA') => SUBj.
move: (WORK j t BACK cpu SUBj) => [j_other /eqP SCHED]; unfold scheduled_on in *.
feed (SUB (job_task j)); first by apply FROMTS.
specialize (SUB cpu ALPHA').
move: (WORK j t H_j_arrives BACK cpu SUB) => [j_other /eqP SCHED]; unfold scheduled_on in *.
have ARRother: arrives_in arr_seq j_other.
by apply (H_jobs_come_from_arrival_sequence j_other t); apply/existsP; exists cpu; apply/eqP.
rewrite (bigD1_seq (job_task j_other)) /=; last by apply filter_uniq; destruct ts.
{
by rewrite {1}/task_scheduled_on SUBj SCHED eq_refl andTb.
by rewrite {1}/task_scheduled_on SUB SCHED eq_refl andTb.
}
{
rewrite mem_filter; apply/andP; split; last by apply FROMTS.
......@@ -473,7 +488,7 @@ Module ResponseTimeAnalysisEDF.
apply/existsP; exists cpu; apply/andP; split; first by rewrite -JOBtsk.
by apply APA with (t := t); apply/eqP.
}
apply DIFFTASK with (t := t); [by auto | by done |].
apply DIFFTASK with (t := t); try (by done); first by auto.
by apply/existsP; exists cpu; apply/eqP.
}
Qed.
......@@ -489,18 +504,18 @@ Module ResponseTimeAnalysisEDF.
Lemma bertogna_edf_alpha'_is_full:
forall t,
job_arrival j <= t < job_arrival j + R ->
backlogged job_cost sched j t ->
backlogged job_arrival job_cost sched j t ->
count (scheduled_on_alpha_tsk t) (other_tasks_in alpha') >= #|alpha' tsk|.
Proof.
have COMP := bertogna_edf_all_previous_jobs_complete_by_their_period.
rename H_work_conserving into WORK, H_respects_affinity into APA,
H_affinity_subset into SUB, H_job_of_tsk into JOBtsk,
H_all_jobs_from_taskset into FROMTS,
H_all_jobs_from_taskset into FROMTS, H_jobs_come_from_arrival_sequence into FROMSEQ,
H_valid_task_parameters into PARAMS,
H_sequential_jobs into SEQ.
move => t /andP [GEt LTt] BACK.
move: WORK => WORK.
specialize (WORK j t BACK).
specialize (WORK j t H_j_arrives BACK).
rewrite -size_filter.
apply leq_trans with (n := size (alpha' tsk));
first by apply card_size.
......@@ -514,7 +529,7 @@ Module ResponseTimeAnalysisEDF.
by move: WORK => [j_other /eqP SCHED]; rewrite SCHED.
}
{
apply leq_trans with (n := size (map (fun j: JobIn arr_seq => job_task j) (pmap (fun cpu => sched cpu t) (enum (alpha' tsk)))));
apply leq_trans with (n := size (map (fun j => job_task j) (pmap (fun cpu => sched cpu t) (enum (alpha' tsk)))));
first by rewrite size_map.
apply uniq_leq_size.
{
......@@ -522,7 +537,7 @@ Module ResponseTimeAnalysisEDF.
{
apply pmap_inj_in_uniq; last by apply enum_uniq.
intros cpu1 cpu2 IN1 IN2 SCHED2.
destruct (sched cpu1 t) eqn:SCHED1; symmetry in SCHED2;
destruct (sched cpu1 t) as [j0|] eqn:SCHED1; symmetry in SCHED2;
first by apply SEQ with (j := j0) (t := t).
rewrite 2!mem_enum in IN1 IN2.
exploit (WORK cpu1); first by apply SUB; rewrite ?FROMTS ?JOBtsk.
......@@ -532,21 +547,26 @@ Module ResponseTimeAnalysisEDF.
intros j1 j2 SCHED1 SCHED2 SAMEtsk.
rewrite 2!mem_pmap in SCHED1 SCHED2.
move: SCHED1 SCHED2 => /mapP [cpu1 IN1 SCHED1] /mapP [cpu2 IN2 SCHED2].
assert (PENDING1: pending job_cost sched j1 t).
have ARR1: arrives_in arr_seq j1.
by apply (FROMSEQ j1 t); apply/existsP; exists cpu1; apply/eqP.
have ARR2: arrives_in arr_seq j2.
by apply (FROMSEQ j2 t); apply/existsP; exists cpu2; apply/eqP.
assert (PENDING1: pending job_arrival job_cost sched j1 t).
{
apply scheduled_implies_pending; try by done.
by apply/existsP; exists cpu1; rewrite /scheduled_on -SCHED1.
}
assert (SCHED2': pending job_cost sched j2 t).
assert (SCHED2': pending job_arrival job_cost sched j2 t).
{
apply scheduled_implies_pending; try by done.
by apply/existsP; exists cpu2; rewrite /scheduled_on -SCHED2.
}
apply platform_at_most_one_pending_job_of_each_task with (task_cost0 := task_cost)
(task_period0 := task_period) (task_deadline0 := task_deadline) (tsk0 := tsk)
(job_cost0 := job_cost) (job_task0 := job_task) (sched0 := sched) (j0 := j) (t0 := t);
rewrite ?JOBtsk ?SAMEtsk //; first by apply PARAMS; rewrite -JOBtsk FROMTS.
intros j0 tsk0 TSK0 LE.
(job_cost0 := job_cost) (job_task0 := job_task) (sched0 := sched) (j0 := j) (t0 := t)
(job_arrival0 := job_arrival) (arr_seq0 := arr_seq);
rewrite ?JOBtsk ?SAMEtsk //; first by apply PARAMS; rewrite -JOBtsk FROMTS.
intros j0 tsk0 ARR0 TSK0 LE.
by apply (COMP t); rewrite ?TSK0.
}
}
......@@ -561,6 +581,8 @@ Module ResponseTimeAnalysisEDF.
first by apply SUB; rewrite -?JOBtsk ?FROMTS ?JOBtsk.
by rewrite /task_scheduled_on -SCHED' EQtsk'.
}
have ARR': arrives_in arr_seq j'.
by apply (FROMSEQ j' t); apply/existsP; exists cpu; apply/eqP.
rewrite EQtsk' mem_filter; apply/andP; split; last by apply FROMTS.
apply/andP; split; last first.
{
......@@ -575,15 +597,16 @@ Module ResponseTimeAnalysisEDF.
by apply/existsP; exists cpu; rewrite /scheduled_on -SCHED'.
}
move: (SCHEDULED') => PENDING'.
apply scheduled_implies_pending with (job_cost0 := job_cost) in PENDING';
try by done.
apply scheduled_implies_pending with (job_cost0 := job_cost) (job_arrival0:=job_arrival)
in PENDING'; try by done.
assert (BUG: j = j').
{
apply platform_at_most_one_pending_job_of_each_task with (task_cost0 := task_cost)
(task_period0 := task_period) (task_deadline0 := task_deadline) (tsk0 := tsk)
(job_cost0 := job_cost) (job_task0 := job_task) (sched0 := sched) (j0 := j) (t0 := t);
rewrite ?JOBtsk ?SAMEtsk //; first by apply PARAMS; rewrite -JOBtsk FROMTS.
intros j0 tsk0 TSK0 LE.
(job_cost0 := job_cost) (job_task0 := job_task) (sched0 := sched) (j0 := j) (t0 := t)
(job_arrival0 := job_arrival) (arr_seq0 := arr_seq);
rewrite ?JOBtsk ?SAMEtsk //; first by apply PARAMS; rewrite -JOBtsk FROMTS.
intros j0 tsk0 ARR0 TSK0 LE.
by apply (COMP t); rewrite ?TSK0.
}
by rewrite BUG SCHEDULED' in NOTSCHED.
......@@ -611,7 +634,7 @@ Module ResponseTimeAnalysisEDF.
have INV := bertogna_edf_alpha'_is_full.
rename H_all_jobs_from_taskset into FROMTS,
H_valid_task_parameters into PARAMS,
H_job_of_tsk into JOBtsk,
H_job_of_tsk into JOBtsk, H_jobs_come_from_arrival_sequence into FROMSEQ,
H_sporadic_tasks into SPO,
H_tsk_R_in_rt_bounds into INbounds,
H_all_previous_jobs_completed_on_time into BEFOREok,
......@@ -623,12 +646,12 @@ Module ResponseTimeAnalysisEDF.
rewrite -has_count in HAS.
set some_interference_A := fun t =>
has (fun tsk_k => backlogged job_cost sched j t &&
has (fun tsk_k => backlogged job_arrival job_cost sched j t &&
(x tsk_k >= delta) &&
scheduled_on_alpha_tsk t tsk_k)
(other_tasks_in alpha').
set total_interference_B := fun t =>
backlogged job_cost sched j t *
backlogged job_arrival job_cost sched j t *
count (fun tsk_k => (x tsk_k < delta) &&
scheduled_on_alpha_tsk t tsk_k) (other_tasks_in alpha').
......@@ -640,7 +663,7 @@ Module ResponseTimeAnalysisEDF.
apply leq_trans with (n := x tsk_a); first by apply LEa.
unfold x, task_interference, some_interference_A.
apply leq_sum_nat; move => t /andP [GEt LTt] _.
destruct (backlogged job_cost sched j t) eqn:BACK;
destruct (backlogged job_arrival job_cost sched j t) eqn:BACK;
last by rewrite (eq_bigr (fun x => 0)); [by simpl_sum_const | by ins].
destruct ([exists cpu, can_execute_on alpha (job_task j) cpu &&
task_scheduled_on job_task sched tsk_a cpu t]) eqn:SCHED;
......@@ -670,21 +693,26 @@ Module ResponseTimeAnalysisEDF.
subst tsk_a; symmetry in JOB'.
assert (BUG: j1 = j2).
{
assert (PENDING1: pending job_cost sched j1 t).
have ARR1: arrives_in arr_seq j1.
by apply (FROMSEQ j1 t); apply/existsP; exists cpu; apply/eqP.
have ARR2: arrives_in arr_seq j2.
by apply (FROMSEQ j2 t); apply/existsP; exists cpu'; apply/eqP.
assert (PENDING1: pending job_arrival job_cost sched j1 t).
{
apply scheduled_implies_pending; try by done.
by apply/existsP; exists cpu; rewrite /scheduled_on -SCHED1.
}
assert (SCHED2': pending job_cost sched j2 t).
assert (SCHED2': pending job_arrival job_cost sched j2 t).
{
apply scheduled_implies_pending; try by done.
by apply/existsP; exists cpu'; rewrite /scheduled_on -SCHED2.
}
apply platform_at_most_one_pending_job_of_each_task with (task_cost0 := task_cost)
(task_period0 := task_period) (task_deadline0 := task_deadline) (tsk0 := tsk)
(job_cost0 := job_cost) (job_task0 := job_task) (sched0 := sched) (j0 := j) (t0 := t);
rewrite ?JOBtsk ?SAMEtsk //; first by apply PARAMS; rewrite -JOBtsk FROMTS.
intros j0 tsk0 TSK0 LE.
(job_cost0 := job_cost) (job_task0 := job_task) (sched0 := sched) (j0 := j) (t0 := t)
(job_arrival0 := job_arrival) (arr_seq0 := arr_seq);
rewrite ?JOBtsk ?SAMEtsk //; first by apply PARAMS; rewrite -JOBtsk FROMTS.
intros j0 tsk0 ARR0 TSK0 LE.
by apply (COMP t); rewrite ?TSK0.
}
by subst j2; apply SEQ with (j := j1) (t := t).
......@@ -696,7 +724,7 @@ Module ResponseTimeAnalysisEDF.
rewrite big_distrl /=.
apply leq_sum_nat; move => t LEt _.
unfold some_interference_A, total_interference_B.
destruct (backlogged job_cost sched j t) eqn:BACK;
destruct (backlogged job_arrival job_cost sched j t) eqn:BACK;
[rewrite mul1n /= | by rewrite has_pred0 //].
destruct (has (fun tsk_k : sporadic_task => (delta <= x tsk_k) &&
......@@ -724,7 +752,7 @@ Module ResponseTimeAnalysisEDF.
{
unfold x at 2, total_interference_B.
rewrite exchange_big /=; apply leq_sum; intros t _.
destruct (backlogged job_cost sched j t) eqn:BACK; last by ins.
destruct (backlogged job_arrival job_cost sched j t) eqn:BACK; last by ins.
rewrite mul1n -sum1_count.
rewrite big_mkcond [\sum_(i <- other_tasks_in alpha' | _ < _) _]big_mkcond /=.
apply leq_sum_seq; move => tsk_k IN _.
......@@ -929,7 +957,7 @@ Module ResponseTimeAnalysisEDF.
Theorem bertogna_cirinei_response_time_bound_edf :
response_time_bounded_by tsk R.
Proof.
intros j JOBtsk.
intros j ARRj JOBtsk.