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
b8174c83
Commit
b8174c83
authored
6 years ago
by
David Bühler
Browse files
Options
Downloads
Patches
Plain Diff
[Eva] Comments and simplifies the interface of partitioning_index.
parent
c27c5a10
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/plugins/value/engine/partitioning_index.ml
+0
-32
0 additions, 32 deletions
src/plugins/value/engine/partitioning_index.ml
src/plugins/value/engine/partitioning_index.mli
+15
-12
15 additions, 12 deletions
src/plugins/value/engine/partitioning_index.mli
with
15 additions
and
44 deletions
src/plugins/value/engine/partitioning_index.ml
+
0
−
32
View file @
b8174c83
...
...
@@ -20,34 +20,18 @@
(* *)
(**************************************************************************)
open
Eval
module
type
Domain
=
sig
include
Abstract_domain
.
Lattice
include
Datatype
.
S_with_collections
with
type
t
=
state
include
Abstract_domain
.
Interface
with
type
t
:=
state
end
module
type
S
=
sig
type
state
type
t
val
empty
:
unit
->
t
val
add
:
state
->
t
->
bool
val
merge_set_return_new
:
state
list
->
t
->
state
list
val
join
:
t
->
state
or_bottom
val
to_list
:
t
->
state
list
val
pretty
:
Format
.
formatter
->
t
->
unit
end
(** Partition of the abstract states, computed for each node by the
dataflow analysis. *)
module
Make
(
Domain
:
Domain
)
=
struct
type
state
=
Domain
.
t
module
Index
=
Hashtbl
.
Make
(
Cvalue_domain
.
Subpart
)
type
t
=
{
...
...
@@ -59,10 +43,6 @@ module Make
let
sentinel
=
Index
.
create
1
let
empty
()
=
{
states
=
sentinel
;
prefix
=
None
;
others
=
[]
}
let
fold
f
{
states
;
others
}
acc
=
let
acc
=
Index
.
fold
(
fun
_k
s
acc
->
f
s
acc
)
states
acc
in
List
.
fold_left
(
fun
acc
s
->
f
s
acc
)
acc
others
(* Optimizations relying on specific features of the cvalue domain. *)
let
distinct_subpart
=
match
Domain
.
get
Cvalue_domain
.
key
with
...
...
@@ -113,18 +93,6 @@ module Make
then
false
else
(
Index
.
add
states
prefix
state
;
true
)
let
merge_set_return_new
states
partition
=
let
f
acc
state
=
let
added
=
add
state
partition
in
if
added
then
state
::
acc
else
acc
in
List
.
fold_left
f
[]
states
let
join
partition
=
fold
(
fun
v
acc
->
Bottom
.
join
Domain
.
join
(
`Value
v
)
acc
)
partition
`Bottom
let
to_list
p
=
Index
.
fold
(
fun
_k
v
a
->
v
::
a
)
p
.
states
p
.
others
let
iter
f
{
states
;
others
}
=
Index
.
iter
(
fun
_k
v
->
f
v
)
states
;
List
.
iter
f
others
...
...
This diff is collapsed.
Click to expand it.
src/plugins/value/engine/partitioning_index.mli
+
15
−
12
View file @
b8174c83
...
...
@@ -20,7 +20,15 @@
(* *)
(**************************************************************************)
open
Eval
(** A partitioning index is a collection of states optimized to determine
if a new state is included in one of the states it contains — in a more
efficient way than to test the inclusion with all stored states.
Such an index is used to keep track of all the states already propagated
through a control point, and to rule out new incoming states included in
previous ones.
Partitioning index relies on an heuristics on the cvalue domain,
and is very inefficient without it. *)
module
type
Domain
=
sig
include
Abstract_domain
.
Lattice
...
...
@@ -28,25 +36,20 @@ module type Domain = sig
include
Abstract_domain
.
Interface
with
type
t
:=
state
end
module
type
S
=
sig
type
state
module
Make
(
Domain
:
Domain
)
:
sig
type
t
(** Creates an empty index. *)
val
empty
:
unit
->
t
val
add
:
state
->
t
->
bool
val
merge_set_return_new
:
state
list
->
t
->
state
list
val
join
:
t
->
state
or_bottom
val
to_list
:
t
->
state
list
(** Adds a state into an index. Returns true if the state did not belong to
the index (and has indeed been added), and false if the index already
contained the state. *)
val
add
:
Domain
.
t
->
t
->
bool
val
pretty
:
Format
.
formatter
->
t
->
unit
end
module
Make
(
Domain
:
Domain
)
:
S
with
type
state
=
Domain
.
t
(*
Local Variables:
...
...
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