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
7518364c
Commit
7518364c
authored
3 years ago
by
Valentin Perrelle
Committed by
David Bühler
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[Eva] multidim: remove obviously empty slices after bound replacement
- many cases where equality/inclusions are verified
parent
20bf3701
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/kernel_services/abstract_interp/abstract_memory.ml
+24
-2
24 additions, 2 deletions
src/kernel_services/abstract_interp/abstract_memory.ml
tests/value/oracle/multidim.res.oracle
+6
-14
6 additions, 14 deletions
tests/value/oracle/multidim.res.oracle
with
30 additions
and
16 deletions
src/kernel_services/abstract_interp/abstract_memory.ml
+
24
−
2
View file @
7518364c
...
@@ -885,8 +885,9 @@ struct
...
@@ -885,8 +885,9 @@ struct
let
hash
(
b
,_
a
)
=
Bound
.
hash
b
let
hash
(
b
,_
a
)
=
Bound
.
hash
b
let
compare
(
b1
,_
a1
)
(
b2
,_
a2
)
=
let
compare
(
b1
,_
a1
)
(
b2
,_
a2
)
=
Bound
.
compare
b1
b2
Bound
.
compare
b1
b2
let
equal
(
b1
,_
a1
)
(
b2
,_
a2
)
=
let
equal
_regardless_age
(
b1
,_
a1
)
(
b2
,_
a2
)
=
Bound
.
equal
b1
b2
Bound
.
equal
b1
b2
let
equal
=
equal_regardless_age
let
_of_integer
i
a
=
Bound
.
of_integer
i
,
a
let
_of_integer
i
a
=
Bound
.
of_integer
i
,
a
let
_of_exp
e
a
=
Bound
.
of_exp
e
,
a
let
_of_exp
e
a
=
Bound
.
of_exp
e
,
a
let
_succ
(
b
,
a
)
=
(
Bound
.
succ
b
,
a
)
let
_succ
(
b
,
a
)
=
(
Bound
.
succ
b
,
a
)
...
@@ -954,6 +955,8 @@ struct
...
@@ -954,6 +955,8 @@ struct
padding
:
bit
;
(* padding at the left and right of the segmentation *)
padding
:
bit
;
(* padding at the left and right of the segmentation *)
}
}
type
segments
=
(
M
.
t
*
B
.
t
)
list
let
_pretty_debug
fmt
(
l
,
s
)
:
unit
=
let
_pretty_debug
fmt
(
l
,
s
)
:
unit
=
Format
.
fprintf
fmt
" {%a} "
B
.
pretty
l
;
Format
.
fprintf
fmt
" {%a} "
B
.
pretty
l
;
let
pp
fmt
(
v
,
u
)
=
let
pp
fmt
(
v
,
u
)
=
...
@@ -1311,6 +1314,24 @@ struct
...
@@ -1311,6 +1314,24 @@ struct
aging
>>-:
aging
>>-:
limit_size
~
oracle
limit_size
~
oracle
let
remove_empty_segments
m
=
let
unify_head_age
(
b'
:
B
.
t
)
:
segments
->
segments
=
function
|
[]
->
[]
(* Start of segmentation, age is 0, do nothing *)
|
(
v
,
b
)
::
t
->
(
v
,
B
.
unify_age
~
other
:
b'
b
)
::
t
in
let
rec
aux
l
acc
=
function
|
[]
->
List
.
rev
acc
|
(
v
,
u
)
::
t
->
(* Oracle cannot be used in case of incr here as it represents the
value of the bounds before the instruction, while we iterate
here over a segmentation interpreted after the instruction. *)
if
B
.
equal_regardless_age
l
u
then
(* empty segment, remove v *)
aux
l
(
unify_head_age
u
acc
)
t
else
aux
u
((
v
,
u
)
::
acc
)
t
in
{
m
with
segments
=
check_segments
(
aux
m
.
start
[]
m
.
segments
)
}
let
incr_bound
~
oracle
vi
x
m
=
let
incr_bound
~
oracle
vi
x
m
=
let
incr
=
B
.
incr_or_constantify
~
oracle
vi
x
in
let
incr
=
B
.
incr_or_constantify
~
oracle
vi
x
in
let
rec
aux
acc
=
function
let
rec
aux
acc
=
function
...
@@ -1337,7 +1358,8 @@ struct
...
@@ -1337,7 +1358,8 @@ struct
and
v
=
M
.
smash
~
oracle
(
M
.
of_raw
m
.
padding
)
v
in
and
v
=
M
.
smash
~
oracle
(
M
.
of_raw
m
.
padding
)
v
in
l
,
(
v
,
u
)
::
t
l
,
(
v
,
u
)
::
t
in
in
{
m
with
start
;
segments
=
check_segments
(
List
.
rev
(
aux
[]
segments
))
}
{
m
with
start
;
segments
=
check_segments
(
List
.
rev
(
aux
[]
segments
))
}
|>
remove_empty_segments
let
map
f
m
=
let
map
f
m
=
{
m
with
segments
=
check_segments
(
List
.
map
(
fun
(
v
,
u
)
->
f
v
,
u
)
m
.
segments
)
}
{
m
with
segments
=
check_segments
(
List
.
map
(
fun
(
v
,
u
)
->
f
v
,
u
)
m
.
segments
)
}
...
...
This diff is collapsed.
Click to expand it.
tests/value/oracle/multidim.res.oracle
+
6
−
14
View file @
7518364c
...
@@ -92,7 +92,7 @@
...
@@ -92,7 +92,7 @@
[eva] multidim.c:59:
[eva] multidim.c:59:
Frama_C_domain_show_each:
Frama_C_domain_show_each:
t : # cvalue: {0; 1}
t : # cvalue: {0; 1}
# multidim:
{
[0 .. 9] = {1}
, [10 .. 9] = {0} }
# multidim: [0 .. 9] = {1}
[eva] Recording results for main2
[eva] Recording results for main2
[eva] Done for function main2
[eva] Done for function main2
[eva] computing for function main3 <- main.
[eva] computing for function main3 <- main.
...
@@ -154,12 +154,7 @@
...
@@ -154,12 +154,7 @@
Frama_C_domain_show_each:
Frama_C_domain_show_each:
t : # cvalue: [0..9] ∈ {0; 1}
t : # cvalue: [0..9] ∈ {0; 1}
[10..19] ∈ {0; 2}
[10..19] ∈ {0; 2}
# multidim: {
# multidim: { [0 .. 17] = {1; 2}, [18] = {1; 2}, [19] = {2} }
[0 .. 17] = {1; 2},
[18] = {1; 2},
[19] = {2},
[20 .. 19] = {0}
}
[eva] Recording results for main5
[eva] Recording results for main5
[eva] Done for function main5
[eva] Done for function main5
[eva] computing for function main6 <- main.
[eva] computing for function main6 <- main.
...
@@ -195,12 +190,9 @@
...
@@ -195,12 +190,9 @@
Frama_C_domain_show_each:
Frama_C_domain_show_each:
t : # cvalue: [0].typ ∈ {1; 2} or UNINITIALIZED
t : # cvalue: [0].typ ∈ {1; 2} or UNINITIALIZED
{[0].val; [1..999]} ∈ [--..--] or UNINITIALIZED
{[0].val; [1..999]} ∈ [--..--] or UNINITIALIZED
# multidim: {
# multidim: [0 .. 999] = {
[0 .. 999] = {
{ .typ = {1}, .val.i = {42} } or
{ .typ = {1}, .val.i = {42} } or
{ .typ = {2}, .val.f = {42.} }
{ .typ = {2}, .val.f = {42.} }
},
[1000 .. 999] = UNINITIALIZED
}
}
[eva] computing for function Frama_C_interval <- main7 <- main.
[eva] computing for function Frama_C_interval <- main7 <- main.
Called from multidim.c:147.
Called from multidim.c:147.
...
@@ -219,7 +211,7 @@
...
@@ -219,7 +211,7 @@
[eva] multidim.c:169:
[eva] multidim.c:169:
Frama_C_domain_show_each:
Frama_C_domain_show_each:
t : # cvalue: {0; 1}
t : # cvalue: {0; 1}
# multidim:
{
[0 .. 9] = {1}
, [10 .. 9] = {0} }
# multidim: [0 .. 9] = {1}
[eva] Recording results for main8
[eva] Recording results for main8
[eva] Done for function main8
[eva] Done for function main8
[eva] computing for function main9 <- main.
[eva] computing for function main9 <- main.
...
...
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