let compute cfg annots =
Wp_parameters.feedback ~level:3
"[wp-cfg] start computing with the strategy for %a"
WpAnnot.pp_strategy_info annots.WpAnnot.info;
if annots.WpAnnot.has_prop_goal || annots.WpAnnot.has_asgn_goal then
begin
let kf = Cil2cfg.cfg_kf cfg in
let wenv = W.new_env kf in
let keep = if Wp_parameters.Dot.get () then true else false in
let he = R.empty ~keep cfg in
let env = (kf, cfg, annots, he, wenv) in
if annots.WpAnnot.has_inv_prop <> []
|| WpAnnot.new_loop_computation annots.WpAnnot.info
then
begin
Wp_parameters.debug ~level:3 "[wp-cfg] start Pass1";
Cil2cfg.iter_edges (fun e -> ignore (get_wp_edge env e)) cfg ;
Wp_parameters.debug ~level:3 "[wp-cfg] end of Pass1";
end;
List.iter add_axiom annots.WpAnnot.global_axioms ;
R.change_mode he;
let goals = get_weakest_precondition cfg env in
let pp_cfg_edges_annot he fmt e =
try W.pretty fmt (R.find he e)
with Not_found -> Format.fprintf fmt "<released>"
in
let annot_cfg = pp_cfg_edges_annot he in
Wp_parameters.feedback ~level:3 "[wp-cfg] computing done.";
goals , annot_cfg
end
else
begin
Wp_parameters.feedback ~level:3
"[wp-cfg] no goal in this strategy : ignore.";
let annot_cfg fmt _e = Format.fprintf fmt "" in
[], annot_cfg
end