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
4831554b
Commit
4831554b
authored
4 years ago
by
Allan Blanchard
Browse files
Options
Downloads
Patches
Plain Diff
[wp] On empty for, select goal only for default
parent
1c92685e
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/cfgCalculus.ml
+10
-9
10 additions, 9 deletions
src/plugins/wp/cfgCalculus.ml
with
10 additions
and
9 deletions
src/plugins/wp/cfgCalculus.ml
+
10
−
9
View file @
4831554b
...
...
@@ -62,24 +62,25 @@ let is_default_bhv (m: mode) = Cil.is_default_behavior m.bhv
let
is_selected_bhv
(
m
:
mode
)
(
bhv
:
funbehavior
)
=
m
.
bhv
.
b_name
=
bhv
.
b_name
let
is_selected_for
(
m
:
mode
)
(
fors
:
string
list
)
=
fors
=
[]
||
List
.
mem
m
.
bhv
.
b_name
fors
let
is_selected_for
(
m
:
mode
)
~
goal
(
fors
:
string
list
)
=
(
fors
=
[]
&&
(
not
goal
||
is_default_bhv
m
))
||
List
.
mem
m
.
bhv
.
b_name
fors
let
is_selected_ca
(
m
:
mode
)
(
ca
:
code_annotation
)
=
let
is_selected_ca
(
m
:
mode
)
~
goal
(
ca
:
code_annotation
)
=
match
ca
.
annot_content
with
|
AAssigns
(
forb
,_
)
|
AAllocation
(
forb
,_
)
|
AAssert
(
forb
,_
)
|
AInvariant
(
forb
,_,_
)
->
is_selected_for
m
forb
->
is_selected_for
m
~
goal
forb
|
AVariant
_
->
is_default_bhv
m
|
AExtended
_
|
AStmtSpec
_
|
APragma
_
->
assert
false
(* n/a *)
let
is_active_mode
~
mode
(
p
:
Property
.
t
)
=
let
is_active_mode
~
mode
~
goal
(
p
:
Property
.
t
)
=
let
open
Property
in
match
p
with
|
IPCodeAnnot
{
ica_ca
}
->
is_selected_ca
mode
ica_ca
|
IPCodeAnnot
{
ica_ca
}
->
is_selected_ca
mode
~
goal
ica_ca
|
IPPredicate
{
ip_kind
}
->
begin
match
ip_kind
with
|
PKRequires
bhv
|
PKAssumes
bhv
->
...
...
@@ -89,11 +90,11 @@ let is_active_mode ~mode (p: Property.t) =
end
|
IPAllocation
{
ial_bhv
=
bhv
}
|
IPAssigns
{
ias_bhv
=
bhv
}
->
begin
match
bhv
with
|
Id_loop
ca
->
is_selected_ca
mode
ca
|
Id_loop
ca
->
is_selected_ca
mode
~
goal
ca
|
Id_contract
(
_
,
bhv
)
->
is_selected_bhv
mode
bhv
end
|
IPDecrease
{
id_ca
=
None
}
->
is_default_bhv
mode
|
IPDecrease
{
id_ca
=
Some
ca
}
->
is_selected_ca
mode
ca
|
IPDecrease
{
id_ca
=
Some
ca
}
->
is_selected_ca
mode
~
goal
ca
|
IPComplete
_
|
IPDisjoint
_
->
is_default_bhv
mode
|
IPFrom
_
|
IPGlobalInvariant
_
|
IPTypeInvariant
_
->
(*TODO: is it in pass or not ? *)
assert
false
...
...
@@ -174,7 +175,7 @@ struct
let
is_selected
~
goal
{
mode
;
props
}
(
pid
,_
)
=
let
pi
=
WpPropId
.
property_of_id
pid
in
is_active_mode
~
mode
pi
&&
is_active_mode
~
mode
~
goal
pi
&&
(
not
goal
||
is_selected_props
props
~
pi
pid
)
let
is_selected_callpre
{
props
}
(
pid
,_
)
=
...
...
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