Library prosa.analysis.facts.readiness_interference

In this file, we establish facts about readiness interference.
Consider any kind of jobs with arrival times and execution costs.
  Context {Job : JobType}.
  Context `{JobArrival Job}.
  Context `{JobCost Job}.

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

Consider any notion of job readiness.
  Context `{!JobReady Job PState}.

Consider any valid arrival sequence of jobs ...
... and any valid schedule of the given arrival sequence.
  Variable sched : schedule PState.
  Hypothesis H_valid_schedule : valid_schedule sched arr_seq.

Allow for any JLFP priority policy.
  Context {JLFP : JLFP_policy Job}.

First, note that readiness interference is exclusive of the interference due to other higher-or-equal-priority jobs.
  Lemma no_hep_ready_implies_no_another_hep_interference :
     j t,
      ~~ some_hep_job_ready arr_seq sched j t
      ~~ another_hep_job_interference arr_seq sched j t.
  Proof.
    movej t /hasPn NO_HEP_READY.
    apply/negP ⇒ /hasP[jo INjo /andP[HEP NEQ]].
    move: INjo; rewrite mem_filter ⇒ /andP[SERVjo INjo].
    have SCHEDjo : scheduled_at sched jo t by apply service_at_implies_scheduled_at.
    have PENDjo : pending sched jo t by apply scheduled_implies_pending.
    have READYjo : job_ready sched jo t by done.
    have IN : jo \in [seq j' <- arrivals_up_to arr_seq t | hep_job j' j].
    { rewrite mem_filter.
      by do 2! [apply /andP; split; eauto]. }
    by move: (NO_HEP_READY jo IN); rewrite READYjo.
  Qed.

Next, we observe that readiness interference is exclusive of service inversion.
  Lemma no_hep_ready_implies_no_service_inversion :
     j t,
      ~~ some_hep_job_ready arr_seq sched j t
      ~~ service_inversion arr_seq sched j t.
  Proof.
    movej t NO_HEP_READY.
    by rewrite /service_inversion; apply/nandP; left.
  Qed.

End ReadinessInterference.