Library prosa.analysis.facts.readiness.backlogged

In this file, we establish basic facts about backlogged jobs.

Section BackloggedJobs.

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

... and any kind of processor model, ...
  Context {PState : Type} `{ProcessorState Job PState}.

... and allow for any notion of job readiness.
  Context `{JobReady Job PState}.

Given an arrival sequence and a schedule ...
  Variable arr_seq : arrival_sequence Job.
  Variable sched : schedule PState.

... with consistent arrival times, ...
... we observe that any backlogged job is indeed in the set of backlogged jobs.
  Lemma mem_backlogged_jobs:
     j t,
      arrives_in arr_seq j
      backlogged sched j t
      j \in jobs_backlogged_at arr_seq sched t.

Trivially, it is also the case that any backlogged job comes from the respective arrival sequence.
  Lemma backlogged_job_arrives_in:
     j t,
      j \in jobs_backlogged_at arr_seq sched t
      arrives_in arr_seq j.

End BackloggedJobs.

In the following section, we make one more crucial assumption: namely, that the readiness model is non-clairvoyant, which allows us to relate backlogged jobs in schedules with a shared prefix.
Section NonClairvoyance.

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

... any kind of processor model, ...
  Context {PState : Type} `{ProcessorState Job PState}.

... and allow for any non-clairvoyant notion of job readiness.
Consider any arrival sequence ...
  Variable arr_seq : arrival_sequence Job.

... and two schedules ...
  Variable sched sched': schedule PState.

... with a shared prefix to a fixed horizon.
  Variable h : instant.
  Hypothesis H_shared_prefix: identical_prefix sched sched' h.

We observe that a job is backlogged at a time in the prefix in one schedule iff it is backlogged in the other schedule due to the non-clairvoyance of the notion of job readiness ...
  Lemma backlogged_prefix_invariance:
     t j,
      t < h
      backlogged sched j t = backlogged sched' j t.

As a corollary, if we further know that j is not scheduled at time h, we can expand the previous lemma to t h.
  Corollary backlogged_prefix_invariance':
     t j,
      ~~ scheduled_at sched j t
      ~~ scheduled_at sched' j t
      t h
      backlogged sched j t = backlogged sched' j t.

... and also lift this observation to the set of all backlogged jobs at any given time in the shared prefix.