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
d405e0dd
Commit
d405e0dd
authored
4 years ago
by
Allan Blanchard
Browse files
Options
Downloads
Patches
Plain Diff
[wp] Use KFmap in cfgGenerator to minimize diffs
parent
3e671795
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/plugins/wp/cfgGenerator.ml
+10
-8
10 additions, 8 deletions
src/plugins/wp/cfgGenerator.ml
with
10 additions
and
8 deletions
src/plugins/wp/cfgGenerator.ml
+
10
−
8
View file @
d405e0dd
...
@@ -27,15 +27,17 @@ open Wp_parameters
...
@@ -27,15 +27,17 @@ open Wp_parameters
(* --- Task Manager --- *)
(* --- Task Manager --- *)
(* -------------------------------------------------------------------------- *)
(* -------------------------------------------------------------------------- *)
module
KFmap
=
Kernel_function
.
Map
type
task
=
{
type
task
=
{
mutable
lemmas
:
LogicUsage
.
logic_lemma
list
;
mutable
lemmas
:
LogicUsage
.
logic_lemma
list
;
mutable
modes
:
CfgCalculus
.
mode
lis
t
;
mutable
modes
:
CfgCalculus
.
mode
KFmap
.
t
;
mutable
props
:
CfgCalculus
.
props
;
mutable
props
:
CfgCalculus
.
props
;
}
}
let
empty
()
=
{
let
empty
()
=
{
lemmas
=
[]
;
lemmas
=
[]
;
modes
=
[]
;
modes
=
KFmap
.
empty
;
props
=
`All
;
props
=
`All
;
}
}
...
@@ -80,7 +82,7 @@ let apply task ~kf ?bhvs ?prop () =
...
@@ -80,7 +82,7 @@ let apply task ~kf ?bhvs ?prop () =
|
[]
->
[
empty_default_behavior
]
|
[]
->
[
empty_default_behavior
]
|
bhvs
->
bhvs
in
|
bhvs
->
bhvs
in
List
.
iter
(
fun
bhv
->
List
.
iter
(
fun
bhv
->
task
.
modes
<-
{
kf
;
bhv
}
::
task
.
modes
task
.
modes
<-
KFmap
.
add
kf
{
CfgCalculus
.
kf
;
bhv
}
task
.
modes
)
bhvs
;
)
bhvs
;
Option
.
iter
(
fun
ip
->
task
.
props
<-
`PropId
ip
)
prop
;
Option
.
iter
(
fun
ip
->
task
.
props
<-
`PropId
ip
)
prop
;
end
end
...
@@ -178,10 +180,10 @@ struct
...
@@ -178,10 +180,10 @@ struct
if
l
.
LogicUsage
.
lem_kind
<>
`Axiom
then
if
l
.
LogicUsage
.
lem_kind
<>
`Axiom
then
let
wpo
=
VCG
.
compile_lemma
l
in
let
wpo
=
VCG
.
compile_lemma
l
in
collection
:=
Bag
.
add
wpo
!
collection
collection
:=
Bag
.
add
wpo
!
collection
)
(
List
.
rev
task
.
lemmas
)
;
)
task
.
lemmas
;
end
()
;
end
()
;
List
.
iter
KFmap
.
iter
(
fun
(
mode
:
CfgCalculus
.
mode
)
->
(
fun
_
(
mode
:
CfgCalculus
.
mode
)
->
WpContext
.
on_context
(
model
,
WpContext
.
Kf
mode
.
kf
)
WpContext
.
on_context
(
model
,
WpContext
.
Kf
mode
.
kf
)
begin
fun
()
->
begin
fun
()
->
LogicUsage
.
iter_lemmas
VCG
.
register_lemma
;
LogicUsage
.
iter_lemmas
VCG
.
register_lemma
;
...
@@ -243,8 +245,8 @@ let generator setup driver =
...
@@ -243,8 +245,8 @@ let generator setup driver =
let
dump
task
=
let
dump
task
=
let
module
WP
=
CfgCalculus
.
Make
(
CfgDump
)
in
let
module
WP
=
CfgCalculus
.
Make
(
CfgDump
)
in
let
props
=
task
.
props
in
let
props
=
task
.
props
in
List
.
iter
KFmap
.
iter
(
fun
(
mode
:
CfgCalculus
.
mode
)
->
(
fun
_
(
mode
:
CfgCalculus
.
mode
)
->
let
bhv
=
let
bhv
=
if
Cil
.
is_default_behavior
mode
.
bhv
if
Cil
.
is_default_behavior
mode
.
bhv
then
None
else
Some
mode
.
bhv
.
b_name
in
then
None
else
Some
mode
.
bhv
.
b_name
in
...
...
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