--  Parameters with relaxed initialisation (SPARK RM 6.10): of a relaxed type, or named by
--  the subprogram's aspect; each call passes the parameter's initialisation shadow, so the
--  caller knows which parts the callee set, and an actual without one is checked wholly
--  initialised after the call.
with Ada.Text_IO;
procedure Main is
   type Pair is record
      L, R : Integer;
   end record with Relaxed_Initialization;
   type Plain is record
      L, R : Integer;
   end record;
   procedure Init_Left (P : out Pair)
     with Post => P.L'Initialized and then P.L = 1
   is
   begin
      P.L := 1;
   end Init_Left;
   procedure Init_Both (P : out Plain)
     with Relaxed_Initialization => P, Post => P'Initialized and then P.L = 3 and then P.R = 4
   is
   begin
      P.L := 3;
      P.R := 4;
   end Init_Both;
   Q : Pair;
   S : Plain;
begin
   Init_Left (Q);
   Q.R := 2;
   Init_Both (S);
   Ada.Text_IO.Put_Line (Integer'Image (Q.L + Q.R) & Integer'Image (S.L + S.R));
end Main;
