Commit a5393afb authored by Björn Brandenburg's avatar Björn Brandenburg

cleanup the restructured model

improve comments, fix names, move some stuff around
parent d64ab1d1
......@@ -38,8 +38,8 @@ Section Abstract_RTA.
Hypothesis H_completed_jobs_dont_execute : completed_jobs_dont_execute sched.
(** Assume that the job costs are no larger than the task costs. *)
Hypothesis H_job_cost_le_task_cost:
cost_of_jobs_from_arrival_sequence_le_task_cost arr_seq.
Hypothesis H_valid_job_cost:
arrivals_have_valid_job_costs arr_seq.
(** Consider a task set ts... *)
Variable ts : list Task.
......@@ -402,7 +402,7 @@ Section Abstract_RTA.
rewrite addnBA; last by apply PRT1.
rewrite subh1; last by done.
rewrite leq_sub2r // leq_add2l.
by rewrite -H_job_of_tsk; apply H_job_cost_le_task_cost.
by rewrite -H_job_of_tsk; apply H_valid_job_cost.
}
Qed.
......
......@@ -45,8 +45,8 @@ Section Sequential_Abstract_RTA.
Hypothesis H_completed_jobs_dont_execute : completed_jobs_dont_execute sched.
(** Assume that the job costs are no larger than the task costs. *)
Hypothesis H_job_cost_le_task_cost:
cost_of_jobs_from_arrival_sequence_le_task_cost arr_seq.
Hypothesis H_valid_job_cost:
arrivals_have_valid_job_costs arr_seq.
(** Consider an arbitrary task set. *)
Variable ts : list Task.
......@@ -611,7 +611,7 @@ Section Sequential_Abstract_RTA.
rewrite mulnDr mulnC muln1 -addnBA // subnn addn0 mulnC.
apply sum_majorant_constant.
move => j' ARR' /eqP TSK2.
by rewrite -TSK2; apply H_job_cost_le_task_cost; exists (t1 + A); apply rem_in in ARR'.
by rewrite -TSK2; apply H_valid_job_cost; exists (t1 + A); apply rem_in in ARR'.
Qed.
(** Finally, we use the lemmas above to obtain the bound on
......
......@@ -36,7 +36,7 @@ Section AbstractRTARunToCompletionThreshold.
Variable sched : schedule (ideal.processor_state Job).
(** Assume that the job costs are no larger than the task costs. *)
Hypothesis H_jobs_respect_taskset_costs : cost_of_jobs_from_arrival_sequence_le_task_cost arr_seq.
Hypothesis H_jobs_respect_taskset_costs : arrivals_have_valid_job_costs arr_seq.
(** Let [tsk] be any task that is to be analyzed. *)
Variable tsk : Task.
......
Require Export rt.restructuring.model.arrival.arrival_curves.
Require Export rt.restructuring.model.task.arrival.curves.
Require Export rt.restructuring.model.priority.classes.
(** The following definitions assume ideal uni-processor schedules. This
......
Require Export rt.restructuring.model.aggregate.task_arrivals.
Require Export rt.restructuring.model.task.arrivals.
(** In this file we provide basic properties related to tasks on arrival sequences. *)
Section TaskArrivals.
......
......@@ -29,8 +29,8 @@ Section ModelWithLimitedPreemptions.
(** Next, consider any limited ideal uni-processor schedule of this arrival sequence ... *)
Variable sched : schedule (ideal.processor_state Job).
Hypothesis H_valid_schedule_with_limited_preemptions:
valid_schedule_with_limited_preemptions arr_seq sched.
Hypothesis H_schedule_respects_preemption_model:
schedule_respects_preemption_model arr_seq sched.
(** ...where jobs do not execute after their completion. *)
Hypothesis H_completed_jobs_dont_execute: completed_jobs_dont_execute sched.
......@@ -204,7 +204,7 @@ Section ModelWithLimitedPreemptions.
intros j ARR; repeat split.
{ by apply zero_in_preemption_points. }
{ by apply job_cost_in_nonpreemptive_points. }
{ by move => t NPP; apply H_valid_schedule_with_limited_preemptions. }
{ by move => t NPP; apply H_schedule_respects_preemption_model. }
{ intros t NSCHED SCHED.
have SERV: service sched j t = service sched j t.+1.
{ rewrite -[service sched j t]addn0 /service /service_during; apply/eqP.
......@@ -215,7 +215,7 @@ Section ModelWithLimitedPreemptions.
rewrite -[job_preemptable _ _]Bool.negb_involutive.
apply/negP; intros CONTR.
move: NSCHED => /negP NSCHED; apply: NSCHED.
apply H_valid_schedule_with_limited_preemptions; first by done.
apply H_schedule_respects_preemption_model; first by done.
by rewrite SERV.
}
Qed.
......
......@@ -24,7 +24,7 @@ Section FullyNonPreemptiveModel.
(** Next, consider any non-preemptive ideal uniprocessor schedule of
this arrival sequence ... *)
Variable sched : schedule (ideal.processor_state Job).
Hypothesis H_nonpreemptive_sched : is_nonpreemptive_schedule sched.
Hypothesis H_nonpreemptive_sched : nonpreemptive_schedule sched.
(** ... where jobs do not execute before their arrival or after completion. *)
Hypothesis H_jobs_must_arrive_to_execute : jobs_must_arrive_to_execute sched.
......
......@@ -22,8 +22,8 @@ Section TaskRTCThresholdFloatingNonPreemptiveRegions.
Variable arr_seq : arrival_sequence Job.
(** Assume that a job cost cannot be larger than a task cost. *)
Hypothesis H_job_cost_le_task_cost:
cost_of_jobs_from_arrival_sequence_le_task_cost arr_seq.
Hypothesis H_valid_job_cost:
arrivals_have_valid_job_costs arr_seq.
(** Then, we prove that [task_run_to_completion_threshold] function
defines a valid task's run to completion threshold. *)
......@@ -31,10 +31,10 @@ Section TaskRTCThresholdFloatingNonPreemptiveRegions.
forall tsk, valid_task_run_to_completion_threshold arr_seq tsk.
Proof.
intros; split.
- by rewrite /task_run_to_completion_threshold_le_task_cost.
- by rewrite /task_rtc_bounded_by_cost.
- intros j ARR TSK.
apply leq_trans with (job_cost j); eauto 2 with basic_facts.
by rewrite-TSK; apply H_job_cost_le_task_cost.
by rewrite-TSK; apply H_valid_job_cost.
Qed.
End TaskRTCThresholdFloatingNonPreemptiveRegions.
......
......@@ -28,8 +28,8 @@ Section TaskRTCThresholdLimitedPreemptions.
(** Next, consider any ideal uniprocessor schedule of this arrival sequence ... *)
Variable sched : schedule (ideal.processor_state Job).
Hypothesis H_valid_schedule_with_limited_preemptions:
valid_schedule_with_limited_preemptions arr_seq sched.
Hypothesis H_schedule_respects_preemption_model:
schedule_respects_preemption_model arr_seq sched.
(** ... where jobs do not execute before their arrival or after completion. *)
Hypothesis H_jobs_must_arrive_to_execute : jobs_must_arrive_to_execute sched.
......@@ -39,8 +39,8 @@ Section TaskRTCThresholdLimitedPreemptions.
Variable ts : seq Task.
(** Assume that a job cost cannot be larger than a task cost. *)
Hypothesis H_job_cost_le_task_cost:
cost_of_jobs_from_arrival_sequence_le_task_cost arr_seq.
Hypothesis H_valid_job_cost:
arrivals_have_valid_job_costs arr_seq.
(** Consider the model with fixed preemption points. I.e., each task
is divided into a number of non-preemptive segments by inserting
......@@ -97,7 +97,7 @@ Section TaskRTCThresholdLimitedPreemptions.
Lemma limited_valid_task_run_to_completion_threshold:
valid_task_run_to_completion_threshold arr_seq tsk.
Proof.
split; first by rewrite /task_run_to_completion_threshold_le_task_cost leq_subr.
split; first by rewrite /task_rtc_bounded_by_cost leq_subr.
intros ? ARR__j TSK__j. move: (H_valid_fixed_preemption_points_model) => [LJ LT].
move: (LJ) (LT) => [ZERO__job [COST__job SORT__job]] [ZERO__task [COST__task [SORT__task [T4 [T5 T6]]]]].
rewrite /job_run_to_completion_threshold /task_run_to_completion_threshold /limited_preemptions
......@@ -106,7 +106,7 @@ Section TaskRTCThresholdLimitedPreemptions.
have J_RTCT__pos : 0 < job_last_nonpreemptive_segment j
by eapply job_last_nonpreemptive_segment_positive; eauto using valid_fixed_preemption_points_model_lemma.
have T_RTCT__pos : 0 < task_last_nonpr_segment tsk.
{ unfold lengths_of_task_segments_bound_length_of_job_segments, task_last_nonpr_segment in *.
{ unfold job_respects_segment_lengths, task_last_nonpr_segment in *.
rewrite last0_nth; apply T6; eauto 2.
have F: 1 <= size (distances (task_preemption_points tsk)).
{ apply leq_trans with (size (task_preemption_points tsk) - 1).
......
......@@ -28,7 +28,7 @@ Section TaskRTCThresholdFullyNonPreemptive.
(** Next, consider any ideal non-preemptive uniprocessor schedule of
this arrival sequence ... *)
Variable sched : schedule (ideal.processor_state Job).
Hypothesis H_nonpreemptive_sched : is_nonpreemptive_schedule sched.
Hypothesis H_nonpreemptive_sched : nonpreemptive_schedule sched.
(** ... where jobs do not execute before their arrival or after completion. *)
Hypothesis H_jobs_must_arrive_to_execute : jobs_must_arrive_to_execute sched.
......@@ -70,7 +70,7 @@ Section TaskRTCThresholdFullyNonPreemptive.
valid_task_run_to_completion_threshold arr_seq tsk.
Proof.
intros; split.
- by unfold task_run_to_completion_threshold_le_task_cost.
- by unfold task_rtc_bounded_by_cost.
- intros j ARR TSK.
rewrite -TSK /task_run_to_completion_threshold /fully_nonpreemptive.
edestruct (posnP (job_cost j)) as [ZERO|POS].
......
......@@ -21,8 +21,8 @@ Section TaskRTCThresholdFullyPreemptiveModel.
Variable arr_seq : arrival_sequence Job.
(** ... and assume that a job cost cannot be larger than a task cost. *)
Hypothesis H_job_cost_le_task_cost:
cost_of_jobs_from_arrival_sequence_le_task_cost arr_seq.
Hypothesis H_valid_job_cost:
arrivals_have_valid_job_costs arr_seq.
(** Then, we prove that [task_run_to_completion_threshold] function
defines a valid task's run to completion threshold. *)
......@@ -30,10 +30,10 @@ Section TaskRTCThresholdFullyPreemptiveModel.
forall tsk, valid_task_run_to_completion_threshold arr_seq tsk.
Proof.
intros; split.
- by rewrite /task_run_to_completion_threshold_le_task_cost.
- by rewrite /task_rtc_bounded_by_cost.
- intros j ARR TSK.
apply leq_trans with (job_cost j); eauto 2 with basic_facts.
by rewrite-TSK; apply H_job_cost_le_task_cost.
by rewrite-TSK; apply H_valid_job_cost.
Qed.
End TaskRTCThresholdFullyPreemptiveModel.
......
......@@ -37,7 +37,7 @@ Section FloatingNonPreemptiveRegionsModel.
of this arrival sequence ... *)
Variable sched : schedule (ideal.processor_state Job).
Hypothesis H_preemption_aware_schedule:
valid_schedule_with_limited_preemptions arr_seq sched.
schedule_respects_preemption_model arr_seq sched.
(** ... where jobs do not execute before their arrival or after completion. *)
Hypothesis H_jobs_must_arrive_to_execute : jobs_must_arrive_to_execute sched.
......@@ -58,7 +58,7 @@ Section FloatingNonPreemptiveRegionsModel.
move: (H_valid_model_with_floating_nonpreemptive_regions) => LIM; move: LIM (LIM) => [LIM L] [[BEG [END NDEC]] MAX].
case: (posnP (job_cost j)) => [ZERO|POS].
- split.
rewrite /job_max_nonpreemptive_segment_le_task_max_nonpreemptive_segment /job_max_nonpreemptive_segment
rewrite /job_respects_max_nonpreemptive_segment /job_max_nonpreemptive_segment
/lengths_of_segments /parameter.job_preemption_points; rewrite ZERO; simpl.
rewrite /job_preemptable /limited_preemptions_model; erewrite zero_in_preemption_points; eauto 2.
+ move => progr; rewrite ZERO leqn0; move => /andP [_ /eqP LE].
......
......@@ -31,8 +31,8 @@ Section LimitedPreemptionsModel.
(** Next, consider any ideal uni-processor preemption-aware schedule
of this arrival sequence ... *)
Variable sched : schedule (ideal.processor_state Job).
Hypothesis H_valid_schedule_with_limited_preemptions:
valid_schedule_with_limited_preemptions arr_seq sched.
Hypothesis H_schedule_respects_preemption_model:
schedule_respects_preemption_model arr_seq sched.
(** ... where jobs do not execute before their arrival or after completion. *)
Hypothesis H_jobs_must_arrive_to_execute : jobs_must_arrive_to_execute sched.
......@@ -57,14 +57,14 @@ Section LimitedPreemptionsModel.
move: (LIM) => [BEG [END NDEC]]; move: (FIX) => [A1 [A2 [A3 [A4 A5]]]].
case: (posnP (job_cost j)) => [ZERO|POS].
- split.
rewrite /job_max_nonpreemptive_segment_le_task_max_nonpreemptive_segment /job_max_nonpreemptive_segment
rewrite /job_respects_max_nonpreemptive_segment /job_max_nonpreemptive_segment
/lengths_of_segments /parameter.job_preemption_points; rewrite ZERO; simpl.
rewrite /job_preemptable /limited_preemptions_model; erewrite zero_in_preemption_points; eauto 2.
+ move => progr; rewrite ZERO leqn0; move => /andP [_ /eqP LE].
exists 0; rewrite LE; split; first by apply/andP; split.
by eapply zero_in_preemption_points; eauto 2.
- split; last (move => progr /andP [_ LE]; destruct (progr \in job_preemption_points j) eqn:NotIN).
+ rewrite /job_max_nonpreemptive_segment_le_task_max_nonpreemptive_segment
+ rewrite /job_respects_max_nonpreemptive_segment
/job_max_nonpreemptive_segment /lengths_of_segments; erewrite job_parameters_max_np_to_job_limited; eauto.
by apply max_of_dominating_seq; intros; apply A5.
+ exists progr; split; first apply/andP; first split; rewrite ?leq_addr; by done.
......
......@@ -28,15 +28,15 @@ Section FullyNonPreemptiveModel.
(** Next, consider any ideal non-preemptive uni-processor schedule of this arrival sequence... *)
Variable sched : schedule (ideal.processor_state Job).
Hypothesis H_nonpreemptive_sched : is_nonpreemptive_schedule sched.
Hypothesis H_nonpreemptive_sched : nonpreemptive_schedule sched.
(** ... where jobs do not execute before their arrival or after completion. *)
Hypothesis H_jobs_must_arrive_to_execute : jobs_must_arrive_to_execute sched.
Hypothesis H_completed_jobs_dont_execute : completed_jobs_dont_execute sched.
(** Assume that a job cost cannot be larger than a task cost. *)
Hypothesis H_job_cost_le_task_cost:
cost_of_jobs_from_arrival_sequence_le_task_cost arr_seq.
Hypothesis H_valid_job_cost:
arrivals_have_valid_job_costs arr_seq.
(** Then we prove that [fully_nonpreemptive_model] function
defines a model with bounded non-preemptive regions.*)
......@@ -45,7 +45,7 @@ Section FullyNonPreemptiveModel.
Proof.
have F: forall n, n = 0 \/ n > 0 by intros n; destruct n; [left | right].
intros j; split.
{ rewrite /job_max_nonpreemptive_segment_le_task_max_nonpreemptive_segment; eauto 2.
{ rewrite /job_respects_max_nonpreemptive_segment; eauto 2.
erewrite job_max_nps_is_job_cost; eauto 2.
}
move => progr /andP [_ GE].
......
......@@ -37,8 +37,8 @@ Section FullyPreemptiveModel.
Proof.
intros j ARR; split.
- case: (posnP (job_cost j)) => [ZERO|POS].
+ by rewrite /job_max_nonpreemptive_segment_le_task_max_nonpreemptive_segment job_max_nps_is_0.
+ by rewrite /job_max_nonpreemptive_segment_le_task_max_nonpreemptive_segment job_max_nps_is_ε.
+ by rewrite /job_respects_max_nonpreemptive_segment job_max_nps_is_0.
+ by rewrite /job_respects_max_nonpreemptive_segment job_max_nps_is_ε.
- intros t; exists t; split.
+ by apply/andP; split; [ done | rewrite leq_addr].
+ by done.
......
......@@ -46,8 +46,8 @@ Section ProofWorkloadBound.
Hypothesis H_tsk_in_ts : tsk \in ts.
(** Assume that the job costs are no larger than the task costs. *)
Hypothesis H_job_cost_le_task_cost :
cost_of_jobs_from_arrival_sequence_le_task_cost arr_seq.
Hypothesis H_valid_job_cost :
arrivals_have_valid_job_costs arr_seq.
(** Next, we assume that all jobs come from the task set. *)
Hypothesis H_all_jobs_from_taskset : all_jobs_from_taskset arr_seq ts.
......@@ -106,7 +106,7 @@ Section ProofWorkloadBound.
rewrite /same_task -H_job_of_tsk muln1.
apply leq_sum_seq; move => j0 IN0 /eqP EQ.
rewrite -EQ; apply in_arrivals_implies_arrived in IN0; auto.
by apply H_job_cost_le_task_cost.
by apply H_valid_job_cost.
Qed.
(** As a corollary, we prove that workload of task is no larger the than
......@@ -149,7 +149,7 @@ Section ProofWorkloadBound.
rewrite /workload_of_jobs.
rewrite muln1 /l /arrivals_between /arrival_sequence.arrivals_between.
apply leq_sum_seq; move => j0 IN0 /eqP EQ.
by rewrite -EQ; apply H_job_cost_le_task_cost; apply in_arrivals_implies_arrived in IN0.
by rewrite -EQ; apply H_valid_job_cost; apply in_arrivals_implies_arrived in IN0.
}
{ rewrite leq_mul2l; apply/orP; right.
rewrite -{2}[delta](addKn t).
......@@ -183,7 +183,7 @@ Section ProofWorkloadBound.
rewrite muln1.
apply leq_sum_seq; move => j0 IN0 /eqP EQ.
rewrite -EQ.
apply H_job_cost_le_task_cost.
apply H_valid_job_cost.
by apply in_arrivals_implies_arrived in IN0.
}
{ rewrite leq_mul2l; apply/orP; right.
......@@ -219,7 +219,7 @@ Section ProofWorkloadBound.
rewrite muln1.
apply leq_sum_seq; move => j0 IN0 /eqP EQ.
rewrite -EQ.
apply H_job_cost_le_task_cost.
apply H_valid_job_cost.
by apply in_arrivals_implies_arrived in IN0.
}
{ rewrite leq_mul2l; apply/orP; right.
......
Require Export rt.restructuring.model.schedule.tdma.
Require Import rt.util.all.
From mathcomp Require Import div.
(** In this section, we define the properties of TDMA and prove some basic lemmas. *)
Section TDMAFacts.
......@@ -141,4 +142,4 @@ Section TDMAFacts.
Qed.
End TimeSlotOrderFacts.
End TDMAFacts.
\ No newline at end of file
End TDMAFacts.
......@@ -735,9 +735,9 @@ Section EDFTransformFacts.
(** We begin with the first key property: the resulting schedule is actually
an EDF schedule. *)
Theorem edf_transform_ensures_edf:
is_EDF_schedule sched_edf.
EDF_schedule sched_edf.
Proof.
rewrite /is_EDF_schedule /sched_edf /edf_transform => t.
rewrite /EDF_schedule /sched_edf /edf_transform => t.
rewrite /EDF_at //= => j SCHED_j t' j' LE_t_t' SCHED_j' ARR_j'.
move: SCHED_j.
rewrite scheduled_at_def.
......
Require Export rt.restructuring.model.priority.classes.
(** Throughout this file, we assume ideal uniprocessor schedules. *)
Require Import rt.restructuring.model.processor.ideal.
From mathcomp Require Import ssreflect ssrbool eqtype ssrnat seq fintype bigop.
(** * Service Received by Sets of Jobs *)
(** In this file, we define the notion of service received by a set of jobs. *)
(** In this file, we define the notion of service received by a set of
jobs. *)
Section ServiceOfJobs.
(** Consider any type of tasks ... *)
......@@ -15,10 +13,8 @@ Section ServiceOfJobs.
(** ... and any type of jobs associated with these tasks. *)
Context {Job : JobType}.
Context `{JobTask Job Task}.
Context `{JobArrival Job}.
Context `{JobCost Job}.
(** Consider any kind of processor state model, ... *)
(** Consider any kind of processor model, ... *)
Context {PState : Type}.
Context `{ProcessorState Job PState}.
......@@ -31,53 +27,30 @@ Section ServiceOfJobs.
(** First, we define the service received by a generic set of jobs. *)
Section ServiceOfSetOfJobs.
(** Let P be any predicate over jobs, ...*)
Variable P : Job -> bool.
(** Let [P] be any computable predicate over jobs, ...*)
Variable P : pred Job.
(** ... and let jobs denote any (finite) set of jobs. *)
(** ... and let [jobs] denote any (finite) set of jobs. *)
Variable jobs : seq Job.
(** Then we define the cumulative service received at
time t by the jobs that satisfy this predicate ... *)
(** We define the cumulative service received at time [t] by
jobs in [jobs] that satisfy predicate [P] ... *)
Definition service_of_jobs_at (t : instant) :=
\sum_(j <- jobs | P j) service_at sched j t.
(** ... and the cumulative service received during time
interval [t1, t2) by the jobs that satisfy the predicate. *)
(** ... and the cumulative service received during the interval
[[t1, t2)] by jobs that satisfy predicate [P]. *)
Definition service_of_jobs (t1 t2 : instant) :=
\sum_(j <- jobs | P j) service_during sched j t1 t2.
End ServiceOfSetOfJobs.
(** Next, we define the service received by tasks with
higher-or-equal priority under a given FP policy. *)
Section PerTaskPriority.
(** Consider any FP policy. *)
Variable higher_eq_priority : FP_policy Task.
(** Let jobs denote any (finite) set of jobs. *)
Variable jobs : seq Job.
(** Let [tsk] be the task to be analyzed. *)
Variable tsk : Task.
(** Based on the definition of jobs of higher or equal priority
(with respect to task [tsk]), ... *)
Let of_higher_or_equal_priority j := higher_eq_priority (job_task j) tsk.
(** ...we define the service received during [[t1, t2)] by jobs of
higher or equal priority. *)
Definition service_of_higher_or_equal_priority_tasks (t1 t2 : instant) :=
service_of_jobs of_higher_or_equal_priority jobs t1 t2.
End PerTaskPriority.
(** Next, we define the service received by jobs with
higher-or-equal priority under JLFP policies. *)
(** Next, we define the service received by jobs with higher or
equal priority under JLFP policies. *)
Section PerJobPriority.
(** Consider any JLDP policy. *)
(* [FIXME]: This should be a nameless context declaration! *)
Variable higher_eq_priority : JLFP_policy Job.
(** Let jobs denote any (finite) set of jobs. *)
......@@ -87,6 +60,7 @@ Section ServiceOfJobs.
Variable j : Job.
(** Based on the definition of jobs of higher or equal priority, ... *)
(* [FIXME]: this should use [hep_job], not the named type class directly. *)
Let of_higher_or_equal_priority j_hp := higher_eq_priority j_hp j.
(** ...we define the service received during [[t1, t2)] by jobs of higher or equal priority. *)
......@@ -95,17 +69,18 @@ Section ServiceOfJobs.
End PerJobPriority.
(** In this section, we define the notion of workload for sets of jobs. *)
(** Finally, we define the notion of cumulative service received by
the jobs of a given task. *)
Section ServiceOfTask.
(** Let [tsk] be the task to be analyzed... *)
(** Let [tsk] be the task to be analyzed ... *)
Variable tsk : Task.
(** ... and let jobs denote any (finite) set of jobs. *)
(** ... and let [jobs] denote any (finite) set of jobs. *)
Variable jobs : seq Job.
(** We define the cumulative task service received by the jobs
from the task within time interval [[t1, t2)]. *)
(** We define the cumulative task service received by the jobs of
task [tsk] within time interval [[t1, t2)]. *)
Definition task_service_of_jobs_in t1 t2 :=
service_of_jobs (job_of_task tsk) jobs t1 t2.
......
Require Export rt.restructuring.model.task.concept.
(** In this file we provide basic definitions related to tasks on arrival sequences. *)
Section TaskArrivals.
(** Consider any type of job associated with any type of tasks. *)
Context {Job : JobType}.
Context {Task : TaskType}.
Context `{JobTask Job Task}.
(** Consider any job arrival sequence. *)
Variable arr_seq : arrival_sequence Job.
Section Definitions.
(** Let [tsk] be any task. *)
Variable tsk : Task.
(** We define the sequence of jobs of task [tsk] arriving at time t. *)
Definition task_arrivals_at (t : instant) : seq Job :=
[seq j <- arrivals_at arr_seq t | job_task j == tsk].
(** By concatenation, we construct the list of jobs of task [tsk]
that arrived in the interval [[t1, t2)]. *)
Definition task_arrivals_between (t1 t2 : instant) :=
[seq j <- arrivals_between arr_seq t1 t2 | job_task j == tsk].
(** Based on that, we define the list of jobs of task [tsk] that
arrived up to time t, ...*)
Definition task_arrivals_up_to (t : instant) := task_arrivals_between 0 t.+1.
(** ...and the list of jobs of task [tsk] that arrived strictly
before time t ... *)
Definition task_arrivals_before (t : instant) := task_arrivals_between 0 t.
(** ... and also count the number of job arrivals. *)
Definition number_of_task_arrivals (t1 t2 : instant) :=
size (task_arrivals_between t1 t2).
End Definitions.
(** We define a predicate for arrival sequences in which all jobs
come from a given task set. *)
Definition arrivals_come_from_taskset (ts : seq Task) :=
forall j, arrives_in arr_seq j -> job_task j \in ts.
End TaskArrivals.
\ No newline at end of file
Require Export rt.restructuring.model.priority.classes.
From mathcomp Require Import ssreflect ssrbool eqtype ssrnat seq fintype bigop.
(** * Cumulative Workload of Sets of Jobs *)
(** * Workload of Sets of Jobs *)
(** In this section, we define the notion of workload for sets of jobs. *)
(** In this module, we define the notion of the cumulative workload of
a set of jobs. *)
Section WorkloadOfJobs.
(** Consider any type of tasks ... *)
Context {Task : TaskType}.
Context `{TaskCost Task}.
(** ... and any type of jobs associated with these tasks. *)
(** ... and any type of jobs with execution costs that are
associated with these tasks. *)
Context {Job : JobType}.
Context `{JobTask Job Task}.
Context `{JobArrival Job}.
Context `{JobCost Job}.
(** Consider any job arrival sequence. *)
......@@ -22,52 +22,34 @@ Section WorkloadOfJobs.
(** First, we define the workload for generic sets of jobs. *)
Section WorkloadOfJobs.
(** Given any predicate over Jobs, ... *)
Variable P : Job -> bool.
(** Given any computable predicate on jobs, ... *)
Variable P : pred Job.
(** ... and any (finite) set of jobs. *)
(** ... and any (finite) set of jobs, ... *)
Variable jobs : seq Job.
(** We define the total workload of the jobs that satisfy predicate P. *)
(** ... we define the total workload of the jobs that satisfy
predicate [P]. *)
Definition workload_of_jobs := \sum_(j <- jobs | P j) job_cost j.
End WorkloadOfJobs.
(** Next, we define the workload of tasks with higher or
equal priority under FP policies. *)
Section PerTaskPriority.
(** Consider any FP policy that indicates whether a task has
higher or equal priority. *)
Variable higher_eq_priority : FP_policy Task.
(** Let [tsk] be the task to be analyzed. *)
Variable tsk : Task.
(** Recall the notion of a job of higher or equal priority. *)
Let of_higher_or_equal_priority j :=
higher_eq_priority (job_task j) tsk.
(** Then, we define the workload of all jobs of tasks with
higher-or-equal priority than task [tsk]. *)
Definition workload_of_higher_or_equal_priority_tasks :=
workload_of_jobs of_higher_or_equal_priority.
End PerTaskPriority.
(** Then, we define the workload of jobs with higher or
equal priority under JLFP policies. *)
(** Next, we define the workload of jobs with higher or
equal priority under JLFP policies. *)
Section PerJobPriority.
(** Consider any JLFP policy that indicates whether a job has