Library prosa.analysis.facts.priority.elf

In this section, we state and prove some basic facts about ELF scheduling policies.
Section ELFBasicFacts.

Consider any type of tasks with relative priority points ...
  Context {Task : TaskType} `{PriorityPoint Task}.

... and jobs of these tasks.
  Context {Job : JobType} `{JobTask Job Task} `{JobCost Job} {AR : JobArrival Job}.

Consider any arbitrary FP policy ...
  Context {FP : FP_policy Task}.

... that is reflexive, transitive, and total.
Assume ELF scheduling.
  Context {JLFP : JLFP_policy Job}.
  Hypothesis H_policy_is_ELF : policy_is_ELF FP JLFP.

Basic properties of ELF policies

Under ELF, higher-or-equal job priority implies higher-or-equal priority of the corresponding tasks.
  Fact ELF_policy_task_priority_order :
     j j',
      hep_job j j' hep_task (job_task j) (job_task j').

Among jobs of equal-priority tasks, higher-or-equal job priority implies no later absolute priority point.
ELF priorities are reflexive.
ELF priorities are transitive.
ELF priorities are total.
A job whose task has strictly higher priority has higher-or-equal job priority.
  Fact ELF_policy_higher_priority_task :
     j j',
      hp_task (job_task j) (job_task j') hep_job j j'.

Among jobs of equal-priority tasks, a strictly earlier priority point implies higher-or-equal job priority.
Consequently, lack of higher-or-equal job priority reveals the opposite task-priority order.
If two jobs stem from equal-priority tasks and the first does not have higher-or-equal priority, then the other job has no later priority point.
For jobs of the same task, a strictly earlier arrival implies a strictly earlier priority point.
Every ELF policy behaves as an FP policy with respect to the underlying task-level priority relation.

Sequentiality under ELF

ELF policies satisfy the sequential-tasks hypothesis.
In this section, we prove that tasks always execute sequentially in a uniprocessor schedule following an ELF policy.
Consider any valid arrival sequence.
    Variable arr_seq : arrival_sequence Job.
    Hypothesis H_valid_arrivals : valid_arrival_sequence arr_seq.

Allow for any uniprocessor model.
    Context {PState : ProcessorState Job}.
    Hypothesis H_uniproc : uniprocessor_model PState.

Next, consider any schedule of the arrival sequence, ...
    Variable sched : schedule PState.

... allow for any work-bearing notion of job readiness, ...
    Context {RM : JobReady Job PState}.
    Hypothesis H_job_ready : work_bearing_readiness RM arr_seq sched.

... and assume that the schedule is valid.
    Hypothesis H_sched_valid : valid_schedule sched arr_seq.

Consider any valid preemption model.
Assume that the schedule respects the ELF policy.
ELF implies the sequential_tasks property since earlier jobs of the same task have higher priority than later jobs.
We add the generally useful ELF facts into the basic_rt_facts hint database, so Coq can apply them automatically where needed.
Global Hint Resolve
    ELF_policy_is_reflexive
    ELF_policy_is_transitive
    ELF_policy_is_total
    ELF_policy_is_FP_policy
    ELF_policy_not_hep_task_priority_order
    ELF_policy_not_hep_priority_point_order
    ELF_respects_sequential_tasks
    ELF_implies_sequential_tasks
 : basic_rt_facts.