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
6217c36c
Commit
6217c36c
authored
2 years ago
by
Thibaut Benjamin
Browse files
Options
Downloads
Patches
Plain Diff
[e-acsl] review
parent
c80b4dda
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/e-acsl/src/analyses/typing.ml
+41
-26
41 additions, 26 deletions
src/plugins/e-acsl/src/analyses/typing.ml
with
41 additions
and
26 deletions
src/plugins/e-acsl/src/analyses/typing.ml
+
41
−
26
View file @
6217c36c
...
@@ -708,15 +708,21 @@ and number_ty_bound_variable ~profile (t1, lv, t2) =
...
@@ -708,15 +708,21 @@ and number_ty_bound_variable ~profile (t1, lv, t2) =
let
i
=
Interval
.(
widen
(
join
i1
i2
))
in
let
i
=
Interval
.(
widen
(
join
i1
i2
))
in
match
lv
.
lv_type
with
match
lv
.
lv_type
with
|
Linteger
->
|
Linteger
->
(
match
t2
.
term_type
with
let
t2
=
Logic_utils
.
remove_logic_coerce
t2
in
|
Ctype
(
TInt
(
ik
,
_
)
as
typ
)
when
let
ty
=
Interval
.
is_included
i
(
Interval
.
interv_of_typ
typ
)
match
t2
.
term_type
with
->
mk_ctx
~
use_gmp_opt
:
true
(
C_integer
ik
)
|
Ctype
typ
->
|
_
->
(
match
t2
.
term_node
with
(
match
Cil
.
unrollType
typ
with
|
T
Logic_coerce
(
_
,
{
term_type
=
Ctype
(
TInt
(
ik
,
_
)
as
typ
)}
)
when
|
T
Int
(
ik
,
_
)
|
TEnum
({
ekind
=
ik
}
,
_
)
when
Interval
.
is_included
i
(
Interval
.
interv_of_typ
typ
)
Interval
.
is_included
i
(
Interval
.
interv_of_typ
typ
)
->
mk_ctx
~
use_gmp_opt
:
true
(
C_integer
ik
)
->
Some
(
C_integer
ik
)
|
_
->
mk_ctx
~
use_gmp_opt
:
true
(
ty_of_interv
~
ctx
:
Gmpz
i
)))
|
TInt
_
|
TEnum
_
|
TFloat
_
|
TVoid
_
|
TPtr
_
|
TArray
_
|
TFun
_
|
TComp
_
|
TBuiltin_va_list
_
|
TNamed
_
->
None
)
|
_
->
None
in
(
match
ty
with
|
Some
ty
->
mk_ctx
~
use_gmp_opt
:
true
ty
|
None
->
mk_ctx
~
use_gmp_opt
:
true
(
ty_of_interv
~
ctx
:
Gmpz
i
))
|
Ctype
ty
->
|
Ctype
ty
->
(
match
Cil
.
unrollType
ty
with
(
match
Cil
.
unrollType
ty
with
|
TInt
(
ik
,
_
)
|
TEnum
({
ekind
=
ik
}
,
_
)
->
join
|
TInt
(
ik
,
_
)
|
TEnum
({
ekind
=
ik
}
,
_
)
->
join
...
@@ -839,25 +845,34 @@ and ctx_relation ~profile t1 t2 =
...
@@ -839,25 +845,34 @@ and ctx_relation ~profile t1 t2 =
let
i1
=
Interval
.
get_from_profile
~
profile
t1
in
let
i1
=
Interval
.
get_from_profile
~
profile
t1
in
let
i2
=
Interval
.
get_from_profile
~
profile
t2
in
let
i2
=
Interval
.
get_from_profile
~
profile
t2
in
let
i
=
Interval
.
join
i1
i2
in
let
i
=
Interval
.
join
i1
i2
in
match
t1
.
term_type
with
let
t1
=
Logic_utils
.
remove_logic_coerce
t1
in
|
Ctype
(
TInt
(
ik
,
_
)
as
typ
)
when
let
ty1
=
Interval
.
is_included
i
(
Interval
.
interv_of_typ
typ
)
match
t1
.
term_type
with
->
mk_ctx
~
use_gmp_opt
:
true
(
C_integer
ik
)
|
Ctype
typ
->
|
_
->
(
match
Cil
.
unrollType
typ
with
|
TInt
(
ik
,
_
)
|
TEnum
({
ekind
=
ik
}
,
_
)
when
Interval
.
is_included
i
(
Interval
.
interv_of_typ
typ
)
->
Some
(
C_integer
ik
)
|
TInt
_
|
TEnum
_
|
TFloat
_
|
TVoid
_
|
TPtr
_
|
TArray
_
|
TFun
_
|
TComp
_
|
TBuiltin_va_list
_
|
TNamed
_
->
None
)
|
_
->
None
in
let
t2
=
Logic_utils
.
remove_logic_coerce
t2
in
let
ty2
=
match
t2
.
term_type
with
match
t2
.
term_type
with
|
Ctype
(
TInt
(
ik
,
_
)
as
typ
)
when
|
Ctype
typ
->
Interval
.
is_included
i
(
Interval
.
interv_of_t
yp
typ
)
(
match
Cil
.
unrollT
yp
e
typ
with
->
mk_ctx
~
use_gmp_opt
:
true
(
C_integer
ik
)
|
TInt
(
ik
,
_
)
|
TEnum
({
ekind
=
ik
}
,
_
)
when
|
_
->
match
t1
.
term_node
with
Interval
.
is_included
i
(
Interval
.
interv_of_typ
typ
)
|
TLogic_coerce
(
_
,
{
term_type
=
Ctype
(
TInt
(
ik
,
_
)
as
typ
)})
when
->
Some
(
C_integer
ik
)
Interval
.
is_included
i
(
Interval
.
interv_of_typ
typ
)
|
TInt
_
|
TEnum
_
|
TFloat
_
|
TVoid
_
|
TPtr
_
|
TArray
_
|
TFun
_
->
mk_ctx
~
use_gmp_opt
:
true
(
C_integer
ik
)
|
TComp
_
|
TBuiltin_va_list
_
|
TNamed
_
->
None
)
|
_
->
match
t2
.
term_node
with
|
_
->
None
|
TLogic_coerce
(
_
,
{
term_type
=
Ctype
(
TInt
(
ik
,
_
)
as
typ
)})
whe
n
i
n
Interval
.
is_included
i
(
Interval
.
interv_of_typ
typ
)
match
ty1
,
ty2
with
->
mk_ctx
~
use_gmp_opt
:
true
(
C_integer
ik
)
|
Some
ty
,
_
|
_
->
mk_ctx
~
use_gmp_opt
:
true
(
ty
_of_interv
~
ctx
:
c_int
i
)
|
None
,
Some
ty
->
mk_ctx
~
use_gmp_opt
:
true
ty
|
None
,
None
->
mk_ctx
~
use_gmp_opt
:
true
(
ty_of_interv
~
ctx
:
c_int
i
)
let
type_term
~
use_gmp_opt
?
ctx
~
profile
t
=
let
type_term
~
use_gmp_opt
?
ctx
~
profile
t
=
Options
.
feedback
~
dkey
~
level
:
4
"typing term '%a' in ctx '%a'."
Options
.
feedback
~
dkey
~
level
:
4
"typing term '%a' in ctx '%a'."
...
...
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