Library prosa.analysis.definitions.carry_in

Carry-In Work

In this module, we characterize work remaining from earlier releases.
Section NoCarryIn.

Consider any type of tasks ...
  Context {Task : TaskType}.
  Context `{TaskCost Task}.

... and any type of jobs associated with these tasks, where each job has an arrival time and a cost.
  Context {Job : JobType} `{JobTask Job Task} `{JobArrival Job} `{JobCost Job}.

Consider any arrival sequence of such jobs with consistent arrivals ...
... and the resultant schedule.
  Context {PState : ProcessorState Job}.
  Variable sched : schedule PState.

There is no carry-in at time t iff every job (regardless of priority) from the arrival sequence released before t has completed by that time.
  Definition no_carry_in (t : instant) :=
    ∀ j_o,
      arrives_in arr_seq j_o →
      arrived_before j_o t →
      completed_by sched j_o t.

Conversely, there exists a carry-in job if any earlier-arrived job is still incomplete.
  Definition exists_carry_in (t : instant) :=
    has (fun j ⇒ ~~ completed_by sched j t) (arrivals_before arr_seq t).

We connect the Boolean search to the propositional condition via reflection.
  Lemma exists_carry_inP :
    ∀ t, reflect (¬ no_carry_in t) (exists_carry_in t).

End NoCarryIn.