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

[e-acsl] improve typeing for conditionals inside predicates

parent 993ab515
No related branches found
No related tags found
No related merge requests found
...@@ -377,7 +377,6 @@ let rec fixpoint ~(infer : force:bool -> ...@@ -377,7 +377,6 @@ let rec fixpoint ~(infer : force:bool ->
let assumed_ival = interv_of_typ_containing_interv inferred_ival in let assumed_ival = interv_of_typ_containing_interv inferred_ival in
fixpoint ~infer li args_ival t' assumed_ival fixpoint ~infer li args_ival t' assumed_ival
(* Memoization module which retrieves the computed info of some terms *) (* Memoization module which retrieves the computed info of some terms *)
module Memo: sig module Memo: sig
val memo: val memo:
...@@ -482,8 +481,6 @@ end = struct ...@@ -482,8 +481,6 @@ end = struct
let clear () = let clear () =
Options.feedback ~level:4 "clearing the typing tables"; Options.feedback ~level:4 "clearing the typing tables";
LFProf.Hashtbl.clear widened_profile_tbl LFProf.Hashtbl.clear widened_profile_tbl
end end
let plus_one i = let plus_one i =
...@@ -742,17 +739,18 @@ let rec infer ~force ~logic_env t = ...@@ -742,17 +739,18 @@ let rec infer ~force ~logic_env t =
if LF_env.is_rec li then if LF_env.is_rec li then
let widened_profile = widen_profile profile in let widened_profile = widen_profile profile in
Widened_profile.add profile li widened_profile; Widened_profile.add profile li widened_profile;
(match li.l_body with try LF_env.find li widened_profile
| LBpred p -> with
LF_env.add_pred li widened_profile; | Not_found ->
infer_predicate (match li.l_body with
~logic_env:(Logic_env.make widened_profile) p; | LBpred p ->
Ival Ival.zero_or_one LF_env.add_pred li widened_profile;
| LBterm t' -> infer_predicate
(try LF_env.find li widened_profile ~logic_env:(Logic_env.make widened_profile) p;
with Not_found -> Ival Ival.zero_or_one
fixpoint ~infer li widened_profile t' (Ival Ival.bottom)) | LBterm t' ->
| _ -> assert false) fixpoint ~infer li widened_profile t' (Ival Ival.bottom)
| _ -> assert false)
else else
let logic_env = Logic_env.make profile in let logic_env = Logic_env.make profile in
(match li.l_body with (match li.l_body with
...@@ -1059,8 +1057,11 @@ and infer_predicate ~logic_env p = ...@@ -1059,8 +1057,11 @@ and infer_predicate ~logic_env p =
infer_predicate ~logic_env p; infer_predicate ~logic_env p;
| Pif(t, p1, p2) -> | Pif(t, p1, p2) ->
ignore (infer ~force:false ~logic_env t); ignore (infer ~force:false ~logic_env t);
infer_predicate ~logic_env p1; let logic_env_tbranch, logic_env_fbranch =
infer_predicate ~logic_env p2 compute_logic_env_if_branches logic_env t
in
infer_predicate ~logic_env:logic_env_tbranch p1;
infer_predicate ~logic_env:logic_env_fbranch p2
| Plet(li, p) -> | Plet(li, p) ->
let li_t = Misc.term_of_li li in let li_t = Misc.term_of_li li in
let li_v = li.l_var_info in let li_v = li.l_var_info in
......
[e-acsl] beginning translation. [e-acsl] beginning translation.
[e-acsl] translation done in project "e-acsl". [e-acsl] translation done in project "e-acsl".
[eva:alarm] functions_rec.c:11: Warning:
accessing uninitialized left-value.
assert \initialized((__e_acsl_mpz_struct *)__gen_e_acsl_sub);
[eva:alarm] functions_rec.c:11: Warning:
accessing uninitialized left-value.
assert \initialized((__e_acsl_mpz_struct *)__gen_e_acsl_sub_2);
[eva] functions_rec.c:11: Warning: [eva] functions_rec.c:11: Warning:
Using specification of function __gen_e_acsl_even_3 for recursive calls. Using specification of function __gen_e_acsl_even for recursive calls.
Analysis of function __gen_e_acsl_even_3 is thus incomplete and its soundness Analysis of function __gen_e_acsl_even is thus incomplete and its soundness
relies on the written specification.
[eva:alarm] functions_rec.c:12: Warning:
accessing uninitialized left-value.
assert \initialized((__e_acsl_mpz_struct *)__gen_e_acsl_add);
[eva] functions_rec.c:12: Warning:
Using specification of function __gen_e_acsl_even_3 for recursive calls.
Analysis of function __gen_e_acsl_even_3 is thus incomplete and its soundness
relies on the written specification. relies on the written specification.
[eva:alarm] functions_rec.c:40: Warning: [eva:alarm] functions_rec.c:40: Warning:
function __e_acsl_assert, behavior blocking: precondition got status unknown. function __e_acsl_assert, behavior blocking: precondition got status unknown.
[eva:alarm] functions_rec.c:40: Warning: assertion got status unknown. [eva:alarm] functions_rec.c:40: Warning: assertion got status unknown.
[eva:alarm] functions_rec.c:12: Warning: [eva] functions_rec.c:12: Warning:
accessing uninitialized left-value. Using specification of function __gen_e_acsl_even for recursive calls.
assert \initialized((__e_acsl_mpz_struct *)__gen_e_acsl_add_2); Analysis of function __gen_e_acsl_even is thus incomplete and its soundness
relies on the written specification.
[eva:alarm] functions_rec.c:41: Warning: [eva:alarm] functions_rec.c:41: Warning:
function __e_acsl_assert, behavior blocking: precondition got status unknown. function __e_acsl_assert, behavior blocking: precondition got status unknown.
[eva:alarm] functions_rec.c:41: Warning: assertion got status unknown. [eva:alarm] functions_rec.c:41: Warning: assertion got status unknown.
......
This diff is collapsed.
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