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