Built with Alectryon, running Coq+SerAPI v8.20.0+0.20.0. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑Ctrl+↓ to navigate, Ctrl+🖱️ to focus. On Mac, use ⌘ instead of Ctrl.
[Loading ML file ring_plugin.cmxs (using legacy method) ... done]
[Loading ML file ssrmatching_plugin.cmxs (using legacy method) ... done]
[Loading ML file ssreflect_plugin.cmxs (using legacy method) ... done]
Serlib plugin: coq-elpi.elpi is not available: serlib support is missing.
Incremental checking for commands in this plugin will be impacted.
[Loading ML file coq-elpi.elpi ... done]
[Loading ML file zify_plugin.cmxs (using legacy method) ... done]
[Loading ML file micromega_core_plugin.cmxs (using legacy method) ... done]
[Loading ML file micromega_plugin.cmxs (using legacy method) ... done]
[Loading ML file btauto_plugin.cmxs (using legacy method) ... done]
Notation"_ + _" was already used in scope nat_scope.
[notation-overridden,parsing,default]
Notation"_ - _" was already used in scope nat_scope.
[notation-overridden,parsing,default]
Notation"_ <= _" was already used in scope nat_scope.
[notation-overridden,parsing,default]
Notation"_ < _" was already used in scope nat_scope.
[notation-overridden,parsing,default]
Notation"_ >= _" was already used in scope nat_scope.
[notation-overridden,parsing,default]
Notation"_ > _" was already used in scope nat_scope.
[notation-overridden,parsing,default]
Notation"_ <= _ <= _" was already used in scope
nat_scope. [notation-overridden,parsing,default]
Notation"_ < _ <= _" was already used in scope
nat_scope. [notation-overridden,parsing,default]
Notation"_ <= _ < _" was already used in scope
nat_scope. [notation-overridden,parsing,default]
Notation"_ < _ < _" was already used in scope
nat_scope. [notation-overridden,parsing,default]
Notation"_ * _" was already used in scope nat_scope.
[notation-overridden,parsing,default]
Require Export prosa.model.task.arrival.curves.Require Export prosa.model.priority.numeric_fixed_priority.(** * Implementation of Tasks and Jobs *)(** This file provides reference implementations of the notions of "tasks" and "jobs" that can be used to meet the hypotheses on which many of the analyses in Prosa are based. Note that their use is entirely optional: clients of Prosa may choose to use these types or implement their own notions of "tasks" and "jobs". *)(** ** Implementation of a Concrete Task *)(** A task comprises of an id, a cost, an arrival bound, a deadline and a priority. *)Structureconcrete_task :=
{ task_id: nat (* for uniqueness *)
; task_cost: nat
; task_arrival: task_arrivals_bound
; task_deadline: instant
; task_priority : nat
}.(** To make it compatible with ssreflect, we define a decidable equality for concrete tasks. *)Definitiontask_eqdef (t1t2: concrete_task) :=
(task_id t1 == task_id t2)
&& (task_cost t1 == task_cost t2)
&& (task_arrival t1 == task_arrival t2)
&& (task_deadline t1 == task_deadline t2)
&& (task_priority t1 == task_priority t2).(** Next, we prove that [task_eqdef] is indeed an equality, ... *)
Equality.axiom (T:=concrete_task) task_eqdef
Equality.axiom (T:=concrete_task) task_eqdef
x, y: concrete_task
reflect (x = y) (task_eqdef x y)
x, y: concrete_task EQ: task_eqdef x y = true
reflect (x = y) true
x, y: concrete_task EQ: task_eqdef x y = false
reflect (x = y) false
x, y: concrete_task EQ: task_eqdef x y = true
reflect (x = y) true
x, y: concrete_task EQ: task_eqdef x y = true
x = y
x, y: concrete_task EQ: (task_id x == task_id y) &&
(task_cost x == task_cost y) &&
(task_arrival x == task_arrival y) &&
(task_deadline x == task_deadline y) &&
(task_priority x == task_priority y) = true
x = y
x, y: concrete_task ID: task_id x = task_id y COST: task_cost x = task_cost y PER: task_arrival x = task_arrival y DL: task_deadline x = task_deadline y PRIO: task_priority x = task_priority y
x = y
bydestruct x, y; simplin *; subst.
x, y: concrete_task EQ: task_eqdef x y = false
reflect (x = y) false
x, y: concrete_task EQ: task_eqdef x y = false
reflect (x = y) false
x, y: concrete_task EQ: task_eqdef x y = false
x <> y
x, y: concrete_task EQ: (task_id x == task_id y) &&
(task_cost x == task_cost y) &&
(task_arrival x == task_arrival y) &&
(task_deadline x == task_deadline y) &&
(task_priority x == task_priority y) = false BUG: x = y
False
x, y: concrete_task EQ: ~~
((task_id x == task_id y) &&
(task_cost x == task_cost y) &&
(task_arrival x == task_arrival y) &&
(task_deadline x == task_deadline y) &&
(task_priority x == task_priority y)) BUG: x = y
False
x, y: concrete_task BUG: x = y EQ: (task_id x != task_id y)
|| (task_cost x != task_cost y)
|| (task_arrival x != task_arrival y)
|| (task_deadline x != task_deadline y)
|| (task_priority x != task_priority y)
bysubst; rewrite !eq_refl in EQ.}Qed.(** ..., which allows instantiating the canonical structure for [concrete_task : eqType]. *)HB.instance Definition_ := hasDecEq.Build concrete_task eqn_task.(** ** Implementation of a Concrete Job *)(** A job comprises of an id, an arrival time, a cost, a deadline and the task it belongs to. *)Recordconcrete_job :=
{ job_id: nat
; job_arrival: instant
; job_cost: nat
; job_deadline: instant
; job_task: concrete_task : eqType
}.(** For convenience, we define a function that converts each possible arrival bound (periodic, sporadic, and arrival-curve prefix) into an arrival-curve prefix... *)Definitionget_arrival_curve_prefixtsk :=
match task_arrival tsk with
| Periodic p => inter_arrival_to_prefix p
| Sporadic m => inter_arrival_to_prefix m
| ArrivalPrefix steps => steps
end.(** ... and define the "arrival bound" concept for concrete tasks. *)Definitionconcrete_max_arrivalstskΔ :=
extrapolated_arrival_curve (get_arrival_curve_prefix tsk) Δ.(** To make it compatible with ssreflect, we define a decidable equality for concrete jobs. *)Definitionjob_eqdef (j1j2: concrete_job) :=
(job_id j1 == job_id j2)
&& (job_arrival j1 == job_arrival j2)
&& (job_cost j1 == job_cost j2)
&& (job_deadline j1 == job_deadline j2)
&& (job_task j1 == job_task j2).(** Next, we prove that [job_eqdef] is indeed an equality, ... *)
Equality.axiom (T:=concrete_job) job_eqdef
Equality.axiom (T:=concrete_job) job_eqdef
x, y: concrete_job
reflect (x = y) (job_eqdef x y)
x, y: concrete_job EQ: job_eqdef x y = true
reflect (x = y) true
x, y: concrete_job EQ: job_eqdef x y = false
reflect (x = y) false
x, y: concrete_job EQ: job_eqdef x y = true
reflect (x = y) true
x, y: concrete_job EQ: (job_id x == job_id y) &&
(job_arrival x == job_arrival y) &&
(job_cost x == job_cost y) &&
(job_deadline x == job_deadline y) &&
(job_task x == job_task y) = true
x = y
x, y: concrete_job ID: job_id x = job_id y ARR: job_arrival x = job_arrival y COST: job_cost x = job_cost y DL: job_deadline x = job_deadline y TASK: job_task x = job_task y
x = y
bydestruct x, y; simplin *; subst.
x, y: concrete_job EQ: job_eqdef x y = false
reflect (x = y) false
x, y: concrete_job EQ: job_eqdef x y = false
reflect (x = y) false
x, y: concrete_job EQ: job_eqdef x y = false
x <> y
x, y: concrete_job EQ: (job_id x == job_id y) &&
(job_arrival x == job_arrival y) &&
(job_cost x == job_cost y) &&
(job_deadline x == job_deadline y) &&
(job_task x == job_task y) = false BUG: x = y
False
x, y: concrete_job BUG: x = y EQ: ~~
((job_id x == job_id y) &&
(job_arrival x == job_arrival y) &&
(job_cost x == job_cost y) &&
(job_deadline x == job_deadline y))
|| (job_task x != job_task y)
byapply TASK; inversion BUG.}Qed.(** ... which allows instantiating the canonical structure for [concrete_job : eqType].*)HB.instance Definition_ := hasDecEq.Build concrete_job eqn_job.(** ** Instances for Concrete Jobs and Tasks. *)(** In the following, we connect the concrete task and job types defined above to the generic Prosa interfaces for task and job parameters. *)SectionParameters.(** First, we connect the above definition of tasks with the generic Prosa task-parameter interfaces. *)LetTask := concrete_task : eqType.#[global,program] InstanceTaskCost : TaskCost Task := task_cost.#[global,program] InstanceTaskPriority : TaskPriority Task := task_priority.#[global,program] InstanceTaskDeadline : TaskDeadline Task := task_deadline.#[global,program] InstanceConcreteMaxArrivals : MaxArrivals Task := concrete_max_arrivals.(** Second, we do the same for the above definition of job. *)LetJob := concrete_job : eqType.#[global,program] InstanceJobTask : JobTask Job Task := job_task.#[global,program] InstanceJobArrival : JobArrival Job := job_arrival.#[global,program] InstanceJobCost : JobCost Job := job_cost.EndParameters.