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

[e-acsl] second code review

parent 16d69bfc
No related branches found
No related tags found
No related merge requests found
...@@ -697,14 +697,10 @@ end ...@@ -697,14 +697,10 @@ end
let do_user_predicates () = let do_user_predicates () =
let gannot a = let gannot a =
match a with match a with
| Dfun_or_pred (li,loc) -> | Dfun_or_pred ({l_body = LBpred p},loc) ->
(match li.l_body with (match Logic_normalizer.get_pred p with
| LBpred p -> | PoT_pred p -> process_quantif ~loc p
(match Logic_normalizer.get_pred p with | PoT_term _ -> ())
| PoT_pred p -> process_quantif ~loc p
| PoT_term _ -> ())
| _ -> ())
| _ -> () | _ -> ()
in in
Annotations.iter_global (fun _ a -> gannot a) Annotations.iter_global (fun _ a -> gannot a)
......
...@@ -65,9 +65,10 @@ let handle_annotations env kf stmt = ...@@ -65,9 +65,10 @@ let handle_annotations env kf stmt =
| Some (t, measure_opt) -> | Some (t, measure_opt) ->
let env = Env.set_annotation_kind env Smart_stmt.Variant in let env = Env.set_annotation_kind env Smart_stmt.Variant in
let env = Env.push env in let env = Env.push env in
let lenv = Env.Local_vars.get env in (* There cannot be bound logical variables since we cannot write
Typing.type_term ~use_gmp_opt:true ~lenv t; loops inside logic functions or predicates, hence lenv is []*)
let ty = Typing.get_typ ~lenv t in Typing.type_term ~use_gmp_opt:true ~lenv:[] t;
let ty = Typing.get_typ ~lenv:[] t in
if Gmp_types.is_t ty then Error.not_yet "loop variant using GMP"; if Gmp_types.is_t ty then Error.not_yet "loop variant using GMP";
let e, _, env = !term_to_exp_ref ~adata:Assert.no_data kf env t in let e, _, env = !term_to_exp_ref ~adata:Assert.no_data kf env t in
let vi_old, e_old, env = let vi_old, e_old, env =
......
...@@ -1056,9 +1056,7 @@ and predicate_content_to_exp ~adata ?name kf env p = ...@@ -1056,9 +1056,7 @@ and predicate_content_to_exp ~adata ?name kf env p =
| Pvalid_function _ -> Env.not_yet env "\\valid_function" | Pvalid_function _ -> Env.not_yet env "\\valid_function"
| Prel(rel, t1, t2) -> | Prel(rel, t1, t2) ->
let ity = let ity =
Typing.get_integer_op_of_predicate Typing.get_integer_op_of_predicate ~lenv p
~lenv
p
in in
comparison_to_exp ~adata ~loc kf env ity (relation_to_binop rel) t1 t2 None comparison_to_exp ~adata ~loc kf env ity (relation_to_binop rel) t1 t2 None
| Pand(p1, p2) -> | Pand(p1, p2) ->
......
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