DEFINITION Pascaline;

  TYPE
    Register = RECORD (* регистры машины *)
                 ind1*   : SHORTINT; 
                 ind2*   : SHORTINT; 
                 int*    : LONGINT;  
                 result* : LONGINT;  
               END;
  VAR
    r*              : Register;  
    sOn-           : BOOLEAN;   
    sBadIndex-      : BOOLEAN;   
    sPrimeIsEmpty-  : BOOLEAN;   

(* —- команды машины *)

  PROCEDURE On;  
  PROCEDURE Off; 

  PROCEDURE C;  (* C(i,j) - вычисление бин. коэфф. *)
  PROCEDURE F;  (* F(i)   - i-e число Фибоначчи   *)

  PROCEDURE InitPrime;    
  PROCEDURE FirstPrime;   
  PROCEDURE NextPrime;    
  PROCEDURE CountPrime;   

(* —- настройка машины *)

  TYPE
    ProcType1 = PROCEDURE (i: SHORTINT; j: SHORTINT):
LONGINT;
    ProcType2 = PROCEDURE (i: SHORTINT): LONGINT;

  VAR 
    PascalTriangle* : ProcType1;  
    Fibonacci*      : ProcType2;  

  PROCEDURE PascalTriangle0 (i: SHORTINT; j: SHORTINT):
LONGINT;
  PROCEDURE PascalTriangle1 (i: SHORTINT; j: SHORTINT):
LONGINT;
  PROCEDURE PascalTriangle2 (i: SHORTINT; j: SHORTINT):
LONGINT;

  PROCEDURE Fibonacci0 (i: SHORTINT): LONGINT;
  PROCEDURE Fibonacci1 (i: SHORTINT): LONGINT;
  PROCEDURE Fibonacci2 (i: SHORTINT): LONGINT;
  PROCEDURE Fibonacci3 (i: SHORTINT): LONGINT;
  PROCEDURE Fibonacci4 (i: SHORTINT): LONGINT;

END Pascaline.