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
d215716e
Commit
d215716e
authored
5 years ago
by
Andre Maroneze
Browse files
Options
Downloads
Patches
Plain Diff
[Eva] fix very minor typos
parent
83de5fb0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/value/domains/octagons.ml
+8
-8
8 additions, 8 deletions
src/plugins/value/domains/octagons.ml
tests/value/octagons.c
+2
-2
2 additions, 2 deletions
tests/value/octagons.c
with
10 additions
and
10 deletions
src/plugins/value/domains/octagons.ml
+
8
−
8
View file @
d215716e
...
@@ -73,8 +73,8 @@ module Pair = struct
...
@@ -73,8 +73,8 @@ module Pair = struct
include
State_builder
.
Hashcons
(
D
)
(
Info
)
include
State_builder
.
Hashcons
(
D
)
(
Info
)
(* Creates a pair, and also returns a boolean that is [true] i
s
x, y are
swap
(* Creates a pair, and also returns a boolean that is [true] i
f
x, y are
in the pair. *)
swapped
in the pair. *)
let
make
x
y
=
let
make
x
y
=
assert
(
x
.
vid
<>
y
.
vid
);
assert
(
x
.
vid
<>
y
.
vid
);
let
pair
,
swap
=
if
x
.
vid
<
y
.
vid
then
(
x
,
y
)
,
false
else
(
y
,
x
)
,
true
in
let
pair
,
swap
=
if
x
.
vid
<
y
.
vid
then
(
x
,
y
)
,
false
else
(
y
,
x
)
,
true
in
...
@@ -133,7 +133,7 @@ module Arith = struct
...
@@ -133,7 +133,7 @@ module Arith = struct
let
max
=
Eval_typ
.
range_upper_bound
range
in
let
max
=
Eval_typ
.
range_upper_bound
range
in
Ival
.
inject_range
(
Some
min
)
(
Some
max
)
Ival
.
inject_range
(
Some
min
)
(
Some
max
)
(* Does an ival represent
s
all values of a C type [typ]? *)
(* Does an ival represent all values of a C type [typ]? *)
let
is_top_for_typ
typ
ival
=
let
is_top_for_typ
typ
ival
=
let
open
Eval_typ
in
let
open
Eval_typ
in
Ival
.(
equal
top
ival
)
||
Ival
.(
equal
top
ival
)
||
...
@@ -145,7 +145,7 @@ module Arith = struct
...
@@ -145,7 +145,7 @@ module Arith = struct
let
range
=
make_range
range
in
let
range
=
make_range
range
in
Ival
.
is_included
range
ival
||
Ival
.
is_included
range
(
neg_int
ival
)
Ival
.
is_included
range
ival
||
Ival
.
is_included
range
(
neg_int
ival
)
(* Does an ival represent
s
all possible values of a pair of variables? *)
(* Does an ival represent all possible values of a pair of variables? *)
let
is_top_for_pair
pair
=
let
is_top_for_pair
pair
=
let
x
,
y
=
Pair
.
get
pair
in
let
x
,
y
=
Pair
.
get
pair
in
if
Cil_datatype
.
Typ
.
equal
x
.
vtype
y
.
vtype
if
Cil_datatype
.
Typ
.
equal
x
.
vtype
y
.
vtype
...
@@ -175,7 +175,7 @@ let _pretty_octagon fmt octagon =
...
@@ -175,7 +175,7 @@ let _pretty_octagon fmt octagon =
Use Ival.t to evaluate expressions. *)
Use Ival.t to evaluate expressions. *)
module
Rewriting
=
struct
module
Rewriting
=
struct
(* Checks if the interval [ival] fits in the C typ [typ].
(* Checks if the interval [ival] fits in the C typ
e
[typ].
This is used to ensure that an expression cannot overflow: this module
This is used to ensure that an expression cannot overflow: this module
uses the mathematical semantics of arithmetic operations, and cannot
uses the mathematical semantics of arithmetic operations, and cannot
soundly translate overflows in the C semantics. *)
soundly translate overflows in the C semantics. *)
...
@@ -203,7 +203,7 @@ module Rewriting = struct
...
@@ -203,7 +203,7 @@ module Rewriting = struct
|
`Top
->
false
|
`Top
->
false
|
`Value
ival
->
Ival
.
cardinal_zero_or_one
ival
|
`Value
ival
->
Ival
.
cardinal_zero_or_one
ival
(* If a needed interval is unknown, stop the current computation and return
s
(* If a needed interval is unknown, stop the current computation and return
an empty list. *)
an empty list. *)
let
(
>>
)
value
f
=
match
value
with
let
(
>>
)
value
f
=
match
value
with
|
`Top
->
[]
|
`Top
->
[]
...
@@ -310,7 +310,7 @@ module Rewriting = struct
...
@@ -310,7 +310,7 @@ module Rewriting = struct
constraints. *)
constraints. *)
let
make_octagons
evaluate
expr
ival
=
let
make_octagons
evaluate
expr
ival
=
let
make_octagons_from_binop
typ
e1
op
e2
ival
=
let
make_octagons_from_binop
typ
e1
op
e2
ival
=
(* equivalent oct
oga
nal forms ±(X±Y-v) for [e1 op e2]. *)
(* equivalent oct
ago
nal forms ±(X±Y-v) for [e1 op e2]. *)
let
rewritings
=
rewrite_binop
evaluate
e1
op
e2
in
let
rewritings
=
rewrite_binop
evaluate
e1
op
e2
in
(* create the final octagon, knowning that [e1 op e2] ∈ [ival]. *)
(* create the final octagon, knowning that [e1 op e2] ∈ [ival]. *)
let
make_octagon
(
sign
,
octagon
)
=
let
make_octagon
(
sign
,
octagon
)
=
...
@@ -413,7 +413,7 @@ end
...
@@ -413,7 +413,7 @@ end
(* This domain infers relations between pairs of variables (X, Y), by inferring
(* This domain infers relations between pairs of variables (X, Y), by inferring
intervals for the mathematical operations X+Y and X-Y.
intervals for the mathematical operations X+Y and X-Y.
It also infers non-relational intervals for the separate variable X and Y
It also infers non-relational intervals for the separate variable
s
X and Y
(they could be seen as intervals for X+X and Y+Y, but we chose to store them
(they could be seen as intervals for X+X and Y+Y, but we chose to store them
in another way). These intervals are used to make the join more precise.
in another way). These intervals are used to make the join more precise.
Geometrically, in a plan, intervals for X and Y shape a straight rectangle,
Geometrically, in a plan, intervals for X and Y shape a straight rectangle,
...
...
This diff is collapsed.
Click to expand it.
tests/value/octagons.c
+
2
−
2
View file @
d215716e
...
@@ -81,7 +81,7 @@ void join () {
...
@@ -81,7 +81,7 @@ void join () {
a
=
Frama_C_interval
(
-
32
,
-
10
);
a
=
Frama_C_interval
(
-
32
,
-
10
);
b
=
k
*
5
;
b
=
k
*
5
;
}
}
// In both case, we have b - a >= -1. The "else" branch was more precise.
// In both case
s
, we have b - a >= -1. The "else" branch was more precise.
r
=
b
-
a
+
1
;
r
=
b
-
a
+
1
;
Frama_C_show_each_join_positive
(
r
);
Frama_C_show_each_join_positive
(
r
);
if
(
undet
)
{
if
(
undet
)
{
...
@@ -91,7 +91,7 @@ void join () {
...
@@ -91,7 +91,7 @@ void join () {
a
=
Frama_C_interval
(
-
32
,
-
10
);
a
=
Frama_C_interval
(
-
32
,
-
10
);
b
=
k
*
5
;
b
=
k
*
5
;
}
}
// In both case, we have b + a <= 10. The "then" branch was more precise.
// In both case
s
, we have b + a <= 10. The "then" branch was more precise.
r
=
b
+
a
-
10
;
r
=
b
+
a
-
10
;
Frama_C_show_each_join_negative
(
r
);
Frama_C_show_each_join_negative
(
r
);
}
}
...
...
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