
(/VERSIONCHECK 2) 

(DEFUN |POLYCATQ;univariate;FVF;1| (|f| |x| $)
  (SPADCALL (|POLYCATQ;P2UP| (SPADCALL |f| (QREFELT $ 11)) |x| $)
            (|POLYCATQ;P2UP| (SPADCALL |f| (QREFELT $ 12)) |x| $)
            (QREFELT $ 15))) 

(DEFUN |POLYCATQ;univariate;FV2Sup;2| (|f| |x| |modulus| $)
  (PROG (|bc|)
    (RETURN
     (SEQ
      (LETT |bc|
            (SPADCALL (|POLYCATQ;P2UP| (SPADCALL |f| (QREFELT $ 12)) |x| $)
                      |modulus| (|spadConstant| $ 17) (QREFELT $ 20))
            |POLYCATQ;univariate;FV2Sup;2|)
      (EXIT
       (COND ((QEQCAR |bc| 1) (|error| "univariate: denominator is 0 mod p"))
             ('T
              (SPADCALL
               (SPADCALL (|POLYCATQ;P2UP| (SPADCALL |f| (QREFELT $ 11)) |x| $)
                         (QCAR (QCDR |bc|)) (QREFELT $ 21))
               |modulus| (QREFELT $ 22))))))))) 

(DEFUN |POLYCATQ;multivariate;FVF;3| (|f| |x| $)
  (PROG (|v|)
    (RETURN
     (SEQ
      (LETT |v| (SPADCALL (SPADCALL |x| (QREFELT $ 24)) (QREFELT $ 25))
            |POLYCATQ;multivariate;FVF;3|)
      (EXIT
       (SPADCALL (SPADCALL (SPADCALL |f| (QREFELT $ 26)) |v| (QREFELT $ 27))
                 (SPADCALL (SPADCALL |f| (QREFELT $ 28)) |v| (QREFELT $ 27))
                 (QREFELT $ 29))))))) 

(DEFUN |POLYCATQ;mymerge| (|l| |m| $)
  (COND ((NULL |l|) |m|) ((NULL |m|) |l|)
        ((SPADCALL (|SPADfirst| |l|) (|SPADfirst| |m|) (QREFELT $ 32))
         (CONS (|SPADfirst| |l|) (|POLYCATQ;mymerge| (CDR |l|) (CDR |m|) $)))
        ((SPADCALL (|SPADfirst| |m|) (|SPADfirst| |l|) (QREFELT $ 33))
         (CONS (|SPADfirst| |l|) (|POLYCATQ;mymerge| (CDR |l|) |m| $)))
        ('T (CONS (|SPADfirst| |m|) (|POLYCATQ;mymerge| |l| (CDR |m|) $))))) 

(DEFUN |POLYCATQ;variables;FL;5| (|f| $)
  (|POLYCATQ;mymerge| (SPADCALL (SPADCALL |f| (QREFELT $ 11)) (QREFELT $ 35))
   (SPADCALL (SPADCALL |f| (QREFELT $ 12)) (QREFELT $ 35)) $)) 

(DEFUN |POLYCATQ;isPower;FU;6| (|f| $)
  (PROG (|r| |ur| #1=#:G1849 |den|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ
        (SEQ
         (LETT |den| (SPADCALL |f| (QREFELT $ 12))
               . #2=(|POLYCATQ;isPower;FU;6|))
         (EXIT
          (COND
           ((NULL (SPADCALL |den| (|spadConstant| $ 38) (QREFELT $ 39)))
            (PROGN
             (LETT #1#
                   (COND
                    ((NULL
                      (SPADCALL (SPADCALL |f| (QREFELT $ 11))
                                (|spadConstant| $ 38) (QREFELT $ 39)))
                     (CONS 1 "failed"))
                    ('T
                     (SEQ (LETT |ur| (SPADCALL |den| (QREFELT $ 42)) . #2#)
                          (EXIT
                           (COND
                            ((QEQCAR |ur| 1)
                             (CONS 0
                                   (CONS (SPADCALL |den| (QREFELT $ 25)) -1)))
                            (#3='T
                             (SEQ (LETT |r| (QCDR |ur|) . #2#)
                                  (EXIT
                                   (CONS 0
                                         (CONS
                                          (SPADCALL
                                           (SPADCALL (QCAR |r|) (QREFELT $ 24))
                                           (QREFELT $ 25))
                                          (- (QCDR |r|))))))))))))
                   . #2#)
             (GO #1#))))))
        (LETT |ur| (SPADCALL (SPADCALL |f| (QREFELT $ 11)) (QREFELT $ 42))
              . #2#)
        (EXIT
         (COND ((QEQCAR |ur| 1) (CONS 1 "failed"))
               (#3#
                (SEQ (LETT |r| (QCDR |ur|) . #2#)
                     (EXIT
                      (CONS 0
                            (CONS
                             (SPADCALL (SPADCALL (QCAR |r|) (QREFELT $ 24))
                                       (QREFELT $ 25))
                             (QCDR |r|))))))))))
      #1# (EXIT #1#))))) 

(DEFUN |POLYCATQ;isExpt;FU;7| (|f| $)
  (PROG (|r| |ur|)
    (RETURN
     (SEQ
      (LETT |ur| (SPADCALL (SPADCALL |f| (QREFELT $ 11)) (QREFELT $ 42))
            . #1=(|POLYCATQ;isExpt;FU;7|))
      (EXIT
       (COND
        ((QEQCAR |ur| 1)
         (COND
          ((SPADCALL (SPADCALL |f| (QREFELT $ 11)) (|spadConstant| $ 38)
                     (QREFELT $ 39))
           (SEQ
            (LETT |ur| (SPADCALL (SPADCALL |f| (QREFELT $ 12)) (QREFELT $ 42))
                  . #1#)
            (EXIT
             (COND ((QEQCAR |ur| 1) (CONS 1 "failed"))
                   (#2='T
                    (SEQ (LETT |r| (QCDR |ur|) . #1#)
                         (EXIT (CONS 0 (CONS (QCAR |r|) (- (QCDR |r|)))))))))))
          (#2# (CONS 1 "failed"))))
        (#2#
         (SEQ (LETT |r| (QCDR |ur|) . #1#)
              (EXIT
               (COND
                ((SPADCALL (SPADCALL |f| (QREFELT $ 12)) (|spadConstant| $ 38)
                           (QREFELT $ 39))
                 (CONS 0 (CONS (QCAR |r|) (QCDR |r|))))
                (#2# (CONS 1 "failed")))))))))))) 

(DEFUN |POLYCATQ;isTimes;FU;8| (|f| $)
  (PROG (|d| |den| |l| #1=#:G1898 |x| #2=#:G1897 |t| |num|)
    (RETURN
     (SEQ
      (LETT |t|
            (SPADCALL
             (LETT |num| (SPADCALL |f| (QREFELT $ 11))
                   . #3=(|POLYCATQ;isTimes;FU;8|))
             (QREFELT $ 50))
            . #3#)
      (LETT |l|
            (COND ((QEQCAR |t| 1) (CONS 1 "failed"))
                  (#4='T
                   (CONS 0
                         (PROGN
                          (LETT #2# NIL . #3#)
                          (SEQ (LETT |x| NIL . #3#) (LETT #1# (QCDR |t|) . #3#)
                               G190
                               (COND
                                ((OR (ATOM #1#)
                                     (PROGN (LETT |x| (CAR #1#) . #3#) NIL))
                                 (GO G191)))
                               (SEQ
                                (EXIT
                                 (LETT #2#
                                       (CONS (SPADCALL |x| (QREFELT $ 25)) #2#)
                                       . #3#)))
                               (LETT #1# (CDR #1#) . #3#) (GO G190) G191
                               (EXIT (NREVERSE0 #2#)))))))
            . #3#)
      (LETT |den| (SPADCALL |f| (QREFELT $ 12)) . #3#)
      (EXIT
       (COND ((SPADCALL |den| (|spadConstant| $ 38) (QREFELT $ 39)) |l|)
             ((SPADCALL |num| (|spadConstant| $ 38) (QREFELT $ 39))
              (CONS 1 "failed"))
             (#4#
              (SEQ
               (LETT |d|
                     (SPADCALL (SPADCALL |den| (QREFELT $ 25)) (QREFELT $ 51))
                     . #3#)
               (EXIT
                (COND
                 ((QEQCAR |l| 1)
                  (CONS 0 (LIST (SPADCALL |num| (QREFELT $ 25)) |d|)))
                 (#4#
                  (CONS 0 (SPADCALL (QCDR |l|) |d| (QREFELT $ 53)))))))))))))) 

(DEFUN |POLYCATQ;isPlus;FU;9| (|f| $)
  (PROG (#1=#:G1910 |x| #2=#:G1909 |s|)
    (RETURN
     (SEQ
      (COND
       ((NULL
         (SPADCALL (SPADCALL |f| (QREFELT $ 12)) (|spadConstant| $ 38)
                   (QREFELT $ 39)))
        (CONS 1 "failed"))
       ('T
        (SEQ
         (LETT |s| (SPADCALL (SPADCALL |f| (QREFELT $ 11)) (QREFELT $ 56))
               . #3=(|POLYCATQ;isPlus;FU;9|))
         (EXIT
          (COND ((QEQCAR |s| 1) (CONS 1 "failed"))
                ('T
                 (CONS 0
                       (PROGN
                        (LETT #2# NIL . #3#)
                        (SEQ (LETT |x| NIL . #3#) (LETT #1# (QCDR |s|) . #3#)
                             G190
                             (COND
                              ((OR (ATOM #1#)
                                   (PROGN (LETT |x| (CAR #1#) . #3#) NIL))
                               (GO G191)))
                             (SEQ
                              (EXIT
                               (LETT #2#
                                     (CONS (SPADCALL |x| (QREFELT $ 25)) #2#)
                                     . #3#)))
                             (LETT #1# (CDR #1#) . #3#) (GO G190) G191
                             (EXIT (NREVERSE0 #2#))))))))))))))) 

(DEFUN |POLYCATQ;mainVariable;FU;10| (|f| $)
  (PROG (|b| |a|)
    (RETURN
     (SEQ
      (LETT |a| (SPADCALL (SPADCALL |f| (QREFELT $ 11)) (QREFELT $ 59))
            . #1=(|POLYCATQ;mainVariable;FU;10|))
      (LETT |b| (SPADCALL (SPADCALL |f| (QREFELT $ 12)) (QREFELT $ 59)) . #1#)
      (EXIT
       (COND ((QEQCAR |b| 1) |a|) ((QEQCAR |a| 1) |b|)
             ('T (CONS 0 (SPADCALL (QCDR |a|) (QCDR |b|) (QREFELT $ 60)))))))))) 

(DEFUN |POLYCATQ;P2UP| (|p| |x| $)
  (SPADCALL (ELT $ 25) (SPADCALL |p| |x| (QREFELT $ 63)) (QREFELT $ 67))) 

(DEFUN |PolynomialCategoryQuotientFunctions| (&REST #1=#:G1921)
  (PROG ()
    (RETURN
     (PROG (#2=#:G1922)
       (RETURN
        (COND
         ((LETT #2#
                (|lassocShiftWithFunction| (|devaluateList| #1#)
                                           (HGET |$ConstructorCache|
                                                 '|PolynomialCategoryQuotientFunctions|)
                                           '|domainEqualList|)
                . #3=(|PolynomialCategoryQuotientFunctions|))
          (|CDRwithIncrement| #2#))
         ('T
          (UNWIND-PROTECT
              (PROG1
                  (APPLY (|function| |PolynomialCategoryQuotientFunctions;|)
                         #1#)
                (LETT #2# T . #3#))
            (COND
             ((NOT #2#)
              (HREM |$ConstructorCache|
                    '|PolynomialCategoryQuotientFunctions|))))))))))) 

(DEFUN |PolynomialCategoryQuotientFunctions;| (|#1| |#2| |#3| |#4| |#5|)
  (PROG (|pv$| $ |dv$| DV$5 DV$4 DV$3 DV$2 DV$1)
    (RETURN
     (PROGN
      (LETT DV$1 (|devaluate| |#1|)
            . #1=(|PolynomialCategoryQuotientFunctions|))
      (LETT DV$2 (|devaluate| |#2|) . #1#)
      (LETT DV$3 (|devaluate| |#3|) . #1#)
      (LETT DV$4 (|devaluate| |#4|) . #1#)
      (LETT DV$5 (|devaluate| |#5|) . #1#)
      (LETT |dv$|
            (LIST '|PolynomialCategoryQuotientFunctions| DV$1 DV$2 DV$3 DV$4
                  DV$5)
            . #1#)
      (LETT $ (GETREFV 68) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#))
      (|haddProp| |$ConstructorCache| '|PolynomialCategoryQuotientFunctions|
                  (LIST DV$1 DV$2 DV$3 DV$4 DV$5) (CONS 1 $))
      (|stuffDomainSlots| $)
      (QSETREFV $ 6 |#1|)
      (QSETREFV $ 7 |#2|)
      (QSETREFV $ 8 |#3|)
      (QSETREFV $ 9 |#4|)
      (QSETREFV $ 10 |#5|)
      $)))) 

(MAKEPROP '|PolynomialCategoryQuotientFunctions| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
              (|local| |#3|) (|local| |#4|) (|local| |#5|) (0 . |numer|)
              (5 . |denom|) (|SparseUnivariatePolynomial| 10) (|Fraction| 13)
              (10 . /) |POLYCATQ;univariate;FVF;1| (16 . |One|)
              (|Record| (|:| |coef1| $) (|:| |coef2| $)) (|Union| 18 '"failed")
              (20 . |extendedEuclidean|) (27 . *) (33 . |rem|)
              |POLYCATQ;univariate;FV2Sup;2| (39 . |coerce|) (44 . |coerce|)
              (49 . |numer|) (54 . |elt|) (60 . |denom|) (65 . /)
              |POLYCATQ;multivariate;FVF;3| (|Boolean|) (71 . =) (77 . <)
              (|List| 7) (83 . |variables|) |POLYCATQ;variables;FL;5|
              (88 . |One|) (92 . |One|) (96 . =)
              (|Record| (|:| |var| 7) (|:| |exponent| (|NonNegativeInteger|)))
              (|Union| 40 '#1="failed") (102 . |isExpt|)
              (|Record| (|:| |val| 10) (|:| |exponent| (|Integer|)))
              (|Union| 43 '"failed") |POLYCATQ;isPower;FU;6|
              (|Record| (|:| |var| 7) (|:| |exponent| (|Integer|)))
              (|Union| 46 '"failed") |POLYCATQ;isExpt;FU;7|
              (|Union| (|List| $) '#1#) (107 . |isTimes|) (112 . |inv|)
              (|List| 10) (117 . |concat!|) (|Union| 52 '"failed")
              |POLYCATQ;isTimes;FU;8| (123 . |isPlus|) |POLYCATQ;isPlus;FU;9|
              (|Union| 7 '#1#) (128 . |mainVariable|) (133 . |max|)
              |POLYCATQ;mainVariable;FU;10| (|SparseUnivariatePolynomial| $)
              (139 . |univariate|) (|Mapping| 10 9)
              (|SparseUnivariatePolynomial| 9)
              (|SparseUnivariatePolynomialFunctions2| 9 10) (145 . |map|))
           '#(|variables| 151 |univariate| 156 |multivariate| 169
              |mainVariable| 175 |isTimes| 180 |isPower| 185 |isPlus| 190
              |isExpt| 195)
           'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 67
                                                 '(1 10 9 0 11 1 10 9 0 12 2 14
                                                   0 13 13 15 0 13 0 17 3 13 19
                                                   0 0 0 20 2 13 0 0 0 21 2 13
                                                   0 0 0 22 1 9 0 7 24 1 10 0 9
                                                   25 1 14 13 0 26 2 13 10 0 10
                                                   27 1 14 13 0 28 2 10 0 0 0
                                                   29 2 7 31 0 0 32 2 7 31 0 0
                                                   33 1 9 34 0 35 0 8 0 37 0 9
                                                   0 38 2 9 31 0 0 39 1 9 41 0
                                                   42 1 9 49 0 50 1 10 0 0 51 2
                                                   52 0 0 10 53 1 9 49 0 56 1 9
                                                   58 0 59 2 7 0 0 0 60 2 9 62
                                                   0 7 63 2 66 13 64 65 67 1 0
                                                   34 10 36 2 0 14 10 7 16 3 0
                                                   13 10 7 13 23 2 0 10 14 7 30
                                                   1 0 58 10 61 1 0 54 10 55 1
                                                   0 44 10 45 1 0 54 10 57 1 0
                                                   47 10 48)))))
           '|lookupComplete|)) 
