Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PROSA - Formally Proven Schedulability Analysis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lasse Blaauwbroek
PROSA - Formally Proven Schedulability Analysis
Commits
c3fa11a7
Commit
c3fa11a7
authored
9 years ago
by
Felipe Cerqueira
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup task arrival, response time, schedulability
parent
96f719e7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
response_time.v
+19
-16
19 additions, 16 deletions
response_time.v
schedulability.v
+123
-10
123 additions, 10 deletions
schedulability.v
task_arrival.v
+8
-5
8 additions, 5 deletions
task_arrival.v
with
150 additions
and
31 deletions
response_time.v
+
19
−
16
View file @
c3fa11a7
Require
Import
Vbase
task
job
task_arrival
schedule
util_lemmas
Require
Import
Vbase
task
job
task_arrival
schedule
util_lemmas
ssreflect
ssrbool
eqtype
ssrnat
seq
fintype
bigop
.
ssreflect
ssrbool
eqtype
ssrnat
seq
fintype
bigop
.
(* Definition of response-time bound and some simple lemmas. *)
Module
ResponseTime
.
Module
ResponseTime
.
Import
Schedule
SporadicTaskset
SporadicTaskArrival
.
Import
Schedule
SporadicTaskset
SporadicTaskArrival
.
Section
ResponseTimeBound
.
Section
ResponseTimeBound
.
Context
{
sporadic_task
:
eqType
}
.
Context
{
sporadic_task
:
eqType
}
.
...
@@ -57,16 +58,16 @@ Module ResponseTime.
...
@@ -57,16 +58,16 @@ Module ResponseTime.
Section
SpecificJob
.
Section
SpecificJob
.
(*
Conside
r any job ...*)
(*
Then, fo
r any job
j
...*)
Variable
j
:
JobIn
arr_seq
.
Variable
j
:
JobIn
arr_seq
.
(* ...with response-time bound R in this schedule. *)
(* ...with response-time bound R in this schedule
, ..
. *)
Variable
R
:
time
.
Variable
R
:
time
.
Hypothesis
response_time_bound
:
Hypothesis
response_time_bound
:
job_has_completed_by
j
(
job_arrival
j
+
R
)
.
job_has_completed_by
j
(
job_arrival
j
+
R
)
.
(*
T
he service at any time t' after
the
response time is 0. *)
(*
t
he service
received by j
at any time t' after
its
response time is 0. *)
Lemma
service_
at_
after_job_rt_zero
:
Lemma
service_after_job_rt_zero
:
forall
t'
,
forall
t'
,
t'
>=
job_arrival
j
+
R
->
t'
>=
job_arrival
j
+
R
->
service_at
rate
sched
j
t'
=
0
.
service_at
rate
sched
j
t'
=
0
.
...
@@ -86,8 +87,8 @@ Module ResponseTime.
...
@@ -86,8 +87,8 @@ Module ResponseTime.
by
rewrite
big_nat_recr
//
/=
;
apply
leq_addl
.
by
rewrite
big_nat_recr
//
/=
;
apply
leq_addl
.
Qed
.
Qed
.
(* The
cumulative service after the response time is 0
. *)
(* The
same applies for the cumulative service of job j
. *)
Lemma
s
um_service_after_job_rt_zero
:
Lemma
c
um
ulative
_service_after_job_rt_zero
:
forall
t'
t''
,
forall
t'
t''
,
t'
>=
job_arrival
j
+
R
->
t'
>=
job_arrival
j
+
R
->
\
sum_
(
t'
<=
t
<
t''
)
service_at
rate
sched
j
t
=
0
.
\
sum_
(
t'
<=
t
<
t''
)
service_at
rate
sched
j
t
=
0
.
...
@@ -96,7 +97,7 @@ Module ResponseTime.
...
@@ -96,7 +97,7 @@ Module ResponseTime.
rewrite
big_nat_cond
;
rewrite
->
eq_bigr
with
(
F2
:=
fun
i
=>
0
);
rewrite
big_nat_cond
;
rewrite
->
eq_bigr
with
(
F2
:=
fun
i
=>
0
);
first
by
rewrite
big_const_seq
iter_addn
mul0n
addn0
leqnn
.
first
by
rewrite
big_const_seq
iter_addn
mul0n
addn0
leqnn
.
intro
i
;
rewrite
andbT
;
move
=>
/
andP
[
LE
_]
.
intro
i
;
rewrite
andbT
;
move
=>
/
andP
[
LE
_]
.
by
rewrite
service_
at_
after_job_rt_zero
;
by
rewrite
service_after_job_rt_zero
;
[
by
ins
|
by
apply
leq_trans
with
(
n
:=
t'
)]
.
[
by
ins
|
by
apply
leq_trans
with
(
n
:=
t'
)]
.
Qed
.
Qed
.
...
@@ -104,33 +105,35 @@ Module ResponseTime.
...
@@ -104,33 +105,35 @@ Module ResponseTime.
Section
AllJobs
.
Section
AllJobs
.
(*
Assume a
task tsk ...*)
(*
Consider any
task tsk ...*)
Variable
tsk
:
sporadic_task
.
Variable
tsk
:
sporadic_task
.
(* ...
and that R is
a response-time bound
of tsk in this schedule
. *)
(* ...
for which
a response-time bound
R is known
. *)
Variable
R
:
time
.
Variable
R
:
time
.
Hypothesis
response_time_bound
:
Hypothesis
response_time_bound
:
is_response_time_bound_of_task
job_cost
job_task
tsk
rate
sched
R
.
is_response_time_bound_of_task
job_cost
job_task
tsk
rate
sched
R
.
(* Then, for any job j of this task, ...*)
Variable
j
:
JobIn
arr_seq
.
Variable
j
:
JobIn
arr_seq
.
Hypothesis
H_job_of_task
:
job_task
j
=
tsk
.
Hypothesis
H_job_of_task
:
job_task
j
=
tsk
.
(*
T
he service at any time t' after the response time is 0. *)
(*
t
he service
received by job j
at any time t' after the response time is 0. *)
Lemma
service_
at_
after_rt_zero
:
Lemma
service_after_
task_
rt_zero
:
forall
t'
,
forall
t'
,
t'
>=
job_arrival
j
+
R
->
t'
>=
job_arrival
j
+
R
->
service_at
rate
sched
j
t'
=
0
.
service_at
rate
sched
j
t'
=
0
.
Proof
.
Proof
.
by
ins
;
apply
service_
at_
after_job_rt_zero
with
(
R
:=
R
);
[
apply
response_time_bound
|]
.
by
ins
;
apply
service_after_job_rt_zero
with
(
R
:=
R
);
[
apply
response_time_bound
|]
.
Qed
.
Qed
.
(* The
cumulative service after the response time is 0
. *)
(* The
same applies for the cumulative service of job j
. *)
Lemma
s
um_service_after_rt_zero
:
Lemma
c
um
ulative
_service_after_
task_
rt_zero
:
forall
t'
t''
,
forall
t'
t''
,
t'
>=
job_arrival
j
+
R
->
t'
>=
job_arrival
j
+
R
->
\
sum_
(
t'
<=
t
<
t''
)
service_at
rate
sched
j
t
=
0
.
\
sum_
(
t'
<=
t
<
t''
)
service_at
rate
sched
j
t
=
0
.
Proof
.
Proof
.
by
ins
;
apply
sum_service_after_job_rt_zero
with
(
R
:=
R
);
[
apply
response_time_bound
|]
.
by
ins
;
apply
cumulative_service_after_job_rt_zero
with
(
R
:=
R
);
first
by
apply
response_time_bound
.
Qed
.
Qed
.
End
AllJobs
.
End
AllJobs
.
...
...
This diff is collapsed.
Click to expand it.
schedulability.v
+
123
−
10
View file @
c3fa11a7
Require
Import
Vbase
task
schedule
Require
Import
Vbase
job
task
schedule
util_lemmas
ssreflect
eqtype
ssrbool
ssrnat
seq
.
ssreflect
eqtype
ssrbool
ssrnat
seq
bigop
.
(* Definitions of deadline miss. *)
Module
Schedulability
.
Module
Schedulability
.
Import
Schedule
SporadicTaskset
.
Import
Schedule
SporadicTaskset
Job
.
Section
SchedulableDefs
.
Section
SchedulableDefs
.
(* Assume that the cost and deadline of a job is known. *)
Context
{
Job
:
eqType
}
.
Context
{
Job
:
eqType
}
.
Context
{
arr_seq
:
arrival_sequence
Job
}
.
Context
{
arr_seq
:
arrival_sequence
Job
}
.
Variable
job_cost
:
Job
->
nat
.
Variable
job_cost
:
Job
->
nat
.
...
@@ -14,13 +16,14 @@ Module Schedulability.
...
@@ -14,13 +16,14 @@ Module Schedulability.
Section
ScheduleOfJobs
.
Section
ScheduleOfJobs
.
(* For any job j in schedule sched, ...*)
Context
{
num_cpus
:
nat
}
.
Context
{
num_cpus
:
nat
}
.
Variable
rate
:
Job
->
processor
num_cpus
->
nat
.
Variable
rate
:
Job
->
processor
num_cpus
->
nat
.
Variable
sched
:
schedule
num_cpus
arr_seq
.
Variable
sched
:
schedule
num_cpus
arr_seq
.
Variable
j
:
JobIn
arr_seq
.
Variable
j
:
JobIn
arr_seq
.
(*
J
ob
won't miss its
deadline i
f
i
t
i
s
completed by its a
rrival time plus its (relative)
deadline. *)
(*
j
ob
j misses no
deadline i
n sched
i
f
i
t
completed by its a
bsolute
deadline. *)
Definition
job_misses_no_deadline
:=
Definition
job_misses_no_deadline
:=
completed
job_cost
rate
sched
j
(
job_arrival
j
+
job_deadline
j
)
.
completed
job_cost
rate
sched
j
(
job_arrival
j
+
job_deadline
j
)
.
...
@@ -35,19 +38,20 @@ Module Schedulability.
...
@@ -35,19 +38,20 @@ Module Schedulability.
Variable
rate
:
Job
->
processor
num_cpus
->
nat
.
Variable
rate
:
Job
->
processor
num_cpus
->
nat
.
Variable
sched
:
schedule
num_cpus
arr_seq
.
Variable
sched
:
schedule
num_cpus
arr_seq
.
Variable
ts
:
taskset_of
sporadic_task
.
(* Consider any task tsk. *)
Variable
tsk
:
sporadic_task
.
Variable
tsk
:
sporadic_task
.
(*
A
t
a
sk doesn't miss its deadline iff all of its jobs don't miss their deadline. *)
(*
Task
tsk doesn't miss its deadline iff all of its jobs don't miss their deadline. *)
Definition
task_misses_no_deadline
:=
Definition
task_misses_no_deadline
:=
forall
(
j
:
JobIn
arr_seq
),
forall
(
j
:
JobIn
arr_seq
),
job_task
j
=
=
tsk
->
job_task
j
=
tsk
->
job_misses_no_deadline
rate
sched
j
.
job_misses_no_deadline
rate
sched
j
.
(* Whether a task misses a deadline before a particular time. *)
(* Task tsk doesn't miss its deadline before time t' iff all of its jobs don't miss
their deadline by that time. *)
Definition
task_misses_no_deadline_before
(
t'
:
time
)
:=
Definition
task_misses_no_deadline_before
(
t'
:
time
)
:=
forall
(
j
:
JobIn
arr_seq
),
forall
(
j
:
JobIn
arr_seq
),
job_task
j
=
=
tsk
->
job_task
j
=
tsk
->
job_arrival
j
+
job_deadline
j
<
t'
->
job_arrival
j
+
job_deadline
j
<
t'
->
job_misses_no_deadline
rate
sched
j
.
job_misses_no_deadline
rate
sched
j
.
...
@@ -55,4 +59,113 @@ Module Schedulability.
...
@@ -55,4 +59,113 @@ Module Schedulability.
End
SchedulableDefs
.
End
SchedulableDefs
.
Section
BasicLemmas
.
Context
{
sporadic_task
:
eqType
}
.
Variable
task_cost
:
sporadic_task
->
nat
.
Variable
task_period
:
sporadic_task
->
nat
.
Variable
task_deadline
:
sporadic_task
->
nat
.
Context
{
Job
:
eqType
}
.
Variable
job_cost
:
Job
->
nat
.
Variable
job_deadline
:
Job
->
nat
.
Variable
job_task
:
Job
->
sporadic_task
.
Context
{
arr_seq
:
arrival_sequence
Job
}
.
(* Consider any valid schedule... *)
Context
{
num_cpus
:
nat
}
.
Variable
sched
:
schedule
num_cpus
arr_seq
.
Variable
rate
:
Job
->
processor
num_cpus
->
nat
.
(* ... where jobs dont execute after completion. *)
Hypothesis
H_completed_jobs_dont_execute
:
completed_jobs_dont_execute
job_cost
rate
sched
.
Section
SpecificJob
.
(* Then, for any job j ...*)
Variable
j
:
JobIn
arr_seq
.
(* ...that doesn't miss a deadline in this schedule, ... *)
Hypothesis
no_deadline_miss
:
job_misses_no_deadline
job_cost
job_deadline
rate
sched
j
.
(* the service received by j at any time t' after its deadline is 0. *)
Lemma
service_after_job_deadline_zero
:
forall
t'
,
t'
>=
job_arrival
j
+
job_deadline
j
->
service_at
rate
sched
j
t'
=
0
.
Proof
.
intros
t'
LE
.
rename
no_deadline_miss
into
NOMISS
,
H_completed_jobs_dont_execute
into
EXEC
.
unfold
job_misses_no_deadline
,
completed
,
completed_jobs_dont_execute
in
*.
apply
/
eqP
;
rewrite
-
leqn0
.
rewrite
<-
leq_add2l
with
(
p
:=
job_cost
j
)
.
move
:
NOMISS
=>
/
eqP
NOMISS
;
rewrite
-
{
1
}
NOMISS
addn0
.
apply
leq_trans
with
(
n
:=
service
rate
sched
j
t'
.
+
1
);
last
by
apply
EXEC
.
unfold
service
;
rewrite
->
big_cat_nat
with
(
p
:=
t'
.
+
1
)
(
n
:=
job_arrival
j
+
job_deadline
j
);
[
rewrite
leq_add2l
/=
|
by
ins
|
by
apply
ltnW
]
.
by
rewrite
big_nat_recr
//
/=
;
apply
leq_addl
.
Qed
.
(* The same applies for the cumulative service of job j. *)
Lemma
cumulative_service_after_job_deadline_zero
:
forall
t'
t''
,
t'
>=
job_arrival
j
+
job_deadline
j
->
\
sum_
(
t'
<=
t
<
t''
)
service_at
rate
sched
j
t
=
0
.
Proof
.
ins
;
apply
/
eqP
;
rewrite
-
leqn0
.
rewrite
big_nat_cond
;
rewrite
->
eq_bigr
with
(
F2
:=
fun
i
=>
0
);
first
by
rewrite
big_const_seq
iter_addn
mul0n
addn0
leqnn
.
intro
i
;
rewrite
andbT
;
move
=>
/
andP
[
LE
_]
.
by
rewrite
service_after_job_deadline_zero
;
[
by
ins
|
by
apply
leq_trans
with
(
n
:=
t'
)]
.
Qed
.
End
SpecificJob
.
Section
AllJobs
.
(* Consider any task tsk ...*)
Variable
tsk
:
sporadic_task
.
(* ... that doesn't miss any deadline. *)
Hypothesis
no_deadline_misses
:
task_misses_no_deadline
job_cost
job_deadline
job_task
rate
sched
tsk
.
(* Then, for any valid job j of this task, ...*)
Variable
j
:
JobIn
arr_seq
.
Hypothesis
H_job_of_task
:
job_task
j
=
tsk
.
Hypothesis
H_valid_job
:
valid_sporadic_job
task_cost
task_deadline
job_cost
job_deadline
job_task
j
.
(* the service received by job j at any time t' after the deadline is 0. *)
Lemma
service_after_task_deadline_zero
:
forall
t'
,
t'
>=
job_arrival
j
+
task_deadline
tsk
->
service_at
rate
sched
j
t'
=
0
.
Proof
.
rename
H_valid_job
into
PARAMS
;
unfold
valid_sporadic_job
in
*
;
des
;
intros
t'
.
rewrite
-
H_job_of_task
-
PARAMS1
.
by
apply
service_after_job_deadline_zero
,
no_deadline_misses
.
Qed
.
(* The same applies for the cumulative service of job j. *)
Lemma
cumulative_service_after_task_deadline_zero
:
forall
t'
t''
,
t'
>=
job_arrival
j
+
task_deadline
tsk
->
\
sum_
(
t'
<=
t
<
t''
)
service_at
rate
sched
j
t
=
0
.
Proof
.
rename
H_valid_job
into
PARAMS
;
unfold
valid_sporadic_job
in
*
;
des
;
intros
t'
t''
.
rewrite
-
H_job_of_task
-
PARAMS1
.
by
apply
cumulative_service_after_job_deadline_zero
,
no_deadline_misses
.
Qed
.
End
AllJobs
.
End
BasicLemmas
.
End
Schedulability
.
End
Schedulability
.
\ No newline at end of file
This diff is collapsed.
Click to expand it.
task_arrival.v
+
8
−
5
View file @
c3fa11a7
Require
Import
Vbase
task
job
schedule
util_lemmas
Require
Import
Vbase
task
job
schedule
util_lemmas
ssreflect
ssrbool
eqtype
ssrnat
seq
fintype
bigop
.
ssreflect
ssrbool
eqtype
ssrnat
seq
fintype
bigop
.
(* Properties of the job arrival. *)
Module
SporadicTaskArrival
.
Module
SporadicTaskArrival
.
Import
SporadicTaskset
Schedule
.
Import
SporadicTaskset
Schedule
.
Section
ArrivalModels
.
Section
ArrivalModels
.
(* Assume the task period is known. *)
Context
{
sporadic_task
:
eqType
}
.
Context
{
sporadic_task
:
eqType
}
.
Variable
task_period
:
sporadic_task
->
nat
.
Variable
task_period
:
sporadic_task
->
nat
.
...
@@ -14,13 +16,14 @@ Import SporadicTaskset Schedule.
...
@@ -14,13 +16,14 @@ Import SporadicTaskset Schedule.
Variable
arr_seq
:
arrival_sequence
Job
.
Variable
arr_seq
:
arrival_sequence
Job
.
Variable
job_task
:
Job
->
sporadic_task
.
Variable
job_task
:
Job
->
sporadic_task
.
(* We define the sporadic task model *)
(* Then, we define the sporadic task model as follows.*)
Definition
sporadic_task_model
:=
Definition
sporadic_task_model
:=
forall
(
j
j'
:
JobIn
arr_seq
),
forall
(
j
j'
:
JobIn
arr_seq
),
j
<>
j'
->
(* Given two different jobs j and j'
such that
... *)
j
<>
j'
->
(* Given two different jobs j and j' ... *)
job_task
j
=
job_task
j'
->
(* ...
they are from
the same task ... *)
job_task
j
=
job_task
j'
->
(* ...
of
the same task
,
... *)
job_arrival
j
<=
job_arrival
j'
->
(* ...
and arr <= arr'
... *)
job_arrival
j
<=
job_arrival
j'
->
(* ...
if the arrival of j precedes the arrival of j'
...
,
*)
(* then the
next jobs arrives 'period' time units later
. *)
(* then the
arrival of j and the arrival of j' are separated by at least one period
. *)
job_arrival
j'
>=
job_arrival
j
+
task_period
(
job_task
j
)
.
job_arrival
j'
>=
job_arrival
j
+
task_period
(
job_task
j
)
.
End
ArrivalModels
.
End
ArrivalModels
.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment