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
bc9e7b45
Commit
bc9e7b45
authored
2 years ago
by
Valentin Perrelle
Committed by
David Bühler
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
[Kernel] Add iterators uniformly to all Lattice_bounds submodules
parent
02aa10e3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/kernel_services/abstract_interp/lattice_bounds.ml
+51
-34
51 additions, 34 deletions
src/kernel_services/abstract_interp/lattice_bounds.ml
src/kernel_services/abstract_interp/lattice_bounds.mli
+14
-1
14 additions, 1 deletion
src/kernel_services/abstract_interp/lattice_bounds.mli
with
65 additions
and
35 deletions
src/kernel_services/abstract_interp/lattice_bounds.ml
+
51
−
34
View file @
bc9e7b45
...
...
@@ -126,6 +126,10 @@ module Bottom = struct
(* Iterators *)
let
bind
f
=
function
|
`Bottom
->
`Bottom
|
`Value
v
->
f
v
let
fold
~
bottom
f
=
function
|
`Bottom
->
bottom
|
`Value
v
->
f
v
...
...
@@ -170,17 +174,11 @@ module Bottom = struct
module
Operators
=
struct
let
(
>>-
)
t
f
=
match
t
with
|
`Bottom
->
`Bottom
|
`Value
t
->
f
t
let
(
>>-:
)
t
f
=
match
t
with
|
`Bottom
->
`Bottom
|
`Value
t
->
`Value
(
f
t
)
let
(
let
+
)
=
(
>>-:
)
let
(
>>-
)
x
f
=
bind
f
x
let
(
>>-:
)
x
f
=
map
f
x
let
(
let
+
)
x
f
=
map
f
x
let
(
and
+
)
=
zip
let
(
let
*
)
=
(
>>-
)
let
(
let
*
)
x
f
=
bind
f
x
let
(
and
*
)
=
zip
end
...
...
@@ -249,6 +247,20 @@ struct
|
`Top
,
v
|
v
,
`Top
->
v
|
`Value
vx
,
`Value
vy
->
`Value
(
narrow_value
vx
vy
)
(* Iterators *)
let
bind
f
=
function
|
`Top
->
`Top
|
`Value
v
->
f
v
let
fold
~
top
f
=
function
|
`Top
->
top
|
`Value
v
->
f
v
let
map
f
=
function
|
`Top
->
`Top
|
`Value
v
->
`Value
(
f
v
)
(** Combination *)
let
zip
x
y
=
...
...
@@ -264,18 +276,13 @@ struct
(** Operators *)
module
Operators
=
struct
let
(
>>-
)
t
f
=
match
t
with
|
`Top
->
`Top
|
`Value
t
->
f
t
let
(
>>-:
)
t
f
=
match
t
with
|
`Top
->
`Top
|
`Value
t
->
`Value
(
f
t
)
let
(
let
+
)
=
(
>>-:
)
module
Operators
=
struct
let
(
>>-
)
x
f
=
bind
f
x
let
(
>>-:
)
x
f
=
map
f
x
let
(
let
+
)
x
f
=
map
f
x
let
(
and
+
)
=
zip
let
(
let
*
)
=
(
>>-
)
let
(
let
*
)
x
f
=
bind
f
x
let
(
and
*
)
=
zip
end
end
...
...
@@ -299,6 +306,23 @@ struct
|
`Bottom
,
_
|
_
,
`Bottom
->
`Bottom
|
`Value
vx
,
`Value
vy
->
(
narrow_value
vx
vy
:>
'
a
t
)
(* Iterators *)
let
bind
f
=
function
|
`Top
->
`Top
|
`Bottom
->
`Bottom
|
`Value
v
->
f
v
let
fold
~
top
~
bottom
f
=
function
|
`Top
->
top
|
`Bottom
->
bottom
|
`Value
v
->
f
v
let
map
f
=
function
|
`Top
->
`Top
|
`Bottom
->
`Bottom
|
`Value
v
->
`Value
(
f
v
)
(** Combination *)
let
zip
x
y
=
...
...
@@ -309,20 +333,13 @@ struct
(** Operators *)
module
Operators
=
struct
let
(
>>-
)
t
f
=
match
t
with
|
`Top
->
`Top
|
`Bottom
->
`Bottom
|
`Value
t
->
f
t
let
(
>>-:
)
t
f
=
match
t
with
|
`Top
->
`Top
|
`Bottom
->
`Bottom
|
`Value
t
->
`Value
(
f
t
)
let
(
let
+
)
=
(
>>-:
)
module
Operators
=
struct
let
(
>>-
)
x
f
=
bind
f
x
let
(
>>-:
)
x
f
=
map
f
x
let
(
let
+
)
x
f
=
map
f
x
let
(
and
+
)
=
zip
let
(
let
*
)
=
(
>>-
)
let
(
let
*
)
x
f
=
bind
f
x
let
(
and
*
)
=
zip
end
end
This diff is collapsed.
Click to expand it.
src/kernel_services/abstract_interp/lattice_bounds.mli
+
14
−
1
View file @
bc9e7b45
...
...
@@ -82,7 +82,8 @@ module Bottom : sig
(* Iterators *)
val
iter
:
(
'
a
->
unit
)
->
'
a
t
->
unit
val
fold
:
bottom
:
'
b
->
(
'
a
->
'
b
)
->
'
a
t
->
'
b
val
bind
:
(
'
a
->
'
b
t
)
->
'
a
t
->
'
b
t
val
fold
:
bottom
:
'
b
->
(
'
a
->
'
b
)
->
'
a
t
->
'
b
val
map
:
(
'
a
->
'
b
)
->
'
a
t
->
'
b
t
(* Combination *)
...
...
@@ -144,6 +145,12 @@ module Top : sig
val
join
:
(
'
a
->
'
a
->
'
a
t
)
->
'
a
t
->
'
a
t
->
'
a
t
val
narrow
:
(
'
a
->
'
a
->
'
a
)
->
'
a
t
->
'
a
t
->
'
a
t
(* Iterators *)
val
iter
:
(
'
a
->
unit
)
->
'
a
t
->
unit
val
bind
:
(
'
a
->
'
b
t
)
->
'
a
t
->
'
b
t
val
fold
:
top
:
'
b
->
(
'
a
->
'
b
)
->
'
a
t
->
'
b
val
map
:
(
'
a
->
'
b
)
->
'
a
t
->
'
b
t
(** Combination *)
val
zip
:
'
a
t
->
'
b
t
->
(
'
a
*
'
b
)
t
(* `Top if any is `Top *)
...
...
@@ -188,4 +195,10 @@ module TopBottom: sig
(* Lattice operators *)
val
join
:
(
'
a
->
'
a
->
[
<
'
a
t
])
->
'
a
t
->
'
a
t
->
'
a
t
val
narrow
:
(
'
a
->
'
a
->
[
<
'
a
t
])
->
'
a
t
->
'
a
t
->
'
a
t
(* Iterators *)
val
iter
:
(
'
a
->
unit
)
->
'
a
t
->
unit
val
bind
:
(
'
a
->
'
b
t
)
->
'
a
t
->
'
b
t
val
fold
:
top
:
'
b
->
bottom
:
'
b
->
(
'
a
->
'
b
)
->
'
a
t
->
'
b
val
map
:
(
'
a
->
'
b
)
->
'
a
t
->
'
b
t
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