with Ada.Synchronous_Task_Control; use Ada.Synchronous_Task_Control;
with Ada.Text_IO; use Ada.Text_IO;

--  A default is evaluated for each component (RM 3.3.1(18/2)): each suspension object of an
--  array and of an array of arrays has a lock of its own, so setting one leaves the others
--  false
procedure Main is
   type Row is array (1 .. 3) of Suspension_Object;
   type Grid is array (1 .. 2) of Row;

   Flags : array (1 .. 3) of Suspension_Object;
   Cells : Grid;
begin
   Set_True (Flags (3));
   Set_True (Cells (2) (3));
   declare
      A : constant Boolean := Current_State (Flags (1));
      B : constant Boolean := Current_State (Flags (3));
      C : constant Boolean := Current_State (Cells (1) (3));
      D : constant Boolean := Current_State (Cells (2) (1));
      E : constant Boolean := Current_State (Cells (2) (3));
   begin
      Put_Line (Boolean'Image (A) & " " & Boolean'Image (B));
      Put_Line (Boolean'Image (C) & " " & Boolean'Image (D) & " " & Boolean'Image (E));
   end;
end Main;
