Library prosa.implementation.priority.tiebreaking_fifo

FIFO Priority Policy with Tie-Breaking

This FIFO implementation resolves equal arrival times by favoring lower task IDs, and then lower job IDs.
Section TiebreakingFIFO.

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

... and their jobs, with arrival times and numeric identifiers.
  Context {Job : JobType} `{JobTask Job Task} `{JobArrival Job} `{JobId Job}.

We apply identifier-based tie-breaking to FIFO's arrival order.
  #[local] Instance tiebreaking_fifo : JLFP_policy Job :=
    tiebreaks_by_id (FIFO 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_fifo_hep_job :
    ∀ j1 j2,
      @hep_job Job tiebreaking_fifo j1 j2
      = ((job_arrival j1 < job_arrival j2)
         || ((job_arrival j1 == job_arrival 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 FIFO's arrival order and satisfies the priority properties required by FIFO analyses.
The identifier tie-breaks repeat together with FIFO's arrival order.
Consider periodic tasks with numeric identifiers ...
  Context {Task : TaskType} `{PeriodicModel Task} `{TaskId Task}.

... and jobs with arrival times and numeric identifiers.
  Context {Job : JobType} `{JobTask Job Task} `{JobArrival Job} `{JobId Job}.

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 arrival times 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_fifo_is_fifo_policy
  tiebreaking_fifo_is_reflexive
  tiebreaking_fifo_is_transitive
  tiebreaking_fifo_is_total
  tiebreaking_fifo_is_antisymmetric
  tiebreaking_fifo_priorities_consistent_across_hyperperiods
  : basic_rt_facts.