Program ConfArr5;


Var
  O: array [ 1..4 ] of Boolean = ( false, true, true, false );
  K: packed array [ 1..4 ] of Boolean;


Procedure Foo ( x: array [ i..j: Integer ] of Boolean;
                Var y: packed array [ k..l: Integer ] of Boolean );

begin (* Foo *)
  Pack ( x, k, y );
{
  writeln ( 'x: ', PtrCard ( @x ), ' ', x [ 1 ], ' ', x [ 2 ], ' ', x [ 3 ], ' ', x [ 4 ] );
  writeln ( 'y: ', PtrCard ( @y ), ' ', y [ 1 ], ' ', y [ 2 ], ' ', y [ 3 ], ' ', y [ 4 ] );
}
end (* Foo *);


Procedure Bar ( x: packed array [ i..j: Integer ] of Boolean;
                Var y: array [ k..l: Integer ] of Boolean );

begin (* Bar *)
  Unpack ( x, y, k );
end (* Bar *);


begin
  Foo ( O, K );
  if not K [ 1 ] and K [ 2 ] and K [ 3 ] and not K [ 4 ] then
    begin
      Bar ( K, O );
      if not O [ 1 ] and O [ 2 ] and O [ 3 ] and not O [ 4 ] then
        writeln ( 'OK' )
      else
        writeln ( 'failed (Bar) ', O [ 1 ], ' ', O [ 2 ], ' ', O [ 3 ], ' ', O [ 4 ] );
    end (* if *)
  else
    writeln ( 'failed (K: ', PtrCard ( @K ), ' ', K [ 1 ], ' ', K [ 2 ], ' ', K [ 3 ], ' ', K [ 4 ], ')' );
end.
