Skip to content
Snippets Groups Projects
Commit 1f04474d authored by Thibaut Benjamin's avatar Thibaut Benjamin
Browse files

[e-acsl] second review

parent f0a5db64
No related branches found
No related tags found
No related merge requests found
...@@ -395,13 +395,13 @@ module Logic_env ...@@ -395,13 +395,13 @@ module Logic_env
let new_lq_bind = let new_lq_bind =
try Logic_var.Map.update x update env.let_quantif_bind try Logic_var.Map.update x update env.let_quantif_bind
with Not_found -> with Not_found ->
match Logic_var.Map.find_opt x env.profile with match Logic_var.Map.find_opt x env.profile with
| Some i -> | Some i ->
(* The profile must remain unchanged, so if the variable is bound in (* The profile must remain unchanged, so if the variable is bound in
the profile, we add the refined interval in the other bindings, the profile, we add the refined interval in the other bindings,
which are checked first when finding the interval *) which are checked first when finding the interval *)
Logic_var.Map.add x (!ival_meet_ref i ival) env.let_quantif_bind Logic_var.Map.add x (!ival_meet_ref i ival) env.let_quantif_bind
| None -> Options.abort "updating a variable not in environment" | None -> Options.abort "updating a variable not in environment"
in in
{env with let_quantif_bind = new_lq_bind} {env with let_quantif_bind = new_lq_bind}
......
...@@ -93,11 +93,11 @@ module Logic_env : sig ...@@ -93,11 +93,11 @@ module Logic_env : sig
val find : t -> logic_var -> ival val find : t -> logic_var -> ival
(** get the profile of the logic environment, i.e. bindings through function (** get the profile of the logic environment, i.e. bindings through function
arguments *) arguments *)
val get_profile : t -> Profile.t val get_profile : t -> Profile.t
(** refine the interval of a logic variable : replace an interval with a (** refine the interval of a logic variable: replace an interval with a more
more precise one *) precise one *)
val refine : t -> logic_var -> ival -> t val refine : t -> logic_var -> ival -> t
end end
......
...@@ -903,6 +903,10 @@ and compute_logic_env_if_branches logic_env t = ...@@ -903,6 +903,10 @@ and compute_logic_env_if_branches logic_env t =
in in
let add_eq logic_env x v = Logic_env.refine logic_env x (get_res (ival v)) in let add_eq logic_env x v = Logic_env.refine logic_env x (get_res (ival v)) in
let t_branch, f_branch = let t_branch, f_branch =
(* we do not discriminate between strict and weak inequalities. This is
slighlty less precise but allow for better reusing of the code in the
case of recursive functions, the main advantage in typing
conditionals is for recursive functions. *)
match t.term_node with match t.term_node with
| TBinOp(op, {term_node = TLval(TVar x, TNoOffset)}, v) -> | TBinOp(op, {term_node = TLval(TVar x, TNoOffset)}, v) ->
begin begin
......
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