--  Access-to-subprogram types whose `Global` states what the subprograms they designate may
--  use: Bump and Peek use Count and Limit, as Action and
--  Reader let them; a call through the value is a call of the profile, Global and Post.
package Counters is
   Count : Natural := 0;
   Limit : Natural := 1000;
   type Action is access procedure (Step : Natural)
     with Global => (Input => Limit, In_Out => Count),
          Post => Count >= Count'Old;
   type Reader is access function return Natural
     with Global => (Input => Count);
   procedure Bump (Step : Natural)
     with Global => (Input => Limit, In_Out => Count),
          Post => Count >= Count'Old;
   function Peek return Natural is (Count) with Global => (Input => Count);
   procedure Apply (A : not null Action; Step : Natural)
     with Global => (Input => Limit, In_Out => Count);
   function Read (R : not null Reader) return Natural is (R.all)
     with Global => (Input => Count);
end Counters;
