Library prosa.model.task.arrival.example
Require Import prosa.model.task.arrival.periodic.
Require Import prosa.model.task.arrival.periodic_as_sporadic.
Require Import prosa.model.task.arrival.sporadic_as_curve.
Require Import prosa.model.task.arrival.curve_as_rbf.
Require Import prosa.model.task.arrival.periodic_as_sporadic.
Require Import prosa.model.task.arrival.sporadic_as_curve.
Require Import prosa.model.task.arrival.curve_as_rbf.
Arrival Model Conversion
Consider periodic tasks ...
... and their corresponding jobs.
Given a set of such periodic tasks ...
... and a valid arrival sequence, ...
Variable arr_seq : arrival_sequence Job.
Hypothesis H_valid_arrival_sequence : valid_arrival_sequence arr_seq.
Hypothesis H_valid_arrival_sequence : valid_arrival_sequence arr_seq.
... if the tasks are valid periodic tasks, ...
Hypothesis H_respects : taskset_respects_periodic_task_model arr_seq ts.
Hypothesis H_valid_periods : valid_periods ts.
Hypothesis H_valid_periods : valid_periods ts.
... then we can automatically interpret them also as satisfying
other arrival models, as we demonstrate in the following.
The tasks satisfy the sporadic validity constraint...
Periodic Tasks as Sporadic Tasks
... and arrival sequence is legal under the sporadic task
model.
... and the arrival sequence is legal under the arrival-curve
model.
Periodic Tasks as RBFs
Assuming that each task has a WCET...
... and that jobs are compliant with the WCET, ...
... the tasks satisfy the RBF validity constraint...
... and the arrival sequence is legal under the RBF model.
Goal taskset_respects_max_request_bound arr_seq ts.
Proof.
(* NB: Ideally, we would like this to be solved via by done, too, but
Prosa's done tactic calls eauto with a search depth of 4, which is
not enough here. However, bumping the search depth of the default
done to 5 causes massive compilation slowdowns elsewhere, so we have
to call eauto explicitly here. *)
by eauto 5 with basic_rt_facts.
Qed.
End ScalarWCET.
Proof.
(* NB: Ideally, we would like this to be solved via by done, too, but
Prosa's done tactic calls eauto with a search depth of 4, which is
not enough here. However, bumping the search depth of the default
done to 5 causes massive compilation slowdowns elsewhere, so we have
to call eauto explicitly here. *)
by eauto 5 with basic_rt_facts.
Qed.
End ScalarWCET.
The same upper-RBF conversion also works when tasks provide a native
WCET(n) bound rather than only a scalar WCET.
Assume that each task has a valid cumulative cost bound ...
Context `{TaskCumulativeCost Task}.
Hypothesis H_valid_cumulative_cost : taskset_has_valid_cumulative_cost_bounds ts.
Hypothesis H_valid_cumulative_cost : taskset_has_valid_cumulative_cost_bounds ts.
... that upper-bounds the cost of consecutive jobs.
Context `{JobCost Job}.
Hypothesis H_respects_cumulative_cost : taskset_respects_cumulative_cost_bounds arr_seq ts.
Hypothesis H_respects_cumulative_cost : taskset_respects_cumulative_cost_bounds arr_seq ts.
Then the tasks satisfy the RBF validity constraint.
And the arrival sequence is legal under the RBF model.
Thanks to type-class resolution, all conversions from more restrictive to
less restrictive task models happen transparently and the necessary proofs
are found automatically.
Of course, it is possible to start from sporadic tasks or tasks with
arrival curves, too.