--  A function with Side_Effects (G7): it writes a global and an in out parameter, and is
--  called only as an assignment's or a declaration's value.
package Counters with SPARK_Mode is
   Count : Integer := 0;
   --  the next value: Count moves on by Step, and Step grows
   function Next (Step : in out Integer) return Integer
     with Side_Effects,
          Global => (In_Out => Count),
          Pre => Step in 0 .. 1000 and then Count in 0 .. 1_000_000,
          Post => Count = Count'Old + Step'Old and then Step = Step'Old + 1 and then Next'Result = Count;
end Counters;
