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
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
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
RT-PROOFS
PROSA - Formally Proven Schedulability Analysis
Commits
6461aa51
Commit
6461aa51
authored
8 years ago
by
Felipe Cerqueira
Browse files
Options
Downloads
Patches
Plain Diff
Add new lemmas for counting and sorting
parent
74126db1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
util/counting.v
+9
-0
9 additions, 0 deletions
util/counting.v
util/sorting.v
+12
-0
12 additions, 0 deletions
util/sorting.v
with
21 additions
and
0 deletions
util/counting.v
+
9
−
0
View file @
6461aa51
...
...
@@ -4,6 +4,15 @@ From mathcomp Require Import ssreflect ssrbool eqtype ssrnat seq fintype bigop.
(* Additional lemmas about counting. *)
Section
Counting
.
Lemma
count_filter_fun
:
forall
(
T
:
eqType
)
(
l
:
seq
T
)
P
,
count
P
l
=
size
(
filter
P
l
)
.
Proof
.
intros
T
l
P
.
induction
l
;
simpl
;
first
by
done
.
by
destruct
(
P
a
);
[
by
rewrite
add1n
/=
;
f_equal
|
by
rewrite
add0n
]
.
Qed
.
Lemma
count_or
:
forall
(
T
:
eqType
)
(
l
:
seq
T
)
P
Q
,
count
(
fun
x
=>
P
x
||
Q
x
)
l
<=
count
P
l
+
count
Q
l
.
...
...
This diff is collapsed.
Click to expand it.
util/sorting.v
+
12
−
0
View file @
6461aa51
...
...
@@ -20,6 +20,18 @@ Section Sorting.
by
rewrite
addnS
ltnS
leq_addr
.
Qed
.
Lemma
sort_ordered
:
forall
{
T
:
eqType
}
(
leT
:
rel
T
)
(
s
:
seq
T
)
x0
idx
,
sorted
leT
s
->
idx
<
(
size
s
).
-1
->
leT
(
nth
x0
s
idx
)
(
nth
x0
s
idx
.
+
1
)
.
Proof
.
intros
T
leT
s
x0
idx
SORT
LT
.
induction
s
;
first
by
rewrite
/=
ltn0
in
LT
.
simpl
in
SORT
,
LT
;
move
:
SORT
=>
/
pathP
SORT
.
by
simpl
;
apply
SORT
.
Qed
.
Lemma
sorted_rcons_prefix
:
forall
{
T
:
eqType
}
(
leT
:
rel
T
)
s
x
,
sorted
leT
(
rcons
s
x
)
->
...
...
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