--  `Global` naming an enclosing subprogram's object (SPARK RM 6.1.4, SPARK-04, D199), with
--  `Depends`: the nested subprogram uses it as its own parameter.
with Ada.Text_IO;
procedure Main is
   Count : Natural := 0;
   procedure Inc
     with Global => (In_Out => Count), Depends => (Count => Count),
          Pre => Count < 1000, Post => Count = Count'Old + 1
   is
   begin
      Count := Count + 1;
   end Inc;
begin
   Inc;
   Ada.Text_IO.Put_Line (Natural'Image (Count));
end Main;
