let check_stmt_annots pred s acc =
  let check acc annot =
    match annot with
      | Before (AI (_, ({annot_content= AAssert (_, p, _) } as annot))) ->
          if Logic_utils.is_same_named_predicate p pred
          then begin
            let acc, added = add_annot annot acc in
              if added then
                R.debug "annot at stmt %d could be removed: %a"
                  s.sid !Ast_printer.d_code_annotation annot;
              acc
          end
          else acc
      | _ -> acc
  in
  List.fold_left check acc (Annotations.get_filter Logic_utils.is_assert s)