--  a matrix's value sliding into an object's bounds, in a declaration and an assignment (T32a)
with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
   type Matrix is array (Positive range <>, Positive range <>) of Integer;
   procedure Show (M : Matrix) is
   begin
      Put (Integer'Image (M'First (1)) & Integer'Image (M'First (2)) & ":");
      for I in M'Range (1) loop
         for J in M'Range (2) loop
            Put (Integer'Image (M (I, J)));
         end loop;
      end loop;
      New_Line;
   end Show;
   procedure Go (N : Positive) with Pre => N <= 5 is
      Src : constant Matrix (3 .. 4, 7 .. 9) := ((1, 2, 3), (4, 5, 6));
      M : Matrix (N .. N + 1, 1 .. 3) := Src;
      Other : Matrix (10 .. 11, 20 .. 22) := (others => (others => 9));
   begin
      Show (M);
      pragma Assert (M (N, 1) = 1 and M (N + 1, 3) = 6);
      M := Other;
      Show (M);
      Other := Src;
      Show (Other);
      pragma Assert (Other (11, 22) = 6);
   end Go;
begin
   Go (2);
end Main;
