--  `D'Last` of a statically constrained array subtype is static, so it may be a choice beside
--  `others` (RM 4.9); string literals are the rows of a two-dimensional aggregate of
--  characters (RM 4.3.3(7)); a postcondition's `'Old` may name an enclosing loop's parameter,
--  known on entry (D262).
with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
   type D is array (1 .. 5) of Integer;
   Z : constant D := (D'Last => 3, D'First => 1, others => 0);
   type M is array (Positive range <>, Positive range <>) of Character;
   X : constant M := ("ab", "cd");
   G : Integer := 0;
   function F (K : Integer) return Integer is (K * 2) with Pre => K in 1 .. 3;
begin
   pragma Assert (Z (5) = 3 and Z (1) = 1 and Z (2) = 0);
   pragma Assert (X (2, 1) = 'c');
   for I in 1 .. 3 loop
      declare
         procedure Q with Global => (Output => G), Post => G = F (I)'Old is
         begin
            G := F (I);
         end Q;
      begin
         Q;
      end;
   end loop;
   Put_Line (Integer'Image (Z (5)) & " " & X (1, 2) & X (2, 2) & Integer'Image (G));
end Main;
