Skip to content
Snippets Groups Projects
Commit 82efbf69 authored by Valentin Perrelle's avatar Valentin Perrelle Committed by Virgile Prevosto
Browse files

[aorai] small fixes after code review

parent 08412fd1
No related branches found
No related tags found
No related merge requests found
...@@ -73,7 +73,8 @@ val finishParsing: unit -> unit (** Call this function to finish parsing and ...@@ -73,7 +73,8 @@ val finishParsing: unit -> unit (** Call this function to finish parsing and
val pp_context_from_file: val pp_context_from_file:
?ctx:int -> ?start_line:int -> Format.formatter -> Filepath.position -> unit ?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 val pp_location: Format.formatter -> Cil_types.location -> unit
(** Parse errors are usually fatal, but their reporting is sometimes (** Parse errors are usually fatal, but their reporting is sometimes
......
...@@ -31,8 +31,8 @@ type transition = (typed_condition * action) trans ...@@ -31,8 +31,8 @@ type transition = (typed_condition * action) trans
module Vertex = module Vertex =
struct struct
type t = state type t = state
let compare x y = x.nums - y.nums let compare x y = Pervasives.compare x.nums y.nums
let hash x = x.nums let hash x = Hashtbl.hash x.nums
let equal x y = x.nums = y.nums let equal x y = x.nums = y.nums
let default = { let default = {
nums = -1; name = ""; multi_state = None; nums = -1; name = ""; multi_state = None;
...@@ -43,7 +43,7 @@ end ...@@ -43,7 +43,7 @@ end
module Edge = module Edge =
struct struct
type t = transition type t = transition
let compare x y = x.numt - y.numt let compare x y = Pervasives.compare x.numt y.numt
let default = { let default = {
numt = -1; start = Vertex.default; stop = Vertex.default; numt = -1; start = Vertex.default; stop = Vertex.default;
cross = TTrue,[] cross = TTrue,[]
......
...@@ -114,7 +114,7 @@ struct ...@@ -114,7 +114,7 @@ struct
let diff = Set.diff used initialized in let diff = Set.diff used initialized in
if not (Set.is_empty diff) then if not (Set.is_empty diff) then
alarm edge diff; alarm edge diff;
(* Add variables intialized by the condition *) (* Add variables initialized by the condition *)
let add_initialized set = function let add_initialized set = function
| Copy_value ((TVar({lv_origin = Some vi}),_),_) -> Set.add vi set | Copy_value ((TVar({lv_origin = Some vi}),_),_) -> Set.add vi set
| _ -> set | _ -> set
...@@ -132,7 +132,7 @@ let checkInitialization auto = ...@@ -132,7 +132,7 @@ let checkInitialization auto =
struct struct
let is_metavariable vi = let is_metavariable vi =
let module Map = Datatype.String.Map in 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 end
in in
let module A = InitAnalysis (P) in let module A = InitAnalysis (P) in
......
...@@ -133,7 +133,7 @@ let rec is_same_expression e1 e2 = ...@@ -133,7 +133,7 @@ let rec is_same_expression e1 e2 =
| PVar _,_ | _,PVar _ -> false | PVar _,_ | _,PVar _ -> false
| PCst cst1, PCst cst2 -> Logic_utils.is_same_pconstant cst1 cst2 | PCst cst1, PCst cst2 -> Logic_utils.is_same_pconstant cst1 cst2
| PCst _,_ | _,PCst _ -> false | 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 | PPrm _,_ | _,PPrm _ -> false
| PMetavar x, PMetavar y -> x = y | PMetavar x, PMetavar y -> x = y
| PMetavar _,_ | _,PMetavar _ -> false | PMetavar _,_ | _,PMetavar _ -> false
...@@ -1555,8 +1555,7 @@ let setAutomata auto = ...@@ -1555,8 +1555,7 @@ let setAutomata auto =
let getState num = let getState num =
List.find (fun st -> st.nums = num) (getAutomata ()).states List.find (fun st -> st.nums = num) (getAutomata ()).states
let getStateName num = let getStateName num = (getState num).name
(getState num).name
let getTransition num = let getTransition num =
List.find (fun trans -> trans.numt = num) (getAutomata ()).trans List.find (fun trans -> trans.numt = num) (getAutomata ()).trans
......
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