;;; -*- Mode: Lisp; Package: Macsyma -*-
;;; Translated code for LMIVAX::MAX$DISK:[SHARE2]LRATS.MC;1
;;; Written on 9/15/1984 22:43:46, from MACSYMA 302
;;; Translated for LPH

;;; TRANSL-AUTOLOAD version NIL
;;; TRANSS version 87 TRANSL version 1157 TRUTIL version 27
;;; TRANS1 version 108 TRANS2 version 39 TRANS3 version 50
;;; TRANS4 version 29 TRANS5 version 26 TRANSF version NIL
;;; TROPER version 15 TRPRED version 6 MTAGS version NIL
;;; MDEFUN version 58 TRANSQ version 88 FCALL version 40
;;; ACALL version 70 TRDATA version 68 MCOMPI version 146
;;; TRMODE version 73 TRHOOK version NIL
(eval-when (compile eval)
      (setq *infile-name-key*
	          (namestring (truename '#.standard-input))))

(eval-when (compile)
   (setq $tr_semicompile 'NIL)
   (setq forms-to-compile-queue ()))

(comment "MAX$DISK:[SHARE2]LRATS.MC;1")

;;; General declarations required for translated MACSYMA code.

(DECLARE
  (SPECIAL $DUM $PIECE $INFLAG $PARTSWITCH $FULLRATSUBSTFLAG $MESSLRATS2))

(DECLARE (SPECIAL $MESSLRATS2))

(DECLARE (SPECIAL $FULLRATSUBSTFLAG))

(DEFMTRFUN-EXTERNAL ($LRATSUBST $ANY MDEFINE NIL NIL))

(DEF-MTRVAR $DUM '$DUM 1)

(DEFMTRFUN-EXTERNAL ($LRATSUBST1 $ANY MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($FULLRATSUBST1 $ANY MDEFINE NIL NIL))

(DEFMTRFUN-EXTERNAL ($FULLRATSUBST $ANY MDEFINE T NIL))


(SIMPLIFY (MFUNCTION-CALL $PUT '$LRATS 3 '$DIAGEVAL_VERSION))

(MEVAL* '(($MODEDECLARE) $MESSLRATS2 $ANY))

(MEVAL* '(($DECLARE) $MESSLRATS2 $SPECIAL))

(DEF-MTRVAR $MESSLRATS2 '|&Invalid argument to FULLRATSUBST:|)

(MEVAL* '(($MODEDECLARE) $FULLRATSUBSTFLAG $BOOLEAN))

(MEVAL* '(($DECLARE) $FULLRATSUBSTFLAG $SPECIAL))

(DEFPROP $FULLRATSUBSTFLAG ASSIGN-MODE-CHECK ASSIGN)

(DEF-MTRVAR $FULLRATSUBSTFLAG NIL)

(DEFPROP $LRATSUBST T TRANSLATED)

(ADD2LNC '$LRATSUBST $PROPS)

(DEFMTRFUN
 ($LRATSUBST $ANY MDEFINE NIL NIL) ($LISTOFEQNS $EXP) NIL
 ((LAMBDA ($PARTSWITCH $INFLAG $PIECE)
    NIL
    (COND
      ((NOT (MFUNCTION-CALL $LISTP $LISTOFEQNS))
	 (COND
	   ((LIKE (SIMPLIFY (MFUNCTION-CALL $INPART $LISTOFEQNS 0)) '&=)
	      (SETQ $LISTOFEQNS (LIST '(MLIST) $LISTOFEQNS)))
	   ((LIKE (TRD-MSYMEVAL $FULLRATSUBSTFLAG NIL) T)
	      (SIMPLIFY (MFUNCTION-CALL
			  $ERROR (TRD-MSYMEVAL $MESSLRATS2 '$MESSLRATS2)
			  (LIST '(MLIST) $LISTOFEQNS $EXP))))
	   (T (SIMPLIFY
		(MFUNCTION-CALL $ERROR '|&Invalid argument to LRATSUBST:|
				(LIST '(MLIST) $LISTOFEQNS $EXP)))))))
    (DO (($IDUM) (MDO (CDR $LISTOFEQNS) (CDR MDO))) ((NULL MDO) '$DONE)
      (SETQ $IDUM (CAR MDO))
      (COND
	((NOT (LIKE (SIMPLIFY (MFUNCTION-CALL $INPART $IDUM 0)) '&=))
	   (COND
	     ((LIKE (TRD-MSYMEVAL $FULLRATSUBSTFLAG NIL) T)
		(SIMPLIFY (MFUNCTION-CALL
			    $ERROR (TRD-MSYMEVAL $MESSLRATS2 '$MESSLRATS2)
			    (LIST '(MLIST) $LISTOFEQNS $EXP))))
	     (T (SIMPLIFY
		  (MFUNCTION-CALL $ERROR '|&Invalid argument to LRATSUBST:|
				  (LIST '(MLIST) $LISTOFEQNS $EXP))))))))
    (SIMPLIFY (MFUNCTION-CALL $LRATSUBST1 $LISTOFEQNS $EXP)))
  T T '$PIECE))

(DEFPROP $LRATSUBST1 T TRANSLATED)

(ADD2LNC '$LRATSUBST1 $PROPS)

(DEFMTRFUN
  ($LRATSUBST1 $ANY MDEFINE NIL NIL) ($LISTOFEQNS $EXP) NIL
  ((LAMBDA ($DUM)
     NIL
     NIL
     (COND
       ((AND (LIKE (TRD-MSYMEVAL $FULLRATSUBSTFLAG NIL) T)
	     (NOT (LIKE (TRD-MSYMEVAL $DUM '$DUM) $EXP)))
	  (SIMPLIFY (MFUNCTION-CALL
		      $LRATSUBST1 $LISTOFEQNS (TRD-MSYMEVAL $DUM '$DUM))))
       ((NOT (LIKE (TRD-MSYMEVAL $DUM '$DUM) $EXP))
	  (TRD-MSYMEVAL $DUM '$DUM))
       (T $EXP)))
   (COND
     ((LIKE $LISTOFEQNS '((MLIST))) $EXP)
     ((LIKE (SIMPLIFY (MFUNCTION-CALL $REST $LISTOFEQNS)) '((MLIST)))
	(SIMPLIFY
	  (MFUNCTION-CALL
	    $RATSUBST (SIMPLIFY (MFUNCTION-CALL $INPART $LISTOFEQNS 1 2))
	    (SIMPLIFY (MFUNCTION-CALL $INPART $LISTOFEQNS 1 1)) $EXP)))
     (T
       (SIMPLIFY
	 (MFUNCTION-CALL
	   $LRATSUBST1 (SIMPLIFY (MFUNCTION-CALL $REST $LISTOFEQNS))
	   (COND ((LIKE (TRD-MSYMEVAL $FULLRATSUBSTFLAG NIL) T)
		    (SIMPLIFY
		      (MFUNCTION-CALL
			$FULLRATSUBST1
			(SIMPLIFY (MFUNCTION-CALL $INPART $LISTOFEQNS 1 2))
			(SIMPLIFY (MFUNCTION-CALL $INPART $LISTOFEQNS 1 1))
			$EXP)))
		 (T (SIMPLIFY
		      (MFUNCTION-CALL
			$RATSUBST
			(SIMPLIFY (MFUNCTION-CALL $INPART $LISTOFEQNS 1 2))
			(SIMPLIFY (MFUNCTION-CALL $INPART $LISTOFEQNS 1 1))
			$EXP))))))))))

(DEFPROP $FULLRATSUBST1 T TRANSLATED)

(ADD2LNC '$FULLRATSUBST1 $PROPS)

(DEFMTRFUN
  ($FULLRATSUBST1 $ANY MDEFINE NIL NIL) ($SUBSTEXP $FOREXP $EXP) NIL
  ((LAMBDA ($DUM)
     NIL
     (COND ((LIKE $DUM $EXP) $EXP)
	   (T (SIMPLIFY
		(MFUNCTION-CALL $FULLRATSUBST1 $SUBSTEXP $FOREXP $DUM)))))
   (SIMPLIFY (MFUNCTION-CALL $RATSUBST $SUBSTEXP $FOREXP $EXP))))

(DEFPROP $FULLRATSUBST T TRANSLATED)

(ADD2LNC '$FULLRATSUBST $PROPS)

(DEFMTRFUN
 ($FULLRATSUBST $ANY MDEFINE T NIL) ($ARGLIST) NIL
 ((LAMBDA
     ($FULLRATSUBSTFLAG $LARGLISTDUM $FARGLIST $PARTSWITCH $INFLAG $PIECE)
    NIL
    (ASSIGN-MODE-CHECK '$FULLRATSUBSTFLAG $FULLRATSUBSTFLAG)
    (COND
      ((LIKE $LARGLISTDUM 2)
	 (COND
	   ((OR (MFUNCTION-CALL
		  $LISTP (SETQ $FARGLIST (SIMPLIFY ($FIRST $ARGLIST))))
		(LIKE (SIMPLIFY (MFUNCTION-CALL $INPART $FARGLIST 0)) '&=))
	      (SIMPLIFY (MFUNCTION-CALL
			  $LRATSUBST $FARGLIST
			  (SIMPLIFY (MFUNCTION-CALL $LAST $ARGLIST)))))
	   (T (SIMPLIFY (MFUNCTION-CALL
			  $ERROR (TRD-MSYMEVAL $MESSLRATS2 '$MESSLRATS2)
			  $ARGLIST)))))
      ((LIKE $LARGLISTDUM 3)
	 (SIMPLIFY (MAPPLY-TR '$FULLRATSUBST1 $ARGLIST)))
      (T (SIMPLIFY
	   (MFUNCTION-CALL
	     $ERROR (TRD-MSYMEVAL $MESSLRATS2 '$MESSLRATS2) $ARGLIST)))))
  T (MFUNCTION-CALL $LENGTH $ARGLIST) '$FARGLIST T T '$PIECE))

(compile-forms-to-compile-queue)

