Library prosa.model.priority.deadline_monotonic


(* ----------------------------------[ coqtop ]---------------------------------

Welcome to Coq 8.13.0 (January 2021)

----------------------------------------------------------------------------- *)


Require Export prosa.model.priority.classes.

Deadline-Monotonic Fixed-Priority Policy

We define the notion of deadline-monotonic task priorities, i.e., the classic FP policy in which tasks are prioritized in order of their relative deadlines.
In this section, we prove a few basic properties of the DM policy.
Section Properties.

Consider any kind of tasks with relative deadlines...
  Context {Task : TaskType}.
  Context `{TaskDeadline Task}.

...and jobs stemming from these tasks.
  Context {Job : JobType}.
  Context `{JobTask Job Task}.

DM is reflexive.
  Lemma DM_is_reflexive : reflexive_priorities.

(* ----------------------------------[ coqtop ]---------------------------------

1 subgoal (ID 29)
  
  Task : TaskType
  H : TaskDeadline Task
  Job : JobType
  H0 : JobTask Job Task
  ============================
  reflexive_priorities

----------------------------------------------------------------------------- *)


  Proof. by move⇒ ?; rewrite /hep_job_at /JLFP_to_JLDP /hep_job /FP_to_JLFP /hep_task /DM.
(* ----------------------------------[ coqtop ]---------------------------------

No more subgoals.

----------------------------------------------------------------------------- *)


Qed.

DM is transitive.
  Lemma DM_is_transitive : transitive_priorities.

(* ----------------------------------[ coqtop ]---------------------------------

1 subgoal (ID 37)
  
  Task : TaskType
  H : TaskDeadline Task
  Job : JobType
  H0 : JobTask Job Task
  ============================
  transitive_priorities

----------------------------------------------------------------------------- *)


  Proof. by intros t y x z; apply leq_trans.
(* ----------------------------------[ coqtop ]---------------------------------

No more subgoals.

----------------------------------------------------------------------------- *)


Qed.

DM is total.
  Lemma DM_is_total : total_priorities.

(* ----------------------------------[ coqtop ]---------------------------------

1 subgoal (ID 45)
  
  Task : TaskType
  H : TaskDeadline Task
  Job : JobType
  H0 : JobTask Job Task
  ============================
  total_priorities

----------------------------------------------------------------------------- *)


 Proof. by movet j1 j2; apply leq_total.
(* ----------------------------------[ coqtop ]---------------------------------

No more subgoals.

----------------------------------------------------------------------------- *)


Qed.

End Properties.

We add the above lemmas into a "Hint Database" basic_facts, so Coq will be able to apply them automatically.
Global Hint Resolve
     DM_is_reflexive
     DM_is_transitive
     DM_is_total
  : basic_facts.