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
5a4e4fd1
Commit
5a4e4fd1
authored
2 years ago
by
David Bühler
Browse files
Options
Downloads
Patches
Plain Diff
[Eva] Improves the use of memexec in the octagon domain.
parent
7ed2664e
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
src/plugins/eva/domains/octagons.ml
+38
-12
38 additions, 12 deletions
src/plugins/eva/domains/octagons.ml
with
38 additions
and
12 deletions
src/plugins/eva/domains/octagons.ml
+
38
−
12
View file @
5a4e4fd1
...
@@ -1015,7 +1015,7 @@ module State = struct
...
@@ -1015,7 +1015,7 @@ module State = struct
with
Not_found
->
`Value
state
with
Not_found
->
`Value
state
let
add_octagon
state
octagon
=
let
add_octagon
state
octagon
=
if
is_redundant
state
.
intervals
octagon
if
Ival
.(
equal
top
octagon
.
value
)
||
is_redundant
state
.
intervals
octagon
then
`Value
state
then
`Value
state
else
else
let
state
=
let
state
=
...
@@ -1036,6 +1036,11 @@ module State = struct
...
@@ -1036,6 +1036,11 @@ module State = struct
let
relations
=
Relations
.
relate
octagon
.
variables
state
.
relations
in
let
relations
=
Relations
.
relate
octagon
.
variables
state
.
relations
in
{
state
with
octagons
;
relations
}
{
state
with
octagons
;
relations
}
let
add_diamond
state
variables
diamond
=
add_octagon
state
{
variables
;
operation
=
Add
;
value
=
diamond
.
add
}
>>-
fun
state
->
add_octagon
state
{
variables
;
operation
=
Sub
;
value
=
diamond
.
sub
}
let
remove
state
x
=
let
remove
state
x
=
let
intervals
=
Intervals
.
remove
x
state
.
intervals
in
let
intervals
=
Intervals
.
remove
x
state
.
intervals
in
let
state
=
{
state
with
intervals
}
in
let
state
=
{
state
with
intervals
}
in
...
@@ -1381,7 +1386,7 @@ module Domain = struct
...
@@ -1381,7 +1386,7 @@ module Domain = struct
let
relations
=
Relations
.
filter
mem_var
state
.
relations
in
let
relations
=
Relations
.
filter
mem_var
state
.
relations
in
{
state
with
octagons
;
intervals
;
relations
;
}
{
state
with
octagons
;
intervals
;
relations
;
}
let
reuse
=
let
interprocedural_
reuse
=
let
cache
=
Hptmap_sig
.
PersistentCache
"Octagons.reuse"
let
cache
=
Hptmap_sig
.
PersistentCache
"Octagons.reuse"
and
symmetric
=
false
and
symmetric
=
false
and
idempotent
=
true
and
idempotent
=
true
...
@@ -1389,17 +1394,38 @@ module Domain = struct
...
@@ -1389,17 +1394,38 @@ module Domain = struct
let
join_oct
=
Octagons
.
internal_join
~
cache
~
symmetric
~
idempotent
~
decide
let
join_oct
=
Octagons
.
internal_join
~
cache
~
symmetric
~
idempotent
~
decide
and
join_itv
=
Intervals
.
internal_join
~
cache
~
symmetric
~
idempotent
~
decide
and
join_itv
=
Intervals
.
internal_join
~
cache
~
symmetric
~
idempotent
~
decide
and
join_rel
=
Relations
.
union
in
and
join_rel
=
Relations
.
union
in
fun
_kf
_bases
~
current_input
~
previous_output
->
fun
~
current_input
~
previous_output
->
if
intraprocedural
()
let
current_input
=
kill
previous_output
.
modified
current_input
in
then
previous_output
(* We use [add_diamond] to add each relation from the previous output
into the current input, in order to benefit from the (partial)
saturation of octagons performed by this function. For a maximum
precision, a complete saturation would be required.
Otherwise, we use instead a more efficient (but less precise) merge
of the maps from the previous output and the current input. *)
if
saturate_octagons
then
let
intervals
=
join_itv
previous_output
.
intervals
current_input
.
intervals
in
let
state
=
{
current_input
with
intervals
}
in
let
add_diamond
variables
diamond
acc
=
Bottom
.
non_bottom
(
add_diamond
acc
variables
diamond
)
in
Octagons
.
fold
add_diamond
previous_output
.
octagons
state
else
else
let
current_input
=
kill
previous_output
.
modified
current_input
in
{
octagons
=
join_oct
previous_output
.
octagons
current_input
.
octagons
;
let
prev_output
=
previous_output
in
intervals
=
join_itv
previous_output
.
intervals
current_input
.
intervals
;
check
"reuse result"
relations
=
join_rel
previous_output
.
relations
current_input
.
relations
;
{
octagons
=
join_oct
prev_output
.
octagons
current_input
.
octagons
;
modified
=
current_input
.
modified
}
intervals
=
join_itv
prev_output
.
intervals
current_input
.
intervals
;
relations
=
join_rel
prev_output
.
relations
current_input
.
relations
;
let
reuse
_kf
_bases
~
current_input
~
previous_output
=
modified
=
current_input
.
modified
}
if
intraprocedural
()
then
previous_output
else
let
t
=
interprocedural_reuse
~
current_input
~
previous_output
in
check
"reuse result"
t
end
end
...
...
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