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
fdcf6a8c
Commit
fdcf6a8c
authored
6 years ago
by
Julien Signoles
Browse files
Options
Downloads
Patches
Plain Diff
a bit of comments
parent
c380e39e
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/interval.ml
+10
-4
10 additions, 4 deletions
src/plugins/e-acsl/interval.ml
src/plugins/e-acsl/interval_system.ml
+5
-1
5 additions, 1 deletion
src/plugins/e-acsl/interval_system.ml
with
15 additions
and
5 deletions
src/plugins/e-acsl/interval.ml
+
10
−
4
View file @
fdcf6a8c
...
@@ -79,8 +79,14 @@ let interv_of_unknown_block =
...
@@ -79,8 +79,14 @@ let interv_of_unknown_block =
(
Ival
.
inject_range
(
Some
Integer
.
zero
)
(
Some
(
Bit_utils
.
max_byte_address
()
)))
(
Ival
.
inject_range
(
Some
Integer
.
zero
)
(
Some
(
Bit_utils
.
max_byte_address
()
)))
(* imperative environments *)
(* imperative environments *)
module
Env
:
sig
module
Env
=
struct
val
clear
:
unit
->
unit
val
add
:
Cil_types
.
logic_var
->
Ival
.
t
->
unit
val
find
:
Cil_types
.
logic_var
->
Ival
.
t
val
remove
:
Cil_types
.
logic_var
->
unit
val
replace
:
Cil_types
.
logic_var
->
Ival
.
t
->
unit
val
find_all
:
Cil_types
.
logic_var
->
Ival
.
t
list
end
=
struct
open
Cil_datatype
open
Cil_datatype
let
tbl
:
Ival
.
t
Logic_var
.
Hashtbl
.
t
=
Logic_var
.
Hashtbl
.
create
7
let
tbl
:
Ival
.
t
Logic_var
.
Hashtbl
.
t
=
Logic_var
.
Hashtbl
.
create
7
let
clear
()
=
Logic_var
.
Hashtbl
.
clear
tbl
let
clear
()
=
Logic_var
.
Hashtbl
.
clear
tbl
...
@@ -360,6 +366,7 @@ and build_ieqs t ieqs ivars =
...
@@ -360,6 +366,7 @@ and build_ieqs t ieqs ivars =
let
args_lty
=
List
.
map2
let
args_lty
=
List
.
map2
(
fun
lv
arg
->
(
fun
lv
arg
->
try
try
(* speed-up convergence *)
let
i
=
interv_of_typ_containing_interv
(
infer
arg
)
in
let
i
=
interv_of_typ_containing_interv
(
infer
arg
)
in
Env
.
add
lv
i
;
Env
.
add
lv
i
;
Ctype
(
TInt
(
ikind_of_interv
i
,
[]
))
Ctype
(
TInt
(
ikind_of_interv
i
,
[]
))
...
@@ -371,8 +378,7 @@ and build_ieqs t ieqs ivars =
...
@@ -371,8 +378,7 @@ and build_ieqs t ieqs ivars =
in
in
(* x *)
(* x *)
let
ivar
=
let
ivar
=
{
Interval_system
.
iv_name
=
li
.
l_var_info
.
lv_name
;
{
Interval_system
.
iv_name
=
li
.
l_var_info
.
lv_name
;
iv_types
=
args_lty
}
iv_types
=
args_lty
}
in
in
(* Adding x = g(x) if it is not yet in the system of equations.
(* Adding x = g(x) if it is not yet in the system of equations.
Without this check, the algorithm would not terminate. *)
Without this check, the algorithm would not terminate. *)
...
...
This diff is collapsed.
Click to expand it.
src/plugins/e-acsl/interval_system.ml
+
5
−
1
View file @
fdcf6a8c
...
@@ -28,7 +28,11 @@ open Cil_types
...
@@ -28,7 +28,11 @@ open Cil_types
type
ival_binop
=
Ival_add
|
Ival_min
|
Ival_mul
|
Ival_div
|
Ival_union
type
ival_binop
=
Ival_add
|
Ival_min
|
Ival_mul
|
Ival_div
|
Ival_union
type
ivar
=
{
iv_name
:
string
;
iv_types
:
logic_type
list
}
type
ivar
=
(* it would be possible to get more precise results by storing an ival for
each argument instead of a logic type, but the system would converge too
slowly to a solution. *)
{
iv_name
:
string
;
iv_types
:
logic_type
list
}
type
ival_exp
=
type
ival_exp
=
|
Iconst
of
Ival
.
t
|
Iconst
of
Ival
.
t
...
...
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