Library prosa.analysis.facts.interference

Auxiliary Lemmas about Interference

If there is a priority policy in the context, one can differentiate between interference (interfering workload) that comes from jobs with higher or lower priority from other sources of interference (interfering workload).
Unfortunately, instantiated functions usually do not come with any useful lemmas about them. In order to reuse existing lemmas, we need to prove equivalence of the instantiated functions to some conventional notions.
First, we prove several lemmas about interference in the context of priority policies involving both FP and JLFP relations.
Consider any type of tasks ...
  Context {Task : TaskType}.

... and any type of jobs associated with these tasks.
  Context {Job : JobType} {jt : JobTask Job Task}.

Consider any kind of processor state model.
  Context {PState : ProcessorState Job}.

Consider any arrival sequence ...
  Variable arr_seq : arrival_sequence Job.

... and any schedule.
  Variable sched : schedule PState.

Consider a reflexive FP-policy and a JLFP policy compatible with it.
We observe that any higher-priority job must come from a task with either higher or equal priority.
We establish a higher-or-equal job of another task causing interference, can be due to a higher priority task or an equal priority task.
Now, assuming a uniprocessor model,...
  Hypothesis H_uniproc : uniprocessor_model PState.

...the previous lemma allows us to establish that the cumulative interference incurred by a job is equal to the sum of the cumulative interference from higher-or-equal-priority jobs belonging to strictly higher-priority tasks (FP) and the cumulative interference from higher-or-equal-priority jobs belonging to equal-priority tasks (GEL).
In the following section, we prove a few properties of interference under a JLFP policy.
Consider any type of tasks ...
  Context {Task : TaskType}.
  Context `{TaskCost Task}.

... and any type of jobs associated with these tasks.
  Context {Job : JobType}.
  Context `{JobTask Job Task}.
  Context `{JobArrival Job}.
  Context `{JobCost Job}.

Consider any kind of fully supply-consuming uniprocessor model.
Consider any valid arrival sequence with consistent arrivals ...
... and any uni-processor schedule of this arrival sequence ...
... where jobs do not execute before their arrival or after completion.
Let tsk be any task.
  Variable tsk : Task.

In the following, consider a JLFP-policy that indicates a higher-or-equal priority relation, and assume that this relation is reflexive and transitive.
First, we prove a few rewriting rules under the assumption that there is no supply.
  Section NoSupply.

Consider a time instant t ...
    Variable t : instant.

... and assume that there is no supply at t.
    Hypothesis H_no_supply : ~~ has_supply sched t.

Then, there is no interference from higher-or-equal priority jobs ...
... and that there is no interference from higher-or-equal priority jobs from other tasks.
In the following subsection, we prove properties of the introduced functions under the assumption that the schedule is idle.
  Section Idle.

Consider a time instant t ...
    Variable t : instant.

... and assume that the schedule is idle at t.
    Hypothesis H_idle : is_idle arr_seq sched t.

We prove that in this case: ...
... there is no interference from higher-or-equal priority jobs ...
... and that there is no interference from higher-or-equal priority jobs from other tasks.
Next, we prove properties of the introduced functions under the assumption that there is supply and the scheduler is not idle.
  Section SupplyAndScheduledJob.

Consider a job j of task tsk. In this subsection, job j is deemed to be the main job with respect to which the functions are computed.
    Variable j : Job.
    Hypothesis H_j_tsk : job_of_task tsk j.

Consider a time instant t ...
    Variable t : instant.

... and assume that there is supply at t.
    Hypothesis H_supply : has_supply sched t.

First, consider a case when some job is scheduled at time t.
    Section SomeJobIsScheduled.

Consider a job j' (not necessarily distinct from job j) that is scheduled at time t.
      Variable j' : Job.
      Hypothesis H_sched : scheduled_at sched j' t.

Under the stated assumptions, we show that the interference from another higher-or-equal priority job is equivalent to the relation another_hep_job.
Similarly, we show that the interference from another higher-or-equal priority job from another task is equivalent to the relation another_task_hep_job.
Next, consider a case when j itself is scheduled at t.
    Section JIsScheduled.

Assume that j is scheduled at time t.
      Hypothesis H_j_sched : scheduled_at sched j t.

Then there is no interference from higher-or-equal priority jobs at time t.
Next, consider a case when j receives service at t.
    Section JIsServed.

Assume that j receives service at time t.
      Hypothesis H_j_served : receives_service_at sched j t.

Then there is no interference from higher-or-equal priority jobs at time t.
      Lemma no_ahep_interference_when_served :
        ~~ another_hep_job_interference arr_seq sched j t.

    End JIsServed.

In the next subsection, we consider a case when a job j' from the same task (as job j) is scheduled.
    Section FromSameTask.

Consider a job j' that comes from task tsk and is scheduled at time instant t.
      Variable j' : Job.
      Hypothesis H_j'_tsk : job_of_task tsk j'.
      Hypothesis H_j'_sched : scheduled_at sched j' t.

Then we show that there is no interference from higher-or-equal priority jobs of another task.
In the next subsection, we consider a case when a job j' from a task other than j's task is scheduled.
    Section FromDifferentTask.

Consider a job j' that does _not comes from task tsk and is scheduled at time instant t.
      Variable j' : Job.
      Hypothesis H_j'_not_tsk : ~~ job_of_task tsk j'.
      Hypothesis H_j'_sched : scheduled_at sched j' t.

We prove that then j incurs higher-or-equal priority interference from another task iff j' has higher-or-equal priority than j.
Hence, if we assume that j' has higher-or-equal priority, ...
      Hypothesis H_j'_hep : hep_job j' j.

... we are able to show that j incurs higher-or-equal priority interference from another task.
      Lemma athep_interference_if :
        another_task_hep_job_interference arr_seq sched j t.

    End FromDifferentTask.

In the last subsection, we consider a case when the scheduled job j' has lower priority than job j.
    Section LowerPriority.

Consider a job j' that has lower priority than job j and is scheduled at time instant t.
      Variable j' : Job.
      Hypothesis H_j'_sched : scheduled_at sched j' t.
      Hypothesis H_j'_lp : ~~ hep_job j' j.

We prove that, in this case, there is no interference from higher-or-equal priority jobs at time t.
In this section, we prove that the (abstract) cumulative interference of jobs with higher or equal priority is equal to total service of jobs with higher or equal priority.
First, let us assume that the introduced processor model is unit-service.
Consider any job j of tsk.
    Variable j : Job.
    Hypothesis H_j_arrives : arrives_in arr_seq j.
    Hypothesis H_job_of_tsk : job_of_task tsk j.

We consider an arbitrary time interval [t1, t) that starts with a (classic) quiet time.
    Variable t1 t : instant.
    Hypothesis H_quiet_time : classical.quiet_time arr_seq sched j t1.

As follows from lemma cumulative_pred_served_eq_service, the (abstract) instantiated function of interference is equal to the total service of any subset of jobs with higher or equal priority.
The above is in particular true for the jobs other than j with higher or equal priority...
...and for jobs from other tasks than j with higher or equal priority.