Library prosa.analysis.definitions.finish_time
Finish Time of a Job
Consider any type of jobs with arrival times and costs ...
... and any schedule of such jobs.
Consider an arbitrary job j.
In the following, we proceed under the assumption that j finishes
eventually (i.e., no later than R time units after its arrival, for any
finite R).
For technical reasons, we restate the response-time assumption explicitly
as an existentially quantified variable.
#[local] Corollary job_finishes : ∃ t, completed_by sched j t.
Proof. by ∃ (job_arrival j + R); exact: H_response_time_bounded. Qed.
Proof. by ∃ (job_arrival j + R); exact: H_response_time_bounded. Qed.
We are now ready for the main definition: job j's finish time is the
earliest time t such that completed_by sched j t holds. This time can
be computed with ssreflect's ex_minn utility function, which is
convenient because then we can reuse the corresponding lemmas.
In the following, we demonstrate the reuse of ex_minn properties by
establishing three natural properties of a job's finish time.
First, a job is indeed complete at its finish time.
Corollary finished_at_finish_time : completed_by sched j finish_time.
Proof.
rewrite /finish_time/ex_minn.
by case: find_ex_minn.
Qed.
Proof.
rewrite /finish_time/ex_minn.
by case: find_ex_minn.
Qed.
Second, a job's finish time is the earliest time that it is complete.
Corollary earliest_finish_time :
∀ t,
completed_by sched j t →
finish_time ≤ t.
Proof.
move⇒ t COMP.
rewrite /finish_time/ex_minn.
by case: find_ex_minn.
Qed.
∀ t,
completed_by sched j t →
finish_time ≤ t.
Proof.
move⇒ t COMP.
rewrite /finish_time/ex_minn.
by case: find_ex_minn.
Qed.
Third, Prosa's notion of completes_at is satisfied at the finish time.
Corollary completes_at_finish_time :
completes_at sched j finish_time.
Proof.
apply/andP; split; last exact: finished_at_finish_time.
apply/orP; case FIN: finish_time; [by right|left].
apply: contra_ltnN ⇒ [?|];
first by apply: earliest_finish_time.
by lia.
Qed.
completes_at sched j finish_time.
Proof.
apply/andP; split; last exact: finished_at_finish_time.
apply/orP; case FIN: finish_time; [by right|left].
apply: contra_ltnN ⇒ [?|];
first by apply: earliest_finish_time.
by lia.
Qed.
Finally, we can define a job's precise response time as usual as the time
from its arrival until its finish time.