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
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
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
Charles Southerland
frama-c
Commits
aadd2bd8
Commit
aadd2bd8
authored
6 years ago
by
Julien Signoles
Browse files
Options
Downloads
Patches
Plain Diff
[Typing] restore behavior of -e-acsl-builtins
parent
fbe99459
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/e-acsl/typing.ml
+46
-35
46 additions, 35 deletions
src/plugins/e-acsl/typing.ml
src/plugins/e-acsl/visit.ml
+3
-2
3 additions, 2 deletions
src/plugins/e-acsl/visit.ml
with
49 additions
and
37 deletions
src/plugins/e-acsl/typing.ml
+
46
−
35
View file @
aadd2bd8
...
...
@@ -477,42 +477,53 @@ let rec type_term ~use_gmp_opt ?(arith_operand=false) ?ctx t =
dup
Other
|
Tapp
(
li
,
_
,
args
)
->
List
.
iter
(
fun
arg
->
ignore
(
type_term
~
use_gmp_opt
:
true
arg
))
args
;
begin
match
li
.
l_body
with
|
LBpred
_
->
(* We can have an [LBpred] here because we transformed
[Papp] into [Tapp] *)
dup
c_int
|
LBterm
_
->
begin
match
li
.
l_type
with
|
None
->
assert
false
|
Some
lty
->
begin
match
lty
with
|
Linteger
->
let
i
=
Interval
.
infer
t
in
if
Options
.
Gmp_only
.
get
()
then
dup
Gmp
else
dup
(
ty_of_interv
i
)
|
Ctype
TInt
(
ik
,
_
)
->
dup
(
C_type
ik
)
|
Ctype
TFloat
_
->
(* TODO: handle in MR !226 *)
dup
Other
|
Lreal
->
Error
.
not_yet
"real numbers"
|
Ctype
_
->
dup
Other
|
Ltype
_
|
Lvar
_
|
Larrow
_
->
Options
.
fatal
"unexpected type"
if
Builtins
.
mem
li
.
l_var_info
.
lv_name
then
let
typ_arg
lvi
arg
=
(* a built-in is a C function, so the context is necessarily a C
type. *)
let
ctx
=
ty_of_logic_ty
lvi
.
lv_type
in
ignore
(
type_term
~
use_gmp_opt
:
false
~
ctx
arg
)
in
List
.
iter2
typ_arg
li
.
l_profile
args
;
(* [li.l_type is [None] for predicate only: not possible here.
Thus using [Extlib.the] is fine *)
dup
(
ty_of_logic_ty
(
Extlib
.
the
li
.
l_type
))
else
begin
List
.
iter
(
fun
arg
->
ignore
(
type_term
~
use_gmp_opt
:
true
arg
))
args
;
match
li
.
l_body
with
|
LBpred
_
->
(* We can have an [LBpred] here because we transformed
[Papp] into [Tapp] *)
dup
c_int
|
LBterm
_
->
begin
match
li
.
l_type
with
|
None
->
assert
false
|
Some
lty
->
match
lty
with
|
Linteger
->
let
i
=
Interval
.
infer
t
in
if
Options
.
Gmp_only
.
get
()
then
dup
Gmp
else
dup
(
ty_of_interv
i
)
|
Ctype
TInt
(
ik
,
_
)
->
dup
(
C_type
ik
)
|
Ctype
TFloat
_
->
(* TODO: handle in MR !226 *)
dup
Other
|
Lreal
->
Error
.
not_yet
"real numbers"
|
Ctype
_
->
dup
Other
|
Ltype
_
|
Lvar
_
|
Larrow
_
->
Options
.
fatal
"unexpected type"
end
end
|
LBnone
->
Error
.
not_yet
"logic functions with no definition nor reads clause"
|
LBreads
_
->
Error
.
not_yet
"logic functions performing read accesses"
|
LBinductive
_
->
Error
.
not_yet
"logic functions inductively defined"
|
LBnone
->
Error
.
not_yet
"logic functions with no definition nor reads clause"
|
LBreads
_
->
Error
.
not_yet
"logic functions performing read accesses"
|
LBinductive
_
->
Error
.
not_yet
"logic functions inductively defined"
end
|
Tunion
_
->
Error
.
not_yet
"tset union"
...
...
This diff is collapsed.
Click to expand it.
src/plugins/e-acsl/visit.ml
+
3
−
2
View file @
aadd2bd8
...
...
@@ -470,8 +470,9 @@ you must call function `%s' and `__e_acsl_memory_clean by yourself.@]"
Cil
.
JustCopyPost
(
fun
l
->
let
new_vi
=
Cil
.
get_varinfo
self
#
behavior
vi
in
Misc
.
register_library_function
new_vi
;
Builtins
.
update
vi
.
vname
new_vi
;
if
Misc
.
is_library_loc
vi
.
vdecl
then
Misc
.
register_library_function
new_vi
;
if
Builtins
.
mem
vi
.
vname
then
Builtins
.
update
vi
.
vname
new_vi
;
l
)
else
begin
Misc
.
register_library_function
vi
;
...
...
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