Library prosa.analysis.facts.sporadic.arrival_bound

Sporadic Arrival Bound

In the following, we upper bound the number of jobs that can arrive in any interval as constrained by the sporadic task model's minimum inter-arrival time task_min_inter_arrival_time.
Consider any sporadic tasks ...
  Context {Task : TaskType} `{SporadicModel Task}.

... and their jobs.
  Context {Job : JobType} `{JobTask Job Task} `{JobArrival Job}.

We define the classic "ceiling of the interval length divided by minimum inter-arrival time", which we prove to be correct in the following.
To establish the bound's soundness, consider any well-formed arrival sequence, ...
... and any valid sporadic task tsk to be analyzed.
Before we can establish the bound, we require two auxiliary bounds, which we derive next. First, we consider minimum offset of the n-th job of the task that arrives in a given interval.
  Section NthJob.

For technical reasons, we require a "dummy" job in scope to use the nth function. In the proofs, we establish that the dummy job is never used, i.e., it is an irrelevant artifact induced by the ssreflect API. It may be safely ignored.
    Variable dummy : Job.

We observe that the i-th job to arrive in an interval [t1,t2) arrives no earlier than (task_min_inter_arrival_time tsk) ×i time units after the beginning of the interval due the minimum inter-arrival time of the sporadic task.
    Lemma arrival_of_nth_job :
       t1 t2 n i j,
        n = number_of_task_arrivals arr_seq tsk t1 t2
        i < n
        j = nth dummy (task_arrivals_between arr_seq tsk t1 t2) i
        job_arrival j t1 + (task_min_inter_arrival_time tsk) × i.

  End NthJob.

As a second auxiliary lemma, we establish a minimum length on the interval for a given number of arrivals by applying the previous lemma to the last job in the interval. We consider only the case of "many" jobs, i.e., n 2, which ensures that the interval [t1, t2) spans at least one inter-arrival time.
Based on the above lemma, it is easy to see that max_sporadic_arrivals is indeed a correct upper bound on the maximum number of arrivals in a given interval.