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
f7daa4f9
Commit
f7daa4f9
authored
3 years ago
by
Allan Blanchard
Browse files
Options
Downloads
Patches
Plain Diff
[wp/doc] Document Mod-Mask
parent
c9dd34d7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/wp/Changelog
+1
-0
1 addition, 0 deletions
src/plugins/wp/Changelog
src/plugins/wp/doc/manual/wp_plugin.tex
+20
-1
20 additions, 1 deletion
src/plugins/wp/doc/manual/wp_plugin.tex
with
21 additions
and
1 deletion
src/plugins/wp/Changelog
+
1
−
0
View file @
f7daa4f9
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
Plugin WP <next-release>
Plugin WP <next-release>
########################
########################
- TIP [2022-01-10] New tactic Mod-Mask: rewrite bitmask into/from modulo
- TIP [2022-01-05] New tactic Clear: remove hypothesis
- TIP [2022-01-05] New tactic Clear: remove hypothesis
-* WP [2022-01-05] Fix loop invariant order
-* WP [2022-01-05] Fix loop invariant order
- WP [2022-01-05] Weaken check loop invariant
- WP [2022-01-05] Weaken check loop invariant
...
...
This diff is collapsed.
Click to expand it.
src/plugins/wp/doc/manual/wp_plugin.tex
+
20
−
1
View file @
f7daa4f9
...
@@ -497,10 +497,29 @@ $G(n) \equiv P(n)\Longrightarrow\,Q(n)$:
...
@@ -497,10 +497,29 @@ $G(n) \equiv P(n)\Longrightarrow\,Q(n)$:
\Delta
,
\;
\forall
i,
\,
n < i
\leq
b
\Longrightarrow
G
(
i
)
\;
&
\models
G
(
n
)
\Delta
,
\;
\forall
i,
\,
n < i
\leq
b
\Longrightarrow
G
(
i
)
\;
&
\models
G
(
n
)
\end
{
array
}}
\]
\end
{
array
}}
\]
\paragraph
{
Mod-Mask
}
Rewrite bitmask into/from modulo
\\
This tactic is used to rewrite a bitmask into a modulo (or a modulo into a
bitmask) when possible. The user selects an expression
$
e
$
of the form
$
b
\%
m
$
(resp.
$
b
\&
m
$
-
$
\texttt
{
land b m
}$
) than can be rewritten into
$
b
\&
(
m
+
1
)
$
(resp.
$
b
\%
(
m
-
1
)
$
), if
$
0
\leq
b
$
and
$
m
$
is a positive power
of 2 (resp.
$
m
+
1
$
is a positive power of 2). When selecting an expression
$
x
\&
y
$
, both directions
$
x
\%
(
y
-
1
)
$
and
$
y
\%
(
x
-
1
)
$
can be considered.
Since establishing that
$
m
$
is a positive power of 2 can be hard, the tactic has
several behaviors. If
\textsf
{
Qed
}
can prove immediately that an operand
$
m
$
(or
$
m
+
1
$
for bitmaks) is a positive power of 2, the tactic only generates the guard
$
0
\leq
b
$
and the rewritten goal. If it is not the case, the tactic appears
with the name ``Mod-Mask (hard)'' in the GUI. In this situation, the guard
consists of two conditions:
$
0
\leq
b
$
and
$
m
$
(or
$
m
+
1
$
) is a positive power of
2. This guard involves an existential quantification, so it can be hard to
prove. When the selected term is a bitmask, the tactic cannot decide itself the
direction of the modulo, thus a checkbox is added in the configuration of the
tactic to select the direction of rewriting.
\paragraph
{
Overflow
}
Integer Conversions
\\
\paragraph
{
Overflow
}
Integer Conversions
\\
This tactic split machine integer conversions into three cases: value in integer
This tactic split machine integer conversions into three cases: value in integer
range, lower than range and upper than range. The tactic applies on expression
range, lower than range and upper than range. The tactic applies on expression
with pattern
$
\mathtt
{
to
\_
iota
(
e
)
}$
where
\texttt
{
iota
}
is a
a
machine-integer
with pattern
$
\mathtt
{
to
\_
iota
(
e
)
}$
where
\texttt
{
iota
}
is a machine-integer
name,
\emph
{
eg.
}
\texttt
{
to
\_
uint32
}
.
name,
\emph
{
eg.
}
\texttt
{
to
\_
uint32
}
.
\[
\TACTIC
{
\Delta\models
G
}{
%
\[
\TACTIC
{
\Delta\models
G
}{
%
...
...
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