Library prosa.implementation.priority.tiebreaking_elf

ELF Priority Policy with Tie-Breaking

This implementation refines ELF over any task-level FP policy by favoring lower task IDs, and then lower job IDs, among equal priorities.
Section TiebreakingELF.

Consider tasks with relative priority points and numeric identifiers ...
  Context {Task : TaskType} `{PriorityPoint Task} `{TaskId Task}.

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

The supplied task-level policy determines the primary priority order.
  Variable FP : FP_policy Task.

We resolve ties in ELF's task and priority-point orders by identifier.
  #[local] Instance tiebreaking_elf : JLFP_policy Job :=
    tiebreaks_by_id (ELF FP).

We expose the comparison rule for use in proofs about this policy.
  Fact tiebreaking_elf_hep_job :
    ∀ j1 j2,
      @hep_job Job tiebreaking_elf j1 j2
      = (hp_task (job_task j1) (job_task j2)
         || (ep_task (job_task j1) (job_task j2)
             && ((job_priority_point j1 < job_priority_point j2)%R
                 || ((job_priority_point j1 == job_priority_point 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))))))).

Valid job identifiers make the final tie-breaking step unambiguous for arriving jobs.
Assume each task has at least its own priority.
The refinement preserves reflexivity at the job level.
Assume task comparisons remain consistent across chains of tasks.
The refinement preserves transitivity at the job level.
Assume every pair of tasks can be compared.
The refinement lets the scheduler compare every pair of jobs.
Preserving task priorities and priority-point order makes the refinement an ELF policy with respect to the supplied task order.
The identifier tie-breaks repeat together with ELF's task and priority-point orders.
Consider periodic tasks with relative priority points and numeric identifiers ...
... and jobs with task-derived absolute priority points and numeric identifiers.
  Context {Job : JobType} `{JobTask Job Task} `{JobArrival Job} `{JobId Job}.

The primary task-priority order is arbitrary.
  Variable FP : FP_policy Task.

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 priority points 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_elf_is_elf_policy
  tiebreaking_elf_is_reflexive
  tiebreaking_elf_is_transitive
  tiebreaking_elf_is_total
  tiebreaking_elf_is_antisymmetric
  tiebreaking_elf_priorities_consistent_across_hyperperiods
  : basic_rt_facts.