--  A reduction in each component of an iterated aggregate with static bounds: each
--  component is its own reduction's value (they once all read the last one's accumulator)
with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
   subtype Small is Integer range -100 .. 100;
   type Smalls is array (Positive range <>) of Small;
   type Values is array (Positive range <>) of Integer;
   X : constant Smalls := (3, 1, 4, 1, 5, 9);
   P : constant Values := [for I in 1 .. 3 => [for K in 0 .. 1 => X (2 * (I - 1) + K + 1)]'Reduce ("+", 0)];
begin
   for E of P loop
      Put (Integer'Image (E));
   end loop;
   New_Line;
end Main;
