Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
30742124
Commit
30742124
authored
5 years ago
by
David Bühler
Browse files
Options
Downloads
Patches
Plain Diff
[Eva] User manual: minor changes in the automatic partitioning section.
parent
70ee900c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/value/main.tex
+33
-31
33 additions, 31 deletions
doc/value/main.tex
with
33 additions
and
31 deletions
doc/value/main.tex
+
33
−
31
View file @
30742124
...
@@ -3712,53 +3712,55 @@ line~7, by an invariant, that remains to be proven.
...
@@ -3712,53 +3712,55 @@ line~7, by an invariant, that remains to be proven.
%% less precisely.
%% less precisely.
\section
{
Improving precision with reasoning
by case
}
\section
{
Improving precision with
case-based
reasoning
}
\label
{
trace-partitioning
}
\label
{
trace-partitioning
}
Some formal proofs about programs require to use
\emph
{
reasoning by cases
}
.
\Eva
can
Some formal proofs about programs require to use
\emph
{
case-based reasoning
}
.
perform such reasonings through
the use of the
\emph
{
T
race
P
artitioning
}
\Eva
{}
can
perform such reasonings through
\emph
{
t
race
p
artitioning
}
\cite
{
trace-partitioning
}
techniques
. These
can be enabled
manu
ally or
\cite
{
trace-partitioning
}
techniques
, which
can be enabled
glob
ally or
automatically
. It is important to note that, whatever the method used,
the
by specific annotations
. It is important to note that, whatever the method used,
partitioning and thus the
reasoning by case
stops at the end of
a function
a
partitioning
(
and thus the
case-based reasoning) currently
stops at the end of
and can only be extended past the function return if there is enough
a function,
and can only be extended past the function return if there is enough
\lstinline
|slevel| in the calling function.
\lstinline
|slevel| in the calling function.
\subsection
{
Automatic partitioning on conditional structures
}
\subsection
{
Automatic partitioning on conditional structures
}
It sometimes happens that the cases we want to reason on are exactly the
It sometimes happens that the cases we want to reason on are exactly the
cases distinguished in the program
in
an
\lstinline
|if-then-else| or a
cases distinguished in the program
by
an
\lstinline
|if-then-else|
statement
or a
\lstinline
|switch| not far above
.
even if these blocks are already closed
\lstinline
|switch| not far above
,
even if these blocks are already closed
at the point we need the reasoning
by cases
. Unless enough
at the point we need the
case-based
reasoning. Unless enough
\lstinline
|slevel| is available, the cases of a conditional structure
s
are
\lstinline
|slevel| is available, the cases of a conditional structure are
approximated together as soon as the analyzer leaves the block.
\Eva
can delay
approximated together as soon as the analyzer leaves the block.
However,
\Eva
{}
this approximation until after the statement where the
reasoning
can delay
this approximation until after the statement where the
case-based
by cases
is needed.
reasoning
is needed.
The global command-line parameter
\lstinline
|-eva-partition-history <n>|
The global command-line parameter
\lstinline
|-eva-partition-history <n>|
will delay the approximation for all conditional structures of the whole
delays the approximation for all conditional structures of the whole
program. It takes a parameter
\lstinline
|<n>| which allow to control the delay.
program. The parameter
\lstinline
|<n>| controls the delay:
It represents the number of junction points for which we keep the incoming
it represents the number of junction points for which the incoming
path (the cases) separated. A value of
$
1
$
means that
\Eva
will reason by
paths (the cases) are kept separated. At a given point,
\Eva
{}
is then able to
case on the previous
\lstinline
|if-then-else| until another
reason by cases on the
\lstinline
|<n>| last
\lstinline
|if-then-else| statements
\lstinline
|if-then-else| is closed.
closed before.
A value of
$
1
$
means that
\Eva
{}
will reason by
This option has a very high cost on the analysis, theoretically increasing the
case on the previous
\lstinline
|if-then-else|, until another one is closed.
analysis time by 2 for
$
n
=
1
$
, and doubling each time
$
n
$
is increased by
$
1
$
.
The cost can even be higher if there are
\lstinline
|switch| instructions in the
This option has a very high cost on the analysis, theoretically doubling the
program. However, it can remove false alarms in a fully automatic way. Thus,
analysis time for each increment of its parameter
$
n
$
.
The cost can even be higher on
\lstinline
|switch| statements.
However, it can remove false alarms in a fully automatic way. Thus,
the trade off might often be worth trying.
the trade off might often be worth trying.
Choosing a value for
\lstinline
|<n>| strictly greater than 1 is often not
In practice,
\lstinline
|-eva-partition-history 1| seems to be sufficient in
needed.
most cases, and a greater value is rarely
needed.
\subsection
{
Manual partitioning on values
}
\subsection
{
Manual partitioning on values
}
The reasoning by case can be forced inside a function by using
\lstinline
|split|
A case-based reasoning on the possible values of an expression can be forced
annotations. These annotations must be given an expression which value
s
inside a function by using
\lstinline
|split| annotations. These annotation
s
correspond to the cases being enumerated. The example below show a usag
e
must be given an expression which values correspond to the cases that need to b
e
of this annotation.
enumerated. The example below shows an usage
of this annotation.
\lstinputlisting
{
examples/parametrizing/split-array.c
}
\lstinputlisting
{
examples/parametrizing/split-array.c
}
...
...
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