Library prosa.implementation.priority.numeric_fixed_priority
Numeric Fixed Task Priorities
The instance numeric_fp_ascending assigns higher priority to tasks with
higher numeric task_priority value.
#[local] Instance numeric_fp_ascending (Task : TaskType) `{TaskPriority Task} : FP_policy Task :=
{
hep_task (tsk1 tsk2 : Task) := task_priority tsk1 ≥ task_priority tsk2
}.
{
hep_task (tsk1 tsk2 : Task) := task_priority tsk1 ≥ task_priority tsk2
}.
Consider any kind of tasks with specified priorities.
The concrete numeric_fp_ascending implementation is indeed an ascending
numeric FP policy.
Fact NFPA_is_numeric_FP_ascending_policy :
policy_is_numeric_FP_ascending (numeric_fp_ascending Task).
policy_is_numeric_FP_ascending (numeric_fp_ascending Task).
The resulting priority policy is reflexive.
The resulting priority policy is transitive.
The resulting priority policy is total.
Next, we define descending numeric fixed priorities, where a larger numeric
value indicates lower priority, and again note some trivial facts about this
alternate interpretation of priority values.
The instance numeric_fp_descending assigns lower priority to tasks with
higher numeric task_priority value.
#[local] Instance numeric_fp_descending (Task : TaskType) `{TaskPriority Task} : FP_policy Task :=
{
hep_task (tsk1 tsk2 : Task) := task_priority tsk1 ≤ task_priority tsk2
}.
{
hep_task (tsk1 tsk2 : Task) := task_priority tsk1 ≤ task_priority tsk2
}.
Consider any kind of tasks with specified priorities.
The concrete numeric_fp_descending implementation is indeed a
descending numeric FP policy.
Fact NFPD_is_numeric_FP_descending_policy :
policy_is_numeric_FP_descending (numeric_fp_descending Task).
policy_is_numeric_FP_descending (numeric_fp_descending Task).
The resulting priority policy is reflexive.
The resulting priority policy is transitive.
The resulting priority policy is total.
We add the above facts into the basic_rt_facts hint database so Coq can
apply them automatically where needed.
Global Hint Resolve
NFPA_is_numeric_FP_ascending_policy
NFPA_is_reflexive
NFPA_is_transitive
NFPA_is_total
NFPD_is_numeric_FP_descending_policy
NFPD_is_reflexive
NFPD_is_transitive
NFPD_is_total
: basic_rt_facts.
NFPA_is_numeric_FP_ascending_policy
NFPA_is_reflexive
NFPA_is_transitive
NFPA_is_total
NFPD_is_numeric_FP_descending_policy
NFPD_is_reflexive
NFPD_is_transitive
NFPD_is_total
: basic_rt_facts.