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
795f8fc2
Commit
795f8fc2
authored
4 years ago
by
Allan Blanchard
Browse files
Options
Downloads
Patches
Plain Diff
[Logic] factorize a code segment in Annotations
parent
af788529
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/kernel_services/ast_data/annotations.ml
+6
-12
6 additions, 12 deletions
src/kernel_services/ast_data/annotations.ml
with
6 additions
and
12 deletions
src/kernel_services/ast_data/annotations.ml
+
6
−
12
View file @
795f8fc2
...
...
@@ -1052,6 +1052,10 @@ let get_full_spec kf ?stmt ?(behavior=[]) () =
|
[
{
annot_content
=
AStmtSpec
(
_
,
s
)}
]
->
s
|
_
->
Kernel
.
fatal
"More than one contract associated to a statement"
)
let
get_spec_behavior
s
=
function
|
None
->
Cil
.
find_default_behavior
s
|
Some
name
->
List
.
find_opt
(
fun
{
b_name
}
->
b_name
=
name
)
s
.
spec_behavior
let
add_assigns
~
keep_empty
e
kf
?
stmt
?
active
?
behavior
a
=
let
set_bhv
full_bhv
e_bhv
=
let
keep_empty
=
keep_empty
&&
full_bhv
.
b_assigns
=
WritesAny
in
...
...
@@ -1075,12 +1079,7 @@ let add_assigns ~keep_empty e kf ?stmt ?active ?behavior a =
)
in
let
old_spec
=
get_full_spec
kf
?
stmt
?
behavior
:
active
()
in
let
bhv
=
match
behavior
with
|
None
->
Cil
.
find_default_behavior
old_spec
|
Some
name
->
List
.
find_opt
(
fun
{
b_name
}
->
b_name
=
name
)
old_spec
.
spec_behavior
in
let
bhv
=
get_spec_behavior
old_spec
behavior
in
let
is_empty
=
match
bhv
with
|
None
->
true
...
...
@@ -1104,12 +1103,7 @@ let add_allocates ~keep_empty e kf ?stmt ?active ?behavior a =
(
Property
.
ip_allocation_of_behavior
kf
ki
active
full_bhv
);
in
let
old_spec
=
get_full_spec
kf
?
stmt
?
behavior
:
active
()
in
let
bhv
=
match
behavior
with
|
None
->
Cil
.
find_default_behavior
old_spec
|
Some
name
->
List
.
find_opt
(
fun
{
b_name
}
->
b_name
=
name
)
old_spec
.
spec_behavior
in
let
bhv
=
get_spec_behavior
old_spec
behavior
in
let
is_empty
=
match
bhv
with
|
None
->
true
...
...
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