Skip to content
Snippets Groups Projects
Commit d215716e authored by Andre Maroneze's avatar Andre Maroneze
Browse files

[Eva] fix very minor typos

parent 83de5fb0
No related branches found
No related tags found
No related merge requests found
...@@ -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] is x, y are swap (* Creates a pair, and also returns a boolean that is [true] if 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 represents 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 represents 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 type [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 returns (* 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 octoganal forms ±(X±Y-v) for [e1 op e2]. *) (* equivalent octagonal 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 variables 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,
......
...@@ -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 cases, 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 cases, 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);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment