Library prosa.analysis.facts.priority.jlfp

Selecting a Highest-Priority Job

We establish when priority compliance forces a pending job to execute.
Section JLFPSelection.

Consider jobs with arrival times and execution costs.
  Context {Job : JobType} `{JobArrival Job} `{JobCost Job}.

Allow any processor model ...
  Context {PState : ProcessorState Job}.

... and any preemption model.
  Context `{JobPreemptable Job}.

We restrict the focus to basic readiness models.
Given an arrival sequence, ...
  Variable arr_seq : arrival_sequence Job.

... consider a work-conserving schedule of the arriving jobs.
A fixed job order governs scheduling decisions ...
  Context {JLFP : JLFP_policy Job}.

... and the schedule honors this order at preemption times.
Resolving ties uniquely makes the choice among eligible jobs deterministic.
To establish that a pending job is selected, it suffices to compare it with whichever job actually executes. If j is waiting, work conservation supplies an executing job j'. At a preemption time, priority compliance gives hep_job j' j, while the final premise asks the caller to establish the reverse comparison. Antisymmetry then identifies the two jobs. The case where j already executes is immediate, so the premise only addresses distinct competing jobs.
  Lemma jlfp_pending_highest_priority_job_is_scheduled :
    ∀ t j,
      preemption_time arr_seq sched t →
      arrives_in arr_seq j →
      pending sched j t →
      (∀ j', scheduled_at sched j' t → j' != j → hep_job j j') →
      scheduled_at sched j t.

End JLFPSelection.