package Counters is
   type Counter is private;
   function Next (C : Counter) return Counter
     with Pre => Value (C) < Limit, Post => Value (Next'Result) = Value (C) + 1;
   function Value (C : Counter) return Natural;
   Limit : constant := 1000;
   function Zero return Counter with Post => Value (Zero'Result) = 0;
private
   type Counter is record
      N : Natural := 0;
   end record;
   function Next (C : Counter) return Counter is ((N => C.N + 1));
   function Value (C : Counter) return Natural is (C.N);
   function Zero return Counter is ((N => 0));
end Counters;
