Library prosa.analysis.facts.edf_definitions
Require Export prosa.analysis.facts.model.ideal_schedule.
Require Export prosa.analysis.facts.behavior.deadlines.
Require Export prosa.analysis.definitions.schedulability.
Require Export prosa.model.priority.edf.
Require Export prosa.model.schedule.edf.
Require Export prosa.model.schedule.priority_driven.
Require Export prosa.analysis.facts.behavior.deadlines.
Require Export prosa.analysis.definitions.schedulability.
Require Export prosa.model.priority.edf.
Require Export prosa.model.schedule.edf.
Require Export prosa.model.schedule.priority_driven.
Equivalence of EDF Definitions
... (2) the classic Liu & Layland model of readiness without jitter and
without self-suspensions, where pending jobs are always ready, and ...
... (3) that jobs are fully preemptive.
For any given type of jobs, each characterized by an arrival time,
an execution cost, and an absolute deadline, ...
...consider a given valid job arrival sequence ...
...and a corresponding schedule.
Suppose jobs don't execute after their completion, ...
...all jobs come from the arrival sequence arr_seq, ...
...and jobs from arr_seq don't miss their deadlines.
We first show that a schedule that satisfies the standalone
EDF_schedule predicate is also compliant with the generic notion of EDF
policy defined in Prosa, namely the respects_policy_at_preemption_point
predicate.
Lemma EDF_schedule_implies_respects_policy_at_preemption_point :
EDF_schedule sched →
respects_policy_at_preemption_point arr_seq sched.
Proof.
move⇒ EDF j' j t ARR PREEMPTION BL SCHED.
have suff: ∃ t' : nat, t ≤ t' < job_deadline j' ∧ scheduled_at sched j' t'.
{ move⇒ [t' [/andP [LE _] SCHED']].
apply: (EDF t); [done | exact LE | exact SCHED' |].
by apply: (backlogged_implies_arrived sched j' t). }
apply; apply: incomplete_implies_scheduled_later;
first by apply: H_no_deadline_misses ⇒ //.
by apply: (backlogged_implies_incomplete sched j' t).
Qed.
EDF_schedule sched →
respects_policy_at_preemption_point arr_seq sched.
Proof.
move⇒ EDF j' j t ARR PREEMPTION BL SCHED.
have suff: ∃ t' : nat, t ≤ t' < job_deadline j' ∧ scheduled_at sched j' t'.
{ move⇒ [t' [/andP [LE _] SCHED']].
apply: (EDF t); [done | exact LE | exact SCHED' |].
by apply: (backlogged_implies_arrived sched j' t). }
apply; apply: incomplete_implies_scheduled_later;
first by apply: H_no_deadline_misses ⇒ //.
by apply: (backlogged_implies_incomplete sched j' t).
Qed.
Conversely, the reverse direction also holds: a schedule that satisfies
the respects_policy_at_preemption_point predicate is also an EDF
schedule in the sense of EDF_schedule.
Lemma respects_policy_at_preemption_point_implies_EDF_schedule :
respects_policy_at_preemption_point arr_seq sched →
EDF_schedule sched.
Proof.
move⇒ H_priority_driven t j_hp SCHED t' j LEQ SCHED' EARLIER_ARR.
case (boolP (j == j_hp)); first by move /eqP ⇒ EQ; subst.
move /neqP ⇒ NEQ.
exploit (H_priority_driven j j_hp t) ⇒ //.
{ by apply (H_from_arr_seq _ _ SCHED'). }
{ by rewrite /preemption_time; destruct (sched t). }
{ apply /andP; split ⇒ //.
- apply /andP; split ⇒ //.
apply (incompletion_monotonic _ j _ _ LEQ).
apply scheduled_implies_not_completed ⇒ //.
by apply ideal_proc_model_ensures_ideal_progress.
- apply /negP; move ⇒ SCHED''.
by exploit (ideal_proc_model_is_a_uniprocessor_model j j_hp sched t). }
Qed.
respects_policy_at_preemption_point arr_seq sched →
EDF_schedule sched.
Proof.
move⇒ H_priority_driven t j_hp SCHED t' j LEQ SCHED' EARLIER_ARR.
case (boolP (j == j_hp)); first by move /eqP ⇒ EQ; subst.
move /neqP ⇒ NEQ.
exploit (H_priority_driven j j_hp t) ⇒ //.
{ by apply (H_from_arr_seq _ _ SCHED'). }
{ by rewrite /preemption_time; destruct (sched t). }
{ apply /andP; split ⇒ //.
- apply /andP; split ⇒ //.
apply (incompletion_monotonic _ j _ _ LEQ).
apply scheduled_implies_not_completed ⇒ //.
by apply ideal_proc_model_ensures_ideal_progress.
- apply /negP; move ⇒ SCHED''.
by exploit (ideal_proc_model_is_a_uniprocessor_model j j_hp sched t). }
Qed.
From the two preceding lemmas, it follows immediately that the two EDF
definitions are indeed equivalent, which we note with the following
corollary.
Corollary EDF_schedule_equiv:
EDF_schedule sched ↔ respects_policy_at_preemption_point arr_seq sched.
Proof.
split.
- by apply EDF_schedule_implies_respects_policy_at_preemption_point.
- by apply respects_policy_at_preemption_point_implies_EDF_schedule.
Qed.
End Equivalence.
EDF_schedule sched ↔ respects_policy_at_preemption_point arr_seq sched.
Proof.
split.
- by apply EDF_schedule_implies_respects_policy_at_preemption_point.
- by apply respects_policy_at_preemption_point_implies_EDF_schedule.
Qed.
End Equivalence.