--  File: typeTest.adb
--
--  Description:
--
--  Check type equivalence rules

with Text_IO; use Text_IO;
procedure TypeTest is

     package Int_IO is new Integer_IO(INTEGER); use Int_IO;

     -- declare types
     type Vector is array(1..10) of Integer;
     type Matrix is array(1..10,1..10) of Integer;
     type Matrix1 is array(1..10) of Vector;
     type Matrix2 is array(1..10) of Vector;

     type Studenttype1 is
       record
          Lastname  : String(1..20);
          Phonenum  : Integer;
          Gradyear  : Integer;
          Coursenums: Matrix;
       end record;

     type Studenttype2 is
       record
          Lasttname : String(1..20);
          Phonenum  : Integer;
          Gradyear  : Integer;
          Coursenums: Matrix;
       end record;

     type Spointer1 is access Studenttype1;
     type Spointer2 is access Studenttype1;
     type Spointer3 is new Spointer1;

     type Days is range 1..31;
     subtype Daynumber is Integer range 1..31;

     -- declare variables
     P, Q : Spointer1;
     T, U : Spointer2;
     V, W : Spointer3;

     S, R : Studenttype1;
     M, N : Studenttype2;

     C, D : Matrix1;
     A, B : Matrix2;
     G, H : Matrix;
     J, K : Vector;
     E, F : array(1..10) of Integer;

     AA, BB : Days;
     CC, DD : Daynumber;
     EE, FF : Integer;

begin  --Main Program Begins Here

     P := Q;
     T := U;
     V := W;

     S := R;
     M := N;

     C := D;
     A := B;
     G := H;
     J := K;

     AA := BB;
     CC := DD;
     EE := FF;

end TypeTest;

