Commit 82efbf69 authored by Valentin Perrelle's avatar Valentin Perrelle Committed by Virgile Prevosto
Browse files

[aorai] small fixes after code review

parent 08412fd1
......@@ -73,7 +73,8 @@ val finishParsing: unit -> unit (** Call this function to finish parsing and
val pp_context_from_file:
?ctx:int -> ?start_line:int -> Format.formatter -> Filepath.position -> unit
(** prints a readable description of a location *)
(** prints a readable description of a location
@since Frama-C+dev *)
val pp_location: Format.formatter -> Cil_types.location -> unit
(** Parse errors are usually fatal, but their reporting is sometimes
......
......@@ -31,8 +31,8 @@ type transition = (typed_condition * action) trans
module Vertex =
struct
type t = state
let compare x y = x.nums - y.nums
let hash x = x.nums
let compare x y = Pervasives.compare x.nums y.nums
let hash x = Hashtbl.hash x.nums
let equal x y = x.nums = y.nums
let default = {
nums = -1; name = ""; multi_state = None;
......@@ -43,7 +43,7 @@ end
module Edge =
struct
type t = transition
let compare x y = x.numt - y.numt
let compare x y = Pervasives.compare x.numt y.numt
let default = {
numt = -1; start = Vertex.default; stop = Vertex.default;
cross = TTrue,[]
......
......@@ -114,7 +114,7 @@ struct
let diff = Set.diff used initialized in
if not (Set.is_empty diff) then
alarm edge diff;
(* Add variables intialized by the condition *)
(* Add variables initialized by the condition *)
let add_initialized set = function
| Copy_value ((TVar({lv_origin = Some vi}),_),_) -> Set.add vi set
| _ -> set
......@@ -132,7 +132,7 @@ let checkInitialization auto =
struct
let is_metavariable vi =
let module Map = Datatype.String.Map in
Map.exists (fun _ vi' -> (vi'.vid = vi.vid)) auto.metavariables
Map.exists (fun _ -> Cil_datatype.Varinfo.equal vi) auto.metavariables
end
in
let module A = InitAnalysis (P) in
......
......@@ -133,7 +133,7 @@ let rec is_same_expression e1 e2 =
| PVar _,_ | _,PVar _ -> false
| PCst cst1, PCst cst2 -> Logic_utils.is_same_pconstant cst1 cst2
| PCst _,_ | _,PCst _ -> false
| PPrm (f1,x1), PPrm(f2,x2) -> f1 = x1 && f2 = x2
| PPrm (f1,x1), PPrm(f2,x2) -> f1 = f2 && x1 = x2
| PPrm _,_ | _,PPrm _ -> false
| PMetavar x, PMetavar y -> x = y
| PMetavar _,_ | _,PMetavar _ -> false
......@@ -1555,8 +1555,7 @@ let setAutomata auto =
let getState num =
List.find (fun st -> st.nums = num) (getAutomata ()).states
let getStateName num =
(getState num).name
let getStateName num = (getState num).name
let getTransition num =
List.find (fun trans -> trans.numt = num) (getAutomata ()).trans
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment