Library prosa.implementation.priority.tiebreaking_edf

EDF Priority Policy with Tie-Breaking

This EDF implementation resolves equal absolute deadlines by favoring lower task IDs, and then lower job IDs.
Section TiebreakingEDF.

Consider tasks with numeric identifiers ...
  Context {Task : TaskType} `{TaskId Task}.

... and their jobs, with absolute deadlines and numeric identifiers.
  Context {Job : JobType} `{JobTask Job Task} `{JobDeadline Job} `{JobId Job}.

We apply identifier-based tie-breaking to EDF's deadline order.
  #[local] Instance tiebreaking_edf : JLFP_policy Job :=
    tiebreaks_by_id (EDF Job).

The following facts connect the implementation to the generic priority interface used by schedulers and analyses.
We expose the comparison rule for use in proofs about this policy.
  Fact tiebreaking_edf_hep_job :
    ∀ j1 j2,
      @hep_job Job tiebreaking_edf j1 j2
      = ((job_deadline j1 < job_deadline j2)
         || ((job_deadline j1 == job_deadline j2)
             && ((task_id (job_task j1) < task_id (job_task j2))
                 || ((task_id (job_task j1) == task_id (job_task j2))
                     && (job_id j1 ≤ job_id j2))))).

Every job has at least its own priority.
Priority comparisons remain consistent across chains of jobs.
The scheduler can compare every pair of jobs.
Valid job identifiers make the final tie-breaking step unambiguous for arriving jobs.
The tie-breaking rule preserves EDF's deadline order and satisfies the priority properties required by EDF analyses.
The identifier tie-breaks repeat together with EDF's deadline order.
Consider periodic tasks with relative deadlines and numeric identifiers ...
... and jobs with task-derived absolute deadlines and numeric identifiers.
  Context {Job : JobType} `{JobTask Job Task} `{JobArrival Job} `{JobId Job}.

We name the task-derived absolute deadline for clarity.
Consider a task set with valid periods and unique task identifiers ...
  Variable ts : TaskSet Task.
  Hypothesis H_valid_periods : valid_periods ts.
  Hypothesis H_valid_task_ids : valid_task_ids ts.

... generating a valid arrival sequence of these tasks ...
... with periodic releases continuing indefinitely.
Unique task IDs preserve ties between tasks. Within a task, equal deadlines identify the same release, whose job-ID comparison is reflexive.
We register the policy facts so Rocq can apply them automatically.
Global Hint Resolve
  tiebreaking_edf_is_edf_policy
  tiebreaking_edf_is_reflexive
  tiebreaking_edf_is_transitive
  tiebreaking_edf_is_total
  tiebreaking_edf_is_antisymmetric
  tiebreaking_edf_priorities_consistent_across_hyperperiods
  : basic_rt_facts.