FreeRTOS-Kernel/FreeRTOS/Test/VeriFast/list
Soren Ptak 3a2f6646f0
Use CI-CD-Github-Actions for spelling and formatting, add in the bot formatting action, update the CI-CD workflow files. Fix incorrect spelling and formatting on files. (#1083)
* Use new version of CI-CD Actions,  checkout@v3 instead of checkout@v2 on all jobs
* Use cSpell spell check, and use ubuntu-20.04 for formatting check
* Add in bot formatting action
* Update freertos_demo.yml and freertos_plus_demo.yml files to increase github log readability
* Add in a Qemu demo onto the workflows.
2023-09-06 12:35:37 -07:00
..
listLIST_IS_EMPTY.c Use CI-CD-Github-Actions for spelling and formatting, add in the bot formatting action, update the CI-CD workflow files. Fix incorrect spelling and formatting on files. (#1083) 2023-09-06 12:35:37 -07:00
README.md List proofs and signoff (#194) 2020-08-27 11:59:12 -07:00
uxListRemove.c Use CI-CD-Github-Actions for spelling and formatting, add in the bot formatting action, update the CI-CD workflow files. Fix incorrect spelling and formatting on files. (#1083) 2023-09-06 12:35:37 -07:00
vListInitialise.c Use CI-CD-Github-Actions for spelling and formatting, add in the bot formatting action, update the CI-CD workflow files. Fix incorrect spelling and formatting on files. (#1083) 2023-09-06 12:35:37 -07:00
vListInitialiseItem.c Use CI-CD-Github-Actions for spelling and formatting, add in the bot formatting action, update the CI-CD workflow files. Fix incorrect spelling and formatting on files. (#1083) 2023-09-06 12:35:37 -07:00
vListInsert.c Use CI-CD-Github-Actions for spelling and formatting, add in the bot formatting action, update the CI-CD workflow files. Fix incorrect spelling and formatting on files. (#1083) 2023-09-06 12:35:37 -07:00
vListInsertEnd.c Use CI-CD-Github-Actions for spelling and formatting, add in the bot formatting action, update the CI-CD workflow files. Fix incorrect spelling and formatting on files. (#1083) 2023-09-06 12:35:37 -07:00

FreeRTOS list proofs

The list predicates and proofs are inspired by and based on the work from Ferreira et al. (STTT'14).

The main shape predicate is a doubly-linked list segment (DLS), as defined by Ferreira et al. in Fig 15. A DLS is defined by two xLIST_ITEM struct pointers n and m (possibly pointing to the same item) which are the start and end of the segment. We track the item pointers and values within the DLS in the lists cells and vals, respectively. Therefore n and m are the first and last items of cells.

          +--+     +--+
 -----n-> |*n| ... |*m| -mnext->
 <-nprev- |  |     |  | <-m-----
          +--+     +--+
          ^-----------^
           DLS(n, nprev, mnext, m)

With base case: n == m (single item case)

          +--+
 -----n-> |*n| -mnext->
 <-nprev- |  | <-n-----
          +--+
          ^--^
          xLIST_ITEM
          DLS(n, nprev, mnext, n)

Cons case:

          +--+      +--+     +--+
 -----n-> |*n| -o-> |*o| ... |*m| -mnext->
 <-nprev- |  | <-n- |  |     |  | <-m-----
          +--+      +--+     +--+
          ^--^      ^-----------^
          xLIST_ITEM DLS(o, n, mnext, m)

          ^---------------------^
          DLS(n, nprev, mnext, m)

A DLS can be made into a well-formed list by joining n and m into a cycle. Note that unlike Ferreira et al.'s list shape predicate, we always start with the sentinel end item to avoid a top-level case-split. So in the following diagram the start and end of the DLS are end and the item-before-end endprev.

 .-----------------------------------.
 |     +--------+     +--------+     |
  `--> |*end    | ... |*endprev| ----'
 .---- |        |     |        | <---.
 |     +--------+     +--------+     |
  `----------------------------------'
       ^-----------------------^
        DLS(end, endprev, end, endprev)

References