DEFINITION BasicTypes;

TYPE
  ANY = POINTER TO ANYDesc;
  ANYDesc = RECORD 
  END;
  COLLECTION = POINTER TO COLLECTIONDesc;
  COLLECTIONDesc = RECORD (ANYDesc) 
    PROCEDURE (c:COLLECTION) Add(x: ANY);
    PROCEDURE (c:COLLECTION) Remove(x: ANY);
    PROCEDURE (c:COLLECTION) nbElements(): LONGINT;
    PROCEDURE (c:COLLECTION) isEmpty(): BOOLEAN;
    PROCEDURE (c:COLLECTION) Do(p: DoProc; par: ANY);
  END;
  DoProc = PROCEDURE(x, par: ANY);
  COMPAREABLE = POINTER TO COMPAREABLEDesc;
  COMPAREABLEDesc = RECORD (ANYDesc) 
    PROCEDURE (a:COMPAREABLE) Compare(b: COMPAREABLE): LONGINT;
    PROCEDURE (a:COMPAREABLE) Equal(b: COMPAREABLE): BOOLEAN;
    PROCEDURE (a:COMPAREABLE) Less(b: COMPAREABLE): BOOLEAN;
    PROCEDURE (a:COMPAREABLE) LessOrEqual(b: COMPAREABLE): BOOLEAN;
    PROCEDURE (a:COMPAREABLE) Higher(b: COMPAREABLE): BOOLEAN;
    PROCEDURE (a:COMPAREABLE) HigherOrEqual(b: COMPAREABLE): BOOLEAN;
  END;
  GROUP = POINTER TO GROUPDesc;
  GROUPDesc = RECORD (COMPAREABLEDesc) 
    PROCEDURE (m:GROUP) Add(n: GROUP): GROUP;
    PROCEDURE (m:GROUP) Neg(): GROUP;
    PROCEDURE (m:GROUP) Sub(n: GROUP): GROUP;
    PROCEDURE (m:GROUP) Norm(): LONGREAL;
  END;
  RING = POINTER TO RINGDesc;
  RINGDesc = RECORD (GROUPDesc) 
    PROCEDURE (m:RING) Mul(n: RING): RING;
    PROCEDURE (m:RING) Sqr(): RING;
  END;
  FIELD = POINTER TO FIELDDesc;
  FIELDDesc = RECORD (RINGDesc) 
    PROCEDURE (m:FIELD) Inv(): FIELD;
    PROCEDURE (m:FIELD) InvAllowed(): BOOLEAN;
    PROCEDURE (m:FIELD) Div(n: FIELD): FIELD;
  END;
  DynString = POINTER TO ARRAY OF CHAR;


END BasicTypes.

