mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-12-15 16:15:08 -05:00
Prove buffer lemmas (#124)
* Prove buffer lemmas * Update queue proofs to latest kernel source All changes were syntactic due to uncrustify code-formatting * Strengthen prvCopyDataToQueue proof * Add extract script for diff comparison Co-authored-by: Yuhui Zheng <10982575+yuhui-zheng@users.noreply.github.com>
This commit is contained in:
parent
c720c18ada
commit
8e36bee30e
26 changed files with 2021 additions and 1762 deletions
|
|
@ -328,6 +328,22 @@ lemma void remove_remove_nth<t>(list<t> xs, t x)
|
|||
}
|
||||
}
|
||||
|
||||
/* Following lemma from `verifast/bin/rt/_list.java`. Renamed to
|
||||
avoid clash with listex.c's nth_drop lemma. */
|
||||
lemma void nth_drop2<t>(list<t> vs, int i)
|
||||
requires 0 <= i && i < length(vs);
|
||||
ensures nth(i, vs) == head(drop(i, vs));
|
||||
{
|
||||
switch (vs) {
|
||||
case nil:
|
||||
case cons(v, vs0):
|
||||
if (i == 0) {
|
||||
} else {
|
||||
nth_drop2(vs0, i - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lemma void enq_lemma<t>(int k, int i, list<t> xs, list<t> ys, t z)
|
||||
requires 0 <= k && 0 <= i && 0 < length(xs) && k < length(xs) && i < length(xs) && take(k, rotate_left(i, xs)) == ys;
|
||||
ensures take(k+1, rotate_left(i, update((i+k)%length(xs), z, xs))) == append(ys, cons(z, nil));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue