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
fe127485
Commit
fe127485
authored
5 years ago
by
Andre Maroneze
Browse files
Options
Downloads
Patches
Plain Diff
[Doc/Eva] update FAQ about loop unrolling
parent
a68668e8
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
+25
-23
25 additions, 23 deletions
doc/value/main.tex
with
25 additions
and
23 deletions
doc/value/main.tex
+
25
−
23
View file @
fe127485
...
@@ -5247,33 +5247,35 @@ return \lstinline|6| and \lstinline|36| respectively.
...
@@ -5247,33 +5247,35 @@ return \lstinline|6| and \lstinline|36| respectively.
\newcommand
{
\question
}
[1]
{
\stepcounter
{
question
}{
\vspace
{
5mm
}
\noindent
\bf
{
\large
Q.
\arabic
{
question
}}
~~~
{
#1
}
\medskip
}}
\newcommand
{
\question
}
[1]
{
\stepcounter
{
question
}{
\vspace
{
5mm
}
\noindent
\bf
{
\large
Q.
\arabic
{
question
}}
~~~
{
#1
}
\medskip
}}
\question
{
Which option should I use to improve the handling of loops
\question
{
Which option should I use to improve the handling of loops
in my program,
{
\tt
-ulevel
}
or
{
\tt
-eva-slevel
}
?
}
in my program?
}
The options
\lstinline
|-ulevel| and
\lstinline
|-eva-slevel| have different sets of
The recommended way is to use
\lstinline
|loop unroll| annotations, which are
advantages and drawbacks. The main drawback of
\lstinline
|-ulevel| is that
the most precise and stable mechanism currently in
\Eva
{}
.
it performs a syntactic modification of the analyzed source code,
Alternatively, using
\lstinline
|-eva-slevel| is the next best approach.
which may hamper its manipulation. On the other hand, syntactic
unrolling, by explicitly separating iteration steps, allows to use
Both approaches do have a minor drawback, in that they do not allow to observe
the graphical user interface
a specific iteration step of the loop.
\lstinline
|frama-c-gui| to observe values or express properties for a
In fact, they may even be a little
specific iteration step of the loop.
The
\lstinline
|-eva-slevel| option does not allow to observe a specific
iteration step of the loop. In fact, this option may even be a little
confusing for the user when the program contains loops for which the
confusing for the user when the program contains loops for which the
analysis cannot decide easily the truth value of the condition,
analysis cannot decide easily the truth value of the condition,
nested loops, or if-then-else
nested loops, or if-then-else
statements
\footnote
{
if-then-else statements are ``unrolled''
statements
\footnote
{
if-then-else statements are ``unrolled''
in a manner similar to loops
}
. The main advantages of this option are
in a manner similar to loops
}
. The main advantage of these options are
that it leaves the source code unchanged and that it works with
that they leave the source code unchanged. Also,
\lstinline
|-eva-slevel| works
loops that are built using
\lstinline
|goto|s instead of
\lstinline
|for| or
\lstinline
|while|.
with loops that are built using
\lstinline
|goto|s instead of
\lstinline
|for|
% The \lstinline|-eva-slevel| option requires less memory than
or
\lstinline
|while|.
% \lstinline|-ulevel|, and as a consequence it can sometimes be faster.
\lstinline
|-eva-slevel| also improves precision when evaluating
\lstinline
|if|
It also improves precision when evaluating
\lstinline
|if| or
or
\lstinline
|switch| conditionals (but it is consumed by them).
\lstinline
|switch| conditionals.
A current drawback of semantic unrolling is that it can only be specified
The Frama-C kernel has an option
\lstinline
|-ulevel|, which performs a
crudely at the function level, whereas syntactic unrolling can be
syntactic modification of the analyzed source code. Its advantage is that,
specified loop by loop.
by explicitly separating iteration steps, it allows to use
the graphical user interface to observe values or express properties for a
specific iteration step of the loop. However, the duplication of loop
statements and variables can lead to cluttered code. Also, the transformation
increases the size of the code in the Frama-C AST and, for large functions,
this has a significant impact in the analysis
time. For these reasons,
\lstinline
|-ulevel| is seldom used nowadays.
\question
{
Alarms that occur after a true alarm in the analyzed code
\question
{
Alarms that occur after a true alarm in the analyzed code
...
...
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