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
a90614e2
Commit
a90614e2
authored
4 years ago
by
Allan Blanchard
Browse files
Options
Downloads
Patches
Plain Diff
[wp] Reachability: less memoization
parent
699c1f84
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/wp/cfgInfos.ml
+20
-8
20 additions, 8 deletions
src/plugins/wp/cfgInfos.ml
with
20 additions
and
8 deletions
src/plugins/wp/cfgInfos.ml
+
20
−
8
View file @
a90614e2
...
...
@@ -34,7 +34,7 @@ type t = {
mutable
annots
:
bool
;
(* has goals to prove *)
mutable
doomed
:
WpPropId
.
prop_id
Bag
.
t
;
mutable
calls
:
Kernel_function
.
Set
.
t
;
unreachable
:
bool
Vhash
.
t
;
unreachable
:
bool
option
Vhash
.
t
;
}
(* -------------------------------------------------------------------------- *)
...
...
@@ -50,19 +50,31 @@ let doomed infos = infos.doomed
(* --- Reachability Analyses --- *)
(* -------------------------------------------------------------------------- *)
let
fixpoint
h
d
f
=
let
fixpoint
h
f
=
let
rec
phi
v
=
try
Vhash
.
find
h
v
with
Not_found
->
Vhash
.
add
h
v
d
;
Vhash
.
add
h
v
None
;
let
r
=
f
phi
v
in
Vhash
.
replace
h
v
r
;
r
if
Option
.
is_none
r
then
Vhash
.
remove
h
v
else
Vhash
.
replace
h
v
r
;
r
in
phi
let
unreachable
infos
=
let
unreachable
infos
v
=
let
pred
=
Cfg
.
G
.
pred
(
Option
.
get
infos
.
cfg
)
.
graph
in
fixpoint
infos
.
unreachable
true
begin
fun
phi
v
->
List
.
for_all
phi
(
pred
v
)
end
let
do_fixpoint
=
fixpoint
infos
.
unreachable
begin
fun
phi
v
->
match
List
.
map
phi
(
pred
v
)
with
|
l
when
List
.
exists
(
fun
x
->
x
=
Some
false
)
l
->
Some
false
|
l
when
List
.
for_all
(
fun
x
->
x
=
Some
true
)
l
->
Some
true
|
_
->
None
end
in
match
do_fixpoint
v
with
|
Some
x
->
x
|
None
->
Vhash
.
add
infos
.
unreachable
v
(
Some
false
)
;
false
(* -------------------------------------------------------------------------- *)
(* --- Selected Properties --- *)
...
...
@@ -216,7 +228,7 @@ let compile Key.{ kf ; bhv ; prop } =
let
cfg
=
Option
.
get
cfg
in
(* Root Reachability *)
let
v0
=
cfg
.
entry_point
in
Vhash
.
add
infos
.
unreachable
v0
false
;
Vhash
.
add
infos
.
unreachable
v0
(
Some
false
)
;
(* Spec Iteration *)
if
selected_disjoint_complete
kf
~
bhv
~
prop
||
(
List
.
exists
(
selected_bhv
~
bhv
~
prop
)
behaviors
)
...
...
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