--  `for E of M` over every component of a matrix, the last index fastest, and quantifiers
--  over every dimension (T32a)
with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
   subtype Small is Integer range -100 .. 100;
   type Matrix is array (Positive range <>, Positive range <>) of Small;
   function Positive_All (M : Matrix) return Boolean is (for all E of M => E > 0);
   function Has_Zero (M : Matrix) return Boolean is (for some E of M => E = 0);
   function Count (M : Matrix) return Natural
     with Pre => M'Length (1) <= 100 and M'Length (2) <= 100
   is
      N : Natural := 0;
   begin
      for E of M loop
         if E > 2 and N < 10_000 then
            N := N + 1;
         end if;
      end loop;
      return N;
   end Count;
   procedure Bump (M : in out Matrix) is
   begin
      for E of M loop
         if E < 100 then
            E := E + 1;
         end if;
      end loop;
   end Bump;
   P : Matrix := ((1, 2, 3), (4, 5, 0));
begin
   Put_Line (Boolean'Image (Positive_All (P)) & Boolean'Image (Has_Zero (P)) & Integer'Image (Count (P)));
   Bump (P);
   for E of P loop
      Put (Integer'Image (E));
   end loop;
   New_Line;
   Put_Line (Boolean'Image (Positive_All (P)) & Boolean'Image (Has_Zero (P)) & Integer'Image (Count (P)));
end Main;
