Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add VeriFast thread safety proof for context switches in SMP port #608

Draft
wants to merge 293 commits into
base: smp
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
293 commits
Select commit Hold shift + click to select a range
eeae596
Replaced asm macro by failing assertion.
tobireinhard Oct 22, 2022
342ab64
Resolved VF parse error: VF does not support const pointers.
tobireinhard Oct 22, 2022
785723f
Replaced asm macros by failing assertion.
tobireinhard Oct 22, 2022
55cfee8
Resolved VF parse error: VF does not support const pointers.
tobireinhard Oct 22, 2022
663ea1f
Resolved VF parse errors.
tobireinhard Oct 22, 2022
47e6fa7
Resolved VF parse errors: const pointers.
tobireinhard Oct 22, 2022
32480e7
Resolved VF errors
tobireinhard Oct 22, 2022
95049a6
Use VeriFast's build-in treatment of `malloc` and `free` instead of p…
tobireinhard Oct 24, 2022
746c02f
Specified font size in VF startup script.
tobireinhard Oct 24, 2022
f1a0170
Initialized memory safety proof for `xTaskCreate`.
tobireinhard Oct 24, 2022
5a7916b
Added predicates to reason about `TCB_t` and substructures.
tobireinhard Oct 24, 2022
80134a6
VeriFast cannot handle casts of side-effectful expressions.
tobireinhard Oct 25, 2022
1042ea8
Refined task control block predicate `TCB_p` such that it can be used…
tobireinhard Oct 25, 2022
06bc0fb
Resolved VF reporting type errors for memset call and disproved some …
tobireinhard Oct 25, 2022
8b958c7
Axiomatized knowledge about RP2040 architecture and added tmp workaro…
tobireinhard Oct 25, 2022
82be7cb
Temporarily eliminated runtime assertion.
tobireinhard Oct 25, 2022
8a8f0ab
Proved memory safety of name-writing loop in `prvInitialiseNewTask`.
tobireinhard Oct 25, 2022
40931d2
Justified `memset` of TCB fields in `prvInitialiseNewTask`.
tobireinhard Oct 25, 2022
a78bc21
Simplified proof state in `prvInitialiseNewTask`.
tobireinhard Oct 26, 2022
d381379
Justified `memset`-ing `pxNewTCB->ucNotifyState` in `prvInitialiseNew…
tobireinhard Oct 26, 2022
8bb4f13
Introduced new type-safe macro for unsigned `pdFALSE` and `pdTRUE`.
tobireinhard Oct 26, 2022
b5f0b2f
Added snippet from RP2040 port.c to verification code base to allow v…
tobireinhard Oct 26, 2022
b185c29
Typo.
tobireinhard Oct 26, 2022
2b82220
Refined stack predicate, validated it and verified `pxPortInitialiseS…
tobireinhard Oct 27, 2022
2bcdc31
Deleted deprecated version of pointer size axiom.
tobireinhard Oct 27, 2022
e238d79
Moved stack predicate and lemmas to separate header.
tobireinhard Oct 27, 2022
551d1da
Renamed `TCB_p` predicate into `uninit_TCB_p`.
tobireinhard Oct 27, 2022
5260817
Added comment on VF command line options to startup script
tobireinhard Oct 27, 2022
06b924d
Verified alignment properties of stack top pointer.
tobireinhard Oct 28, 2022
eedbfe3
Typo.
tobireinhard Oct 28, 2022
ead381f
Verified alignment check of stack top pointer.
tobireinhard Oct 28, 2022
af090b2
Added new stack predicate that reflects the forced alignment of the s…
tobireinhard Nov 1, 2022
800a720
Adapted first half of `prvInitialiseNewTask` to new stack predicate.
tobireinhard Nov 1, 2022
f793c96
Adapted part of `pxPortInitialiseStack` proof to new stack predicate.
tobireinhard Nov 2, 2022
249d220
Verified `pxPortInitialiseStack` for new version of stack predicate.
tobireinhard Nov 2, 2022
0e84d89
Updated stack depth requirements in preconditions to match preconditi…
tobireinhard Nov 2, 2022
97c2583
Verified `prvInitialiseNewTask`.
tobireinhard Nov 2, 2022
e064c38
Added name tags to assembly dummy macros.
tobireinhard Nov 3, 2022
01c19a2
Renamed preprocessed file such that name is legal C identifier.
tobireinhard Nov 3, 2022
2404a2f
Added flag to skip very expensive part of the proof for `prvInitialis…
tobireinhard Nov 3, 2022
94e0f21
Added rewrite to remove const qualifiers from pointers.
tobireinhard Nov 4, 2022
5c9750e
Verified `vListInitialiseItem`.
tobireinhard Nov 4, 2022
ac798f9
Added contract for `portDISABLE_INTERRUPTS` and dummy contracts for l…
tobireinhard Nov 4, 2022
25dda73
Started to define predicates encapsulating access permissions to glob…
tobireinhard Nov 4, 2022
1e4e650
Removed duplicate macro definition.
tobireinhard Nov 4, 2022
66d71c5
Started to verify `taskENTER_CRITICAL`.
tobireinhard Nov 4, 2022
8897e3f
Added specification for enabling and disabling interrupts.
tobireinhard Nov 4, 2022
06d2611
Made config macros from `FreeRTOSConfig.h` available to VeriFast proof.
tobireinhard Nov 4, 2022
91eb6ee
Included reference to core ID in interrupt predicates and added disti…
tobireinhard Nov 7, 2022
c4f5c09
Altered config to ensure that we don't accidentally rely on a concret…
tobireinhard Nov 7, 2022
9fa8c76
Paused partial proof for `xTaskCreate`.
tobireinhard Nov 7, 2022
3d4ad64
Switched to new verification target `vTaskSwitchContext`.
tobireinhard Nov 7, 2022
7e75d7a
Refined lock predicates and contracts for lock macros to match expect…
tobireinhard Nov 10, 2022
63d8c5a
Rewrote side-effectful assertion such that VeriFast can process it.
tobireinhard Nov 10, 2022
29e14be
Verified minimal contract for `xTaskGetCurrentTaskHandle`.
tobireinhard Nov 10, 2022
d746a27
Added missing task-ISR lock invariant to post condition of acquision …
tobireinhard Nov 11, 2022
e33d940
Stopped tracking preprocecssing output.
tobireinhard Nov 11, 2022
49f0dc1
Added preprocessing out dir to .gitignore.
tobireinhard Nov 11, 2022
0a31349
Added automatic rewrite to remove const qualifiers occurring before a…
tobireinhard Nov 11, 2022
7c9711c
Reverted manual VF rewrites concerning const pointers. Respective rew…
tobireinhard Nov 11, 2022
1e2acf6
Linked const pointer rewrite to filed VeriFast issue 333.
tobireinhard Nov 13, 2022
a470fec
Added automatic deletion of void casts (used to suppress warnings) an…
tobireinhard Nov 13, 2022
a7fdaca
Reverted manual rewrites involving const pointers. Automatic rewrites…
tobireinhard Nov 13, 2022
d2f10a6
`vTaskSwitchContexxt` assumes that that interrupts have been deactiva…
tobireinhard Nov 15, 2022
7a5119e
Nightly build of Nov 14, 2022 broke old proof for `vTaskCreate`. Igno…
tobireinhard Nov 15, 2022
d95976e
Added info about available tasks to lock predicate.
tobireinhard Nov 16, 2022
360afe4
Cleaned up lock predicate header.
tobireinhard Nov 16, 2022
dbf03a0
Introduced predicates to differentiate between public and private par…
tobireinhard Nov 16, 2022
327423e
TCB of currently scheduled task on core C is interrupt protected on c…
tobireinhard Nov 16, 2022
d63a8f8
Renamed predicate encapsulating access permissions to core local vari…
tobireinhard Nov 16, 2022
54523ec
Included global variables `pxCurrentTCBs` and `pxYieldingPendings` in…
tobireinhard Nov 16, 2022
4eb2fa5
Wrote contracts for lock release operations.
tobireinhard Nov 16, 2022
b330847
Added preliminary post condition for `vTaskSwitchContext`
tobireinhard Nov 16, 2022
7675b3b
Rewrote macro `taskCHECK_FOR_STACK_OVERFLOW` such that VF can handle it.
tobireinhard Nov 16, 2022
383a055
`taskCHECK_FOR_STACK_OVERFLOW` assumes minimal stack size. Updated st…
tobireinhard Nov 16, 2022
c3c350f
`vTaskSwitchContext` now has access to the current task's stack.
tobireinhard Nov 16, 2022
a7d1ca3
VF rewrite: Fixed an evaluation order in `taskCHECK_FOR_STACK_OVERFLOW`.
tobireinhard Nov 16, 2022
2f0b8bc
Added proof steps outlining the verification of stack inspection. Als…
tobireinhard Nov 16, 2022
d3bda01
Verified macro `taskCHECK_FOR_STACK_OVERFLOW`.
tobireinhard Nov 17, 2022
63a8d73
Apdated proof for `vTaskSwitchContext` to rely on the proof of `taskC…
tobireinhard Nov 17, 2022
fb01980
Verified new contract for `xTaskGetCurrentTaskHandle`.
tobireinhard Nov 17, 2022
9b2871b
Formulated first version of contract for `prvSelectHighestPriorityTas…
tobireinhard Nov 17, 2022
6dcaef4
Added loop invariant to main search loop in `prvSelectHighestPriority…
tobireinhard Nov 17, 2022
c9e61fc
Introduced initial formulation of predicate to capture shared ready l…
tobireinhard Nov 18, 2022
e629319
Relaxed contract of `xTaskGetCurrentTaskHandle`.
tobireinhard Nov 18, 2022
1888670
Removed unneeded precondition
tobireinhard Nov 18, 2022
02e019f
Highlighted that reused list proofs assume single-core setting.
tobireinhard Nov 18, 2022
f5c0a64
Made isr lock predicate abstract.
tobireinhard Nov 18, 2022
b1fc658
Added single-core list predicates and proofs. Most proofs are comment…
tobireinhard Nov 18, 2022
8f463be
VF rewrite: Changed type of `List_t.xListEnd` to match expectations o…
tobireinhard Nov 18, 2022
cf65065
Used single-core list predicate `xLIST` to express access permissions…
tobireinhard Nov 18, 2022
5b6a92f
Added TODO
tobireinhard Nov 18, 2022
81355bc
Added DLS lemmas related to`split`.
tobireinhard Nov 21, 2022
5cf8b4e
Added shared global variable `xSchedulerRunning` to task-isr lock inv…
tobireinhard Nov 21, 2022
3fee2ec
Added more DLS lemmas.
tobireinhard Nov 21, 2022
92a925b
Verified selection of initial task item in search loop in `prvSelectH…
tobireinhard Nov 21, 2022
de36572
Added minimal loop invariant to inner search loop in `prvSelectHighes…
tobireinhard Nov 21, 2022
35aef80
Proved that `pxTaskItem` points to valid list item before inner searc…
tobireinhard Nov 21, 2022
2fd6bcc
Updated predicate `xLIST_ITEM` to jeep up with breaking VF change.
tobireinhard Nov 22, 2022
49643b6
Partial proof justifying that updates of `pxTaskItem` in inner search…
tobireinhard Nov 22, 2022
f7e537a
Restructured proof.
tobireinhard Nov 22, 2022
538f29c
Closed some predicates to simplify proof state.
tobireinhard Nov 22, 2022
397cb12
Added lemmas to reason about updates to pointers in the ready list of…
tobireinhard Nov 22, 2022
5e2f51c
Reformatted lemma proofs to improve readability.
tobireinhard Nov 22, 2022
9e3ea90
Added lemma `DLS_end_next_close` to help closing DLS opened with `DLS…
tobireinhard Nov 23, 2022
be9de4d
Added lemma `DLS_nonEndItem_next_close` to help closing DLS opened wi…
tobireinhard Nov 23, 2022
f44473b
Applied closing lemmas.
tobireinhard Nov 23, 2022
9d1b47c
Added lemmas to simplify opening and closing DLS for cases of the for…
tobireinhard Nov 23, 2022
49af8fd
Finished verification of iteration updates in `prvSelectHighestPriori…
tobireinhard Nov 23, 2022
53189c4
Added new version of DLS opening lemma that reduces case splits in DL…
tobireinhard Nov 26, 2022
28fb658
Proved last case in lemma `DLS_open_2`. Will need to revisit once the…
tobireinhard Nov 27, 2022
1393ae3
Set up lemma `DLS_close_2` in accordance to `DLS_open_2`. Proved case…
tobireinhard Nov 28, 2022
bb00bee
Finished proof of `DLS_close_2`.
tobireinhard Nov 28, 2022
c0df2a2
Adapted proof of `prvSelectHighestPriorityTask` to use new DLS repres…
tobireinhard Nov 28, 2022
2048fb8
Commented old opening and closing lemmas out and switched back from Z…
tobireinhard Nov 28, 2022
b310efa
Added ready list lemmas.
tobireinhard Nov 29, 2022
014acb9
Refactored lock predicates to improve readability.
tobireinhard Nov 29, 2022
e8b8234
Renamed predicates to comply with naming conventions
tobireinhard Nov 29, 2022
22dc5c1
Added proof idea and TODOs. Need to refactor single-core list predica…
tobireinhard Nov 29, 2022
70f1041
Added documentation.
tobireinhard Nov 29, 2022
e800ebd
Exposed node owners in all predicates related to nodes. Adapted proof…
tobireinhard Nov 30, 2022
78de786
Expanded lock invariant to give us access to shared segments of all r…
tobireinhard Nov 30, 2022
fe5612c
Extended lock invariants to justify safe access to ready tasks as wel…
tobireinhard Nov 30, 2022
6f782b4
VF start script takes font size as 2nd param
tobireinhard Dec 1, 2022
cd3fa4e
Added adaptation of Aalok's and Nathan's single-core proof for `uxLis…
tobireinhard Dec 1, 2022
122ecde
Proved that call to `uxListRemove` in `prvSelectHighestPriorityTask`i…
tobireinhard Dec 1, 2022
0633bab
Added single-core proof for `vListInsertEnd` by Aalok Thakkar and Nat…
tobireinhard Dec 1, 2022
8976bd4
Adapted single-core proof of `vListInitialise` to new version of pred…
tobireinhard Dec 1, 2022
9b2bb08
Extended precondition of `vListInsertEnd` to prove absence of overflows.
tobireinhard Dec 1, 2022
2c6d359
Update tasks.c
tobireinhard Dec 1, 2022
eb1cfa5
Exposed running state macros to VF.
tobireinhard Dec 2, 2022
df780a1
Introduced list of flat list of tasks in lock invariant. Simplifies a…
tobireinhard Dec 2, 2022
b44eb85
Deleted deprecated predicate and lemmas.
tobireinhard Dec 2, 2022
3be9d76
Made `sharedSeg_TCB_p` precise to allow merging of fractions without …
tobireinhard Dec 2, 2022
1919f81
Deleted deprecated lemmas and predicates.
tobireinhard Dec 2, 2022
e4db1f8
Refined lock invariant to only give read permission to all tasks and …
tobireinhard Dec 3, 2022
dda2dbd
Added states list to lock invariant.
tobireinhard Dec 3, 2022
0df45b4
Added lemmas that allow updating the lock invariant after a state upd…
tobireinhard Dec 3, 2022
e403e8b
Added lemma to update the read permissions for unscheduled tasks afte…
tobireinhard Dec 3, 2022
6a0b211
Added lemmas to define updated state lists and reason locally about r…
tobireinhard Dec 4, 2022
fbf4ba9
Added lemmas to update read permissions for unscheduled tasks after n…
tobireinhard Dec 4, 2022
b594404
Restored loop invariant at end of task-swapping branch
tobireinhard Dec 4, 2022
61bffc4
Adapted loop invariant to reflect potential change of state lists.
tobireinhard Dec 4, 2022
00bb9d4
Verified runtime assertion that running task is either scheduled or y…
tobireinhard Dec 4, 2022
e71756e
Proved that decrementing `uxTopReadyPriority` does not lead to underf…
tobireinhard Dec 4, 2022
346a7f7
Added lemma to close ready lists predicate.
tobireinhard Dec 5, 2022
ee2922a
Finished some proof branches in `prvSelectHighestPriorityTask`.
tobireinhard Dec 5, 2022
4ac0f5e
Added lemma to close reordered ready lists.
tobireinhard Dec 5, 2022
d028b1d
Added lemma to reason about reordering of ready lists.
tobireinhard Dec 6, 2022
7fe2ec2
Strengthened postcondition of reordering lemma.
tobireinhard Dec 6, 2022
e68b459
Refined precondition of reordering lemma.
tobireinhard Dec 6, 2022
f98779f
Finished proof branch dealing with ready list reordering. Strict posi…
tobireinhard Dec 6, 2022
9a81e7b
Reordered verifast args in startup script to not only support the IDE…
tobireinhard Dec 6, 2022
136b1d6
Updated ready list invariant from requiring exactly 1 idle task to co…
tobireinhard Dec 7, 2022
99d46f9
Guarded unsafe decrements of `uxTopReadyPriority` and `uxCurrentPrior…
tobireinhard Dec 8, 2022
eef76ea
Simplified invariants.
tobireinhard Dec 8, 2022
2e78ed5
Renamed VeriFast proof direcotry to comply with structure of main Fre…
tobireinhard Dec 9, 2022
cc7ed1e
Copied modified source and header files to proof subdirectory.
tobireinhard Dec 9, 2022
dcbaf38
Preprocessing script prefers modified files in proof subdirectory ove…
tobireinhard Dec 9, 2022
1d3fcdf
Reverted modified source and header files to last commit before we st…
tobireinhard Dec 9, 2022
21992b6
Startup script expects paths to relevant directories as arguments ins…
tobireinhard Dec 9, 2022
60f1530
Deleted deprecated files.
tobireinhard Dec 9, 2022
4f71cea
Moved preprocessing step to separate shell script.
tobireinhard Dec 9, 2022
deee4a4
Sorted include paths to make them easier readable.
tobireinhard Dec 9, 2022
d945764
Grouped preprocessor flags to make preprocessing command easier to read.
tobireinhard Dec 9, 2022
c11a401
Startup and preprocessing scripts don't rely on the current working d…
tobireinhard Dec 10, 2022
d989b34
Typo
tobireinhard Dec 10, 2022
6ca1377
Moved computation of preprocessor flags to separate shell script.
tobireinhard Dec 10, 2022
d1a333b
Deleted deprecated variables.
tobireinhard Dec 10, 2022
53293fe
Renamed pp shell script.
tobireinhard Dec 10, 2022
43f9afe
Setup first draft of diff script. Need to fine tune preprocessor flags.
tobireinhard Dec 10, 2022
f56d20b
Removed comments and pragmas from diffed preprocessor output.
tobireinhard Dec 10, 2022
2ae20ff
Stored pp script args in diff script in variables to improve readabil…
tobireinhard Dec 12, 2022
8a01a76
Deactivated assertion during the computation of the diff between the …
tobireinhard Dec 12, 2022
114fd0f
Added some print outs.
tobireinhard Dec 12, 2022
c50e8bd
Diff report is now written to file.
tobireinhard Dec 12, 2022
9228326
Diff report is now written to file.
tobireinhard Dec 12, 2022
dd85fd6
Ignore generated states.
tobireinhard Dec 12, 2022
0e018c4
Merge branch 'verifast_switch_context' of https://github.com/Tobias-i…
tobireinhard Dec 12, 2022
574cc7e
Deleted generated diff report
tobireinhard Dec 12, 2022
5fcf51f
Deleted deprecated files.
tobireinhard Dec 12, 2022
01e50be
Documented scripts.
tobireinhard Dec 12, 2022
b0bfa12
Made preprocessing scripts more modular.
tobireinhard Dec 13, 2022
1a3870c
Deleted deprecated script
tobireinhard Dec 13, 2022
5e72a83
Deleted deprecated code.
tobireinhard Dec 13, 2022
2395267
Renamed vfide startup script.
tobireinhard Dec 13, 2022
7ec3eab
Added script to start the verifast command line tool.
tobireinhard Dec 13, 2022
d49f7e3
Renamed startup scripts.
tobireinhard Dec 13, 2022
5365223
Deleted comments.
tobireinhard Dec 13, 2022
8b0048d
Statup scripts ensure that output directories exist.
tobireinhard Dec 13, 2022
2fccb9a
Removed proof annotations in `xTaskCreate`.
tobireinhard Dec 13, 2022
3e1ba55
Deleted proof annotations in `prvInitialiseNewTask`.
tobireinhard Dec 13, 2022
676e9fd
Deleted proof annotations in `prvInitialiseNewTask`.
tobireinhard Dec 13, 2022
de64106
Deleted proof annotations in `prvAddNewTaskToReadyList`
tobireinhard Dec 13, 2022
35cae90
Deleted deprecated proofs.
tobireinhard Dec 13, 2022
541e671
Deleted deprecated proofs.
tobireinhard Dec 13, 2022
8458220
Merge branch 'verifast_switch_context' of https://github.com/Tobias-i…
tobireinhard Dec 13, 2022
1672d29
Removed duplicate code in predicates.
tobireinhard Dec 13, 2022
ff76369
Removed deprecated predicates and proofs.
tobireinhard Dec 13, 2022
3675aa6
Deleted deprecated predicates and wrote some documentation.
tobireinhard Dec 13, 2022
677ffa8
Renamed predicate `stack_p_2` into `stack_p`
tobireinhard Dec 13, 2022
0e90603
Removed unneeded validation code.
tobireinhard Dec 20, 2022
3ca111b
Added statistics about the verified lines of code and the annotation …
tobireinhard Dec 21, 2022
4a7c975
Diff script now writes diff to stdout instead of file. Script returns…
tobireinhard Dec 22, 2022
63154a4
Added github workflow that checks for proof divergence on every pull …
tobireinhard Dec 22, 2022
6dc6c5d
Renamed TCB predicates to convey access rights expressed by each pred…
tobireinhard Dec 28, 2022
04ab514
Renamed proof headers. Removed "verifast" prefix where unnecessary.
tobireinhard Dec 28, 2022
11ab1a0
Deleted deprecated proof header.
tobireinhard Dec 28, 2022
75111c2
Deleted deprecated proof headers.
tobireinhard Dec 28, 2022
f15540c
Handled minor TODOs in proof headers.
tobireinhard Dec 28, 2022
9bbe885
Deleted unnecessary list axioms.
tobireinhard Dec 28, 2022
d85e9cb
Renamed directory for preprocessor scripts.
tobireinhard Dec 28, 2022
9b07092
Added help text to diff and startup scripts.
tobireinhard Dec 28, 2022
c0f5ace
Updated repository structure in README
tobireinhard Dec 28, 2022
6dc3c42
Explained how to check the proof in the REAMDE.
tobireinhard Dec 28, 2022
286ba50
Added disclaimer to README.
tobireinhard Dec 28, 2022
944cc51
Removed deprecated TODOs.
tobireinhard Dec 28, 2022
3057a18
Updated proof documentation.
tobireinhard Dec 28, 2022
4033b09
Added documentation of the locking discipline and renamed some predic…
tobireinhard Dec 28, 2022
03b93e4
Removed comments.
tobireinhard Dec 28, 2022
7298a32
Documented proof result and proof assumptions.
tobireinhard Dec 29, 2022
38790b2
Added explanation of verifast.
tobireinhard Dec 29, 2022
67a3bcb
Explained locking discipline and lock invariants in README.
tobireinhard Dec 29, 2022
3e473ed
Added section on proof maintenance in README.
tobireinhard Dec 29, 2022
51d3da3
Added first draft of section on reusing list proofs to README.
tobireinhard Dec 29, 2022
a7938ef
Elaborated on reusing list proofs.
tobireinhard Dec 29, 2022
17004fb
Deleted the old explanation of reusing list proofs.
tobireinhard Dec 29, 2022
b0e2d1e
Updated proof directory content listing in README.
tobireinhard Dec 29, 2022
5cbf66c
Deleted deprecated README file.
tobireinhard Dec 29, 2022
53d3062
Deleted comments.
tobireinhard Dec 29, 2022
e644877
Explained found bug in README.
tobireinhard Dec 30, 2022
1b0869d
Fixed invalid characters in formula.
tobireinhard Dec 30, 2022
9df8611
Updated documentation of preprocessing scripts and deleted comments.
tobireinhard Dec 31, 2022
4386c13
Minor adjustment of shebang lines in preprocessing scripts.
tobireinhard Dec 31, 2022
259fb14
Improved readability of printouts in rewrite script.
tobireinhard Dec 31, 2022
c6b76ca
Updated version of tested VeriFast build
tobireinhard Dec 31, 2022
ea989ae
Minor correction in README.
tobireinhard Dec 31, 2022
0adb318
Updated directory structure depicted in README.
tobireinhard Dec 31, 2022
3ed8cbb
Minor corrections in README.
tobireinhard Dec 31, 2022
4cc5b7d
Minor corrections in README.
tobireinhard Dec 31, 2022
f335145
Update README.md
tobireinhard Dec 31, 2022
4f80a72
Minor layout corrections in README.
tobireinhard Dec 31, 2022
f2744eb
Corrected typo in REAME.
tobireinhard Dec 31, 2022
72ab40f
Corrected typo in REAME.
tobireinhard Dec 31, 2022
7b054c7
Merge branch 'verifast_switch_context' of https://github.com/Tobias-i…
tobireinhard Dec 31, 2022
7bb871c
Corrected typo in README.
tobireinhard Dec 31, 2022
48290b9
Minor corrections in README.
tobireinhard Dec 31, 2022
1eb83cd
Wrote more documentation.
tobireinhard Jan 3, 2023
c57b62a
Added some guidance on how to read the proof.
tobireinhard Jan 4, 2023
2af93b5
Expanded section in README on how to read the proof.
tobireinhard Jan 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/verifast-proof-diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: verifast-proof-diff
on: [pull_request]
jobs:
proof_diff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: Test/VeriFast/tasks/vTaskSwitchContext/diff.sh `pwd`
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ __pycache__/
# Ignore certificate files.
*.pem
*.crt

# Ignore OS bookkeeping files
.DS_Store
.vscode/settings.json
8 changes: 8 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[submodule "verification/verifast/demos/FreeRTOS-SMP-Demos"]
path = Test/VeriFast/tasks/vTaskSwitchContext/demos/FreeRTOS-SMP-Demos
url = https://github.com/Tobias-internship-AWS-2022/FreeRTOS-SMP-Demos.git
branch = verifast
[submodule "verification/verifast/sdks/pico-sdk"]
path = Test/VeriFast/tasks/vTaskSwitchContext/sdks/pico-sdk
url = https://github.com/Tobias-internship-AWS-2022/pico-sdk.git
branch = verifast
8 changes: 8 additions & 0 deletions Test/VeriFast/tasks/vTaskSwitchContext/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Ignore log files
pp_log

# Ignore preprocessing output
preprocessed_files

# Ignore generated stats
stats
601 changes: 601 additions & 0 deletions Test/VeriFast/tasks/vTaskSwitchContext/README.md

Large diffs are not rendered by default.

Submodule FreeRTOS-SMP-Demos added at 345437
80 changes: 80 additions & 0 deletions Test/VeriFast/tasks/vTaskSwitchContext/diff.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#!/bin/bash


# This script produces a diff between two versions of 'tasks.c':
# (i) The production version of the source file and (ii) the verified version.
# The diff is computed from the preprocessed version of both files which include
# all code relevant to the proof. That is, that any change in a file required
# by the VeriFast proof will shot up in the diff.
# The diff report will be written to 'stats/diff_report.txt' directory.
#
# This script expects the following arguments:
# $1 : Absolute path to the base directory of this repository.


# Checking validity of command line arguments.
HELP="false"
if [ $1 == "-h" ] || [ $1 == "--help" ]; then
HELP="true"
else
if [ $# != 1 ] ; then
echo Wrong number of arguments. Found $#, expected 1.
HELP="true"
fi

if [ ! -d "$1" ]; then
echo Directory "$1" does not exist.
HELP="true"
fi
fi

if [ "$HELP" != "false" ]; then
echo Expected call of the form
echo "diff.sh <REPO_BASE_DIR>"
echo "where <REPO_BASE_DIR> is the absolute path to the base directory of this repository."
exit
fi


# Relative or absolute path to the directory this script and `paths.sh` reside in.
PREFIX=`dirname $0`
# Absolute path to the base of this repository.
REPO_BASE_DIR="$1"


# Load functions used to compute paths.
. "$PREFIX/paths.sh"


VF_PROOF_BASE_DIR=`vf_proof_base_dir $REPO_BASE_DIR`
PP_SCRIPT_DIR=`pp_script_dir $REPO_BASE_DIR`
PP="$PP_SCRIPT_DIR/preprocess_file_for_diff.sh"
LOG_DIR=`pp_log_dir $REPO_BASE_DIR`
STATS_DIR=`stats_dir $REPO_BASE_DIR`

# Unpreprocessed verions of tasks.c
PROD_TASKS_C=`prod_tasks_c $REPO_BASE_DIR`
VF_TASKS_C=`vf_annotated_tasks_c $REPO_BASE_DIR`

# Preprocessed versions of tasks.c
PP_OUT_DIR=`pp_out_dir $REPO_BASE_DIR`
PP_PROD_TASKS_C=`pp_prod_tasks_c $REPO_BASE_DIR`
PP_VF_TASKS_C=`pp_vf_tasks_c $REPO_BASE_DIR`

ensure_output_dirs_exist $REPO_BASE_DIR

echo preprocessing production version of 'tasks.c'
$PP $PROD_TASKS_C $PP_PROD_TASKS_C \
"$LOG_DIR/pp_prod_tasks_c_error_report.txt" \
$REPO_BASE_DIR $VF_PROOF_BASE_DIR

echo preprocessing verified version of 'tasks.c'
$PP $VF_TASKS_C $PP_VF_TASKS_C \
"$LOG_DIR/pp_vf_tasks_c_error_report.txt" \
$REPO_BASE_DIR $VF_PROOF_BASE_DIR


echo Computing diff:
echo

git diff --no-index --ignore-all-space $PP_PROD_TASKS_C $PP_VF_TASKS_C
Loading