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
988432d3
Commit
988432d3
authored
1 year ago
by
Thibault Martin
Committed by
Allan Blanchard
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Generates assigns for prototypes in frama-c mode
parent
4852dc9c
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/kernel_internals/typing/populate_spec.ml
+15
-11
15 additions, 11 deletions
src/kernel_internals/typing/populate_spec.ml
with
15 additions
and
11 deletions
src/kernel_internals/typing/populate_spec.ml
+
15
−
11
View file @
988432d3
...
@@ -48,7 +48,7 @@ sig
...
@@ -48,7 +48,7 @@ sig
val
acsl_default
:
unit
->
clause
val
acsl_default
:
unit
->
clause
val
safe_default
:
bool
->
clause
val
safe_default
:
bool
->
clause
val
frama_c_default
:
unit
->
clause
val
frama_c_default
:
kernel_function
->
clause
val
combine_default
:
clause
list
->
clause
val
combine_default
:
clause
list
->
clause
val
custom_default
:
string
->
kernel_function
->
spec
->
clause
val
custom_default
:
string
->
kernel_function
->
spec
->
clause
...
@@ -69,7 +69,7 @@ struct
...
@@ -69,7 +69,7 @@ struct
|
None
when
mode
=
Safe
->
|
None
when
mode
=
Safe
->
Generated
(
G
.
safe_default
@@
Kernel_function
.
has_definition
kf
)
Generated
(
G
.
safe_default
@@
Kernel_function
.
has_definition
kf
)
|
None
when
mode
=
Frama_C
->
|
None
when
mode
=
Frama_C
->
Generated
(
G
.
frama_c_default
()
)
Generated
(
G
.
frama_c_default
kf
)
|
None
->
|
None
->
match
mode
with
match
mode
with
|
ACSL
|
Safe
|
Frama_C
->
assert
false
|
ACSL
|
Safe
|
Frama_C
->
assert
false
...
@@ -111,7 +111,7 @@ struct
...
@@ -111,7 +111,7 @@ struct
then
[
Exits
,
Logic_const
.(
new_predicate
pfalse
)
]
then
[
Exits
,
Logic_const
.(
new_predicate
pfalse
)
]
else
[]
else
[]
let
frama_c_default
()
=
let
frama_c_default
_
=
[
Exits
,
Logic_const
.(
new_predicate
pfalse
)
]
[
Exits
,
Logic_const
.(
new_predicate
pfalse
)
]
let
combine_default
(
clauses
:
clause
list
)
=
let
combine_default
(
clauses
:
clause
list
)
=
...
@@ -166,8 +166,10 @@ struct
...
@@ -166,8 +166,10 @@ struct
then
Writes
[]
then
Writes
[]
else
WritesAny
else
WritesAny
let
frama_c_default
()
=
let
frama_c_default
kf
=
acsl_default
()
(* todo : port infer annotations *)
if
Kernel_function
.
has_definition
kf
then
acsl_default
()
(* TODO: use genassigns *)
else
Writes
(
Infer_annotations
.
assigns_from_prototype
kf
)
let
compare_deps
d1
d2
=
let
compare_deps
d1
d2
=
match
d1
,
d2
with
match
d1
,
d2
with
...
@@ -239,7 +241,7 @@ struct
...
@@ -239,7 +241,7 @@ struct
then
FreeAlloc
([]
,
[]
)
then
FreeAlloc
([]
,
[]
)
else
FreeAllocAny
else
FreeAllocAny
let
frama_c_default
()
=
let
frama_c_default
_
=
acsl_default
()
acsl_default
()
let
combine_default
clauses
=
let
combine_default
clauses
=
...
@@ -282,7 +284,7 @@ struct
...
@@ -282,7 +284,7 @@ struct
then
Some
(
Logic_const
.(
new_predicate
ptrue
))
then
Some
(
Logic_const
.(
new_predicate
ptrue
))
else
Some
(
Logic_const
.(
new_predicate
pfalse
))
else
Some
(
Logic_const
.(
new_predicate
pfalse
))
let
frama_c_default
()
=
let
frama_c_default
_
=
acsl_default
()
acsl_default
()
let
combine_default
_
=
let
combine_default
_
=
...
@@ -305,8 +307,9 @@ let get_mode = function
...
@@ -305,8 +307,9 @@ let get_mode = function
|
"acsl"
->
ACSL
|
"acsl"
->
ACSL
|
"safe"
->
Safe
|
"safe"
->
Safe
|
s
->
|
s
->
Kernel
.
abort
"
\'
%s
\'
is not a valid mode for spec generation, accepted values \
Kernel
.
abort
are 'frama-c', 'acsl' and 'safe'"
s
"
\'
%s
\'
is not a valid mode for spec generation, accepted values \
are 'frama-c', 'acsl' and 'safe'"
s
let
build_config
mode
=
{
let
build_config
mode
=
{
exits
=
mode
;
exits
=
mode
;
...
@@ -329,8 +332,9 @@ let get_config () =
...
@@ -329,8 +332,9 @@ let get_config () =
|
"allocates"
->
{
conf
with
allocates
=
mode
}
|
"allocates"
->
{
conf
with
allocates
=
mode
}
|
"terminates"
->
{
conf
with
terminates
=
mode
}
|
"terminates"
->
{
conf
with
terminates
=
mode
}
|
s
->
|
s
->
Kernel
.
abort
"
\'
%s
\'
is not a valid clause for spec generation, accepted \
Kernel
.
abort
values are 'exits', 'assigns', 'allocates' and 'terminates'"
s
"
\'
%s
\'
is not a valid clause for spec generation, accepted \
values are 'exits', 'assigns', 'allocates' and 'terminates'"
s
in
in
Datatype
.
String
.
Map
.
fold
apply_custom
custom_map
default
Datatype
.
String
.
Map
.
fold
apply_custom
custom_map
default
...
...
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