Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
POLLIEN Baptiste
paparazziframac
Commits
b9731716
Commit
b9731716
authored
May 21, 2021
by
GARION Christophe
Browse files
fmics21: update README, correct typos and add links to verified functions
parent
a5cb0535
Changes
1
Hide whitespace changes
Inline
Sidebyside
Showing
1 changed file
with
77 additions
and
55 deletions
+77
55
README.md
README.md
+77
55
No files found.
README.md
View file @
b9731716
FramaC Verification of Paparazzi
=================================
This GitLab project is a fork of Paparazzi UAV autopilot
(https://github.com/paparazzi/paparazzi) that verify
`pprz_algebra`
library using FramaC.
This project adds the ACSL annotations in the code and provide a
script to automatically launch the verification. FramaC
analyses the code and checks the absence of RTE (_RunTime
Errors_) and some functional properties.
This GitLab repository is a fork of Paparazzi UAV autopilot repository
(https://github.com/paparazzi/paparazzi). The aim of this project is
to verify the
`pprz_algebra`
library using FramaC.
This project adds ACSL annotations and provides a script to
automatically launch FramaC. FramaC analyses the code, checks for
the absence of RTE (_RunTime Errors_) and verify some functional
properties.
Required software

...
...
@@ 26,81 +27,102 @@ fixes a bug that prevented proving some goals. Also, the
_statement contracts_
are used in the proofs, but this feature
has been removed in newer versions.
How to
run
the verification
:
How to
launch
the verification
process

First, go to the
`sw/airborne`
directory:
```
cd sw/airborne
```
Update the variable
`FRAMAC_PREFIX`
in
`framacanalysis.sh`
with the path of the directory containing FramaC binary. Then,
launch the script that start the analysis:
launch the script that start
s
the analysis:
```
./framacanalysis.sh
```
The WP smoke tests can be enable with the environment variable
`SMOKE`
as follow:
The WP smoke tests can be enable
d
with the environment variable
`SMOKE`
as follow
s
:
```
SMOKE=1 ./framacanalysis.sh
```
Quick descri
t
pion of modified files
:
Quick descrip
t
ion of modified files


`sw/airborne/framacanalysis.sh`
: Script to automatically
launch the verification using FramaC.

`sw/airborne/outputframacanalysis.sh`
: A python script
used by
`framacanalysis.sh`
to read and analyse the results
from FramaC.

`sw/airborne/math/pprz_algebra_(intfloatdouble).(hc)`
:
Mathematical library of Paparazzi that has been verified. These
files have been annotated with ACSL.

`sw/airborne/math/pprz_algebra_(intfloatdouble)_frama_c.h`
:
Files containing definition of predicates, lemma and logical
functions used to verify the absence of RTE in the library.

`sw/airborne/framacanalysis.sh`
: a shell script that automatically
launches the verification using FramaC.

`sw/airborne/outputframacanalysis.sh`
: a Python script used by
`framacanalysis.sh`
to read and analyse the results from FramaC.

`sw/airborne/math/pprz_algebra_(intfloatdouble).(hc)`
: the
mathematical library of Paparazzi that has been verified. These files
have been annotated with ACSL.

`sw/airborne/math/pprz_algebra_(intfloatdouble)_frama_c.h`
: files
containing definition of predicates, lemmas and logical functions used
to verify the absence of RTE in the library.

`sw/airborne/math/pprz_algebra_float_convert_rmat_frama_c.h`
:
D
efinition of predicates, lemma and logical functions for the
d
efinition of predicates, lemma
s
and logical functions for the
verification of functional properties.

`sw/airborne/.framac/wp/interactive`
:
All the
Coq scripts
containing the proof of certain
lemma.

`sw/airborne/.framac/wp/script`
:
All
WP scripts containing
the tactics
used to prove some goals.

`sw/airborne/.framac/wp/interactive`
: Coq scripts
containing the
proof
lemma
s
.

`sw/airborne/.framac/wp/script`
: WP scripts containing
the tactics
used to prove some goals.
The verification:

The FramaC verification combines the analysis of the
[
EVA
](
https://framac.com/fcplugins/eva.html
)
and
[
WP
](
https://framac.com/fcplugins/wp.html
)
plugins. The
plugin EVA requires a program entry point (a
main or a function) to start its analysis. The script
`framacanalysis.sh`
find automatically all the function's
name of the library using ctags. Then, the FramaC verification is
launched for every function
`FUNCTION`
with the following
parameters:

`rte`
: Add RTE annotations in the code.

`nowarnleftshiftnegative`
: Allow left shift for negative values.

`eva libentry main $FUNCTION`
: Launch EVA analysis with
Verification process

The verification process combines the analysis of the
[
EVA
](
https://framac.com/fcplugins/eva.html
)
and
[
WP
](
https://framac.com/fcplugins/wp.html
)
plugins of FramaC. The
EVA plugin requires a program entry point (a
`main`
or a function) to
start its analysis. The script
`framacanalysis.sh`
finds
automatically all the names of the functions in the library using
ctags. Then, verification is launched for every function
`FUNCTION`
with the following parameters:

`rte`
: adds RTE annotations in the code.

`nowarnleftshiftnegative`
: allows left shift for negative values.

`eva libentry main $FUNCTION`
: launches EVA analysis with
`$FUNCTION`
as the entry point. The initial state is determined by
the _preconditions_ in the contract of the function.

`wpfct $FUNCTION`
: Launch the WP verification with the options:

`wpcache update`
: Enable and use the cache.

`wpmodel real+Cast`
: Enable the real model to represent the
arithmetic on floatingpoint numbers. The
`Cast`
option enables
the usage of cast in the code.
the _preconditions_ specified in the contract of the function.

`wpfct $FUNCTION`
: launches the WP verification with the following
options:

`wpcache update`
: enables and uses cache.

`wpmodel real+Cast`
: enables the
`real`
model to represent the
arithmetic on floatingpoint numbers. The
`Cast`
option enables the
usage of cast in the code.

`wpprover altergo,cvc4stringsce,z3,z3ce,z3nobv,tip`
:
A
dd the different provers needed to verify the goals.

`cppextraargs=I../include`
:
A
dd the include directory of
a
dd
s
the different provers needed to verify the goals.

`cppextraargs=I../include`
:
a
dd
s
the include directory of
Paparazzi.

`cppextraargs=DFRAMA_C_ANALYSIS`
: Defined a C constant
in order to remove certain portions of code that are not
supported by FramaC.

`cppextraargs=DFRAMA_C_ANALYSIS`
: defines a C constant in order
to remove certain portions of code that are not supported by
FramaC.
Quick link to functions described in FMICS 2021 paper


the
[
`float_rmat\_of_quat`
](
https://gitlab.isaesupaero.fr/b.pollien/paparazziframac//blob/fmics2021/sw/airborne/math/pprz_algebra_float.h#L633
)
function

the
[
`float_quat_of_rmat`
](
https://gitlab.isaesupaero.fr/b.pollien/paparazziframac//blob/fmics2021/sw/airborne/math/pprz_algebra_float.h#L946
)
function

the
[
`float_rmat_of_eulers_321`
](
https://gitlab.isaesupaero.fr/b.pollien/paparazziframac//blob/fmics2021/sw/airborne/math/pprz_algebra_float.h#L612
)
function

the
[
`float_rmat_of_eulers_312`
](
https://gitlab.isaesupaero.fr/b.pollien/paparazziframac//blob/fmics2021/sw/airborne/math/pprz_algebra_float.h#L620
)
function
More information about Paparazzi

To have information about Paparazzi, go directly on the
[
website
](
https://wiki.paparazziuav.org/wiki/Main_Page
)
or on
the
[
GitLab project
](
https://github.com/paparazzi/paparazzi
)
.
\ No newline at end of file
[
website
](
https://wiki.paparazziuav.org/wiki/Main_Page
)
or on the
[
GitLab project
](
https://github.com/paparazzi/paparazzi
)
.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment