let get_global_annotations () =
  let rec do_g acc g =
    let source = Cil.source (Cil_datatype.Global_annotation.loc g) in
    match g with
    | Daxiomatic (_ax_name, globs,_) -> do_globs globs acc
    | Dfun_or_pred _ ->
        (* will be processed while translation is needed *) acc
    | Dtype _ ->
        (* will be processed while translation is needed *) acc
    | Dtype_annot (linfo,_) ->
        Wp_parameters.warning ~source
          "Type invariant not handled yet ('%s' ignored)"
          linfo.l_var_info.lv_name;
        acc
    | Dinvariant (linfo,_) ->
        Wp_parameters.warning ~source
          "Global invariant not handled yet ('%s' ignored)"
          linfo.l_var_info.lv_name;
        acc
    | Dlemma (name, is_axiom, labels, _, pred,_) ->
        if not is_axiom then
          Wp_parameters.warning ~once:true ~source
            "Proof obligation for property '%s' not generated." name ;
        add_glob_axiom name acc labels pred
  and do_globs globs acc =
    List.fold_left do_g acc globs
  in
  let globs = Globals.Annotations.get_all () in
  let globs = List.map (fun (g, _generated) -> g) globs in
  let axioms = do_globs globs [] in
  axioms