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
96cc44f0
Commit
96cc44f0
authored
2 years ago
by
David Bühler
Browse files
Options
Downloads
Patches
Plain Diff
[Eva] Lattice_bounds: shares more functions between Bottom, Top and TopBottom.
parent
56b8fb8c
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/kernel_services/abstract_interp/lattice_bounds.ml
+32
-25
32 additions, 25 deletions
src/kernel_services/abstract_interp/lattice_bounds.ml
with
32 additions
and
25 deletions
src/kernel_services/abstract_interp/lattice_bounds.ml
+
32
−
25
View file @
96cc44f0
...
...
@@ -39,6 +39,9 @@ end
module
Common
=
struct
(* Pretty-printing *)
let
pretty_top
fmt
=
Format
.
pp_print_string
fmt
(
Unicode
.
top_string
()
)
...
...
@@ -50,6 +53,8 @@ struct
|
`Top
->
pretty_top
fmt
|
`Value
v
->
pretty_value
fmt
v
(* Datatype *)
let
hash
hash_value
=
function
|
`Bottom
->
7
|
`Top
->
13
...
...
@@ -70,6 +75,33 @@ struct
|
`Top
,
`Value
_
->
-
1
|
`Value
_
,
`Top
->
1
|
`Value
vx
,
`Value
vy
->
compare_value
vx
vy
(* Tests *)
let
is_bottom
=
function
|
`Bottom
->
true
|
`Value
_
|
`Top
->
false
let
is_top
=
function
|
`Top
->
true
|
`Value
_
|
`Bottom
->
false
let
is_included
is_included
x
y
=
match
x
,
y
with
|
`Bottom
,
_
|
_
,
`Top
->
true
|
_
,
`Bottom
|
`Top
,
_
->
false
|
`Value
vx
,
`Value
vy
->
is_included
vx
vy
(* Iterator *)
let
iter
f
=
function
|
`Bottom
|
`Top
->
()
|
`Value
v
->
f
v
(* Conversion *)
let
to_option
=
function
|
`Bottom
|
`Top
->
None
|
`Value
x
->
Some
x
end
module
Bottom
=
struct
...
...
@@ -79,10 +111,6 @@ module Bottom = struct
(** Access *)
let
is_bottom
=
function
|
`Bottom
->
true
|
`Value
_
->
false
let
non_bottom
=
function
|
`Value
v
->
v
|
`Bottom
->
assert
false
...
...
@@ -93,11 +121,6 @@ module Bottom = struct
(* Lattice operators *)
let
is_included
is_included
x
y
=
match
x
,
y
with
|
`Bottom
,
_
->
true
|
_
,
`Bottom
->
false
|
`Value
vx
,
`Value
vy
->
is_included
vx
vy
let
join
join
x
y
=
match
x
,
y
with
|
`Value
vx
,
`Value
vy
->
`Value
(
join
vx
vy
)
|
`Bottom
,
(
`Value
_
as
v
)
...
...
@@ -114,10 +137,6 @@ module Bottom = struct
(* Iterators *)
let
iter
f
=
function
|
`Bottom
->
()
|
`Value
v
->
f
v
let
fold
~
bottom
f
=
function
|
`Bottom
->
bottom
|
`Value
v
->
f
v
...
...
@@ -135,10 +154,6 @@ module Bottom = struct
(** Conversion *)
let
to_option
=
function
|
`Bottom
->
None
|
`Value
v
->
Some
v
let
of_option
=
function
|
None
->
`Bottom
|
Some
v
->
`Value
v
...
...
@@ -227,10 +242,6 @@ struct
(** Access *)
let
is_top
=
function
|
`Value
_
->
false
|
`Top
->
true
let
non_top
=
function
|
`Value
v
->
v
|
`Top
->
assert
false
...
...
@@ -252,10 +263,6 @@ struct
|
None
->
`Top
|
Some
x
->
`Value
x
let
to_option
=
function
|
`Top
->
None
|
`Value
x
->
Some
x
(** Operators *)
module
Operators
=
struct
...
...
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