let test_edge_loop_ok cfg strategy edge =
    debug "[test_edge_loop_ok] (%s strategy) for %a"
      (match strategy with None -> "without" | Some _ -> "with")
      Cil2cfg.pp_edge edge;
    let rec collect_edge_preds set e =
      let cut =
        match strategy with None ->  Cil2cfg.is_back_edge e
        | Some strategy -> 
            let e_annots = WpStrategy.get_annots strategy e in
            (WpStrategy.get_cut e_annots <> [])
      in
        if cut then () (* normal loop cut *)
        else if Cil2cfg.Eset.mem e set 
        then (* e is already in set : loop without cut ! *)
          raise (Stop e)
        else (* add e to set and continue with its preds *)
          let set = Cil2cfg.Eset.add e set in
          let preds = Cil2cfg.pred_e cfg (Cil2cfg.edge_src e) in
            List.iter (collect_edge_preds set) preds
    in
      try
        let _ = collect_edge_preds Cil2cfg.Eset.empty edge in 
          debug "[test_edge_loop_ok] ok.";
          true
      with Stop e ->
        begin
          debug "[test_edge_loop_ok] loop without cut detected at %a"
            Cil2cfg.pp_edge e;
          false
        end