
(/VERSIONCHECK 2) 

(DEFUN |OREPCTO;times;2CAMC;1| (|x| |y| |sigma| |delta| $)
  (PROG (|z|)
    (RETURN
     (SEQ
      (COND ((SPADCALL |y| (QREFELT $ 9)) (|spadConstant| $ 10))
            ('T
             (SEQ
              (LETT |z| (|spadConstant| $ 10) . #1=(|OREPCTO;times;2CAMC;1|))
              (SEQ G190
                   (COND
                    ((NULL
                      (COND
                       ((SPADCALL |x| (|spadConstant| $ 10) (QREFELT $ 12))
                        'NIL)
                       ('T 'T)))
                     (GO G191)))
                   (SEQ
                    (LETT |z|
                          (SPADCALL |z|
                                    (|OREPCTO;termPoly|
                                     (SPADCALL |x| (QREFELT $ 13))
                                     (SPADCALL |x| (QREFELT $ 15)) |y| |sigma|
                                     |delta| $)
                                    (QREFELT $ 16))
                          . #1#)
                    (EXIT (LETT |x| (SPADCALL |x| (QREFELT $ 17)) . #1#)))
                   NIL (GO G190) G191 (EXIT NIL))
              (EXIT |z|)))))))) 

(DEFUN |OREPCTO;termPoly| (|a| |n| |y| |sigma| |delta| $)
  (PROG (|z| |b| |m| |n1| |u|)
    (RETURN
     (SEQ
      (COND ((SPADCALL |y| (QREFELT $ 9)) (|spadConstant| $ 10))
            (#1='T
             (SEQ
              (LETT |u| (SPADCALL |n| 1 (QREFELT $ 24))
                    . #2=(|OREPCTO;termPoly|))
              (EXIT
               (COND ((QEQCAR |u| 1) (SPADCALL |a| |y| (QREFELT $ 25)))
                     (#1#
                      (SEQ (LETT |n1| (QCDR |u|) . #2#)
                           (LETT |z| (|spadConstant| $ 10) . #2#)
                           (SEQ G190
                                (COND
                                 ((NULL
                                   (COND
                                    ((SPADCALL |y| (|spadConstant| $ 10)
                                               (QREFELT $ 12))
                                     'NIL)
                                    ('T 'T)))
                                  (GO G191)))
                                (SEQ
                                 (LETT |m| (SPADCALL |y| (QREFELT $ 15)) . #2#)
                                 (LETT |b| (SPADCALL |y| (QREFELT $ 13)) . #2#)
                                 (LETT |z|
                                       (SPADCALL
                                        (SPADCALL |z|
                                                  (|OREPCTO;termPoly| |a| |n1|
                                                   (SPADCALL
                                                    (SPADCALL |sigma| |b|
                                                              (QREFELT $ 26))
                                                    (+ |m| 1) (QREFELT $ 27))
                                                   |sigma| |delta| $)
                                                  (QREFELT $ 16))
                                        (|OREPCTO;termPoly| |a| |n1|
                                         (SPADCALL (SPADCALL |b| |delta|) |m|
                                                   (QREFELT $ 27))
                                         |sigma| |delta| $)
                                        (QREFELT $ 16))
                                       . #2#)
                                 (EXIT
                                  (LETT |y| (SPADCALL |y| (QREFELT $ 17))
                                        . #2#)))
                                NIL (GO G190) G191 (EXIT NIL))
                           (EXIT |z|)))))))))))) 

(DEFUN |OREPCTO;apply;C2RAMR;3| (|p| |c| |x| |sigma| |delta| $)
  (PROG (|xn| |w| #1=#:G692 |i|)
    (RETURN
     (SEQ (LETT |w| (|spadConstant| $ 11) . #2=(|OREPCTO;apply;C2RAMR;3|))
          (LETT |xn| |x| . #2#)
          (SEQ (LETT |i| 0 . #2#)
               (LETT #1# (SPADCALL |p| (QREFELT $ 15)) . #2#) G190
               (COND ((QSGREATERP |i| #1#) (GO G191)))
               (SEQ
                (LETT |w|
                      (SPADCALL |w|
                                (SPADCALL (SPADCALL |p| |i| (QREFELT $ 28))
                                          |xn| (QREFELT $ 29))
                                (QREFELT $ 30))
                      . #2#)
                (EXIT
                 (LETT |xn|
                       (SPADCALL
                        (SPADCALL |c| (SPADCALL |sigma| |xn| (QREFELT $ 26))
                                  (QREFELT $ 29))
                        (SPADCALL |xn| |delta|) (QREFELT $ 30))
                       . #2#)))
               (LETT |i| (QSADD1 |i|) . #2#) (GO G190) G191 (EXIT NIL))
          (EXIT |w|))))) 

(DEFUN |OREPCTO;localLeftDivide| (|a| |b| |sigma| |b1| $)
  (PROG (|qr| |q| #1=#:G699 |n| |m|)
    (RETURN
     (SEQ
      (COND
       ((SPADCALL |b| (QREFELT $ 9)) (|error| "leftDivide: division by 0"))
       (#2='T
        (SEQ
         (EXIT
          (SEQ
           (COND
            ((SPADCALL |a| (QREFELT $ 9))
             (EXIT (CONS (|spadConstant| $ 10) |a|)))
            (#2#
             (SEQ
              (LETT |n|
                    (SPADCALL (SPADCALL |a| (QREFELT $ 15))
                              (LETT |m| (SPADCALL |b| (QREFELT $ 15))
                                    . #3=(|OREPCTO;localLeftDivide|))
                              (QREFELT $ 24))
                    . #3#)
              (EXIT
               (COND
                ((QEQCAR |n| 1)
                 (PROGN
                  (LETT #1# (CONS (|spadConstant| $ 10) |a|) . #3#)
                  (GO #1#))))))))
           (LETT |q|
                 (SPADCALL
                  (SPADCALL (SPADCALL |sigma| (- |m|) (QREFELT $ 33))
                            (SPADCALL |b1| (SPADCALL |a| (QREFELT $ 13))
                                      (QREFELT $ 29))
                            (QREFELT $ 26))
                  (QCDR |n|) (QREFELT $ 27))
                 . #3#)
           (LETT |qr|
                 (|OREPCTO;localLeftDivide|
                  (SPADCALL |a| (SPADCALL |b| |q| (QREFELT $ 34))
                            (QREFELT $ 35))
                  |b| |sigma| |b1| $)
                 . #3#)
           (EXIT
            (CONS (SPADCALL |q| (QCAR |qr|) (QREFELT $ 16)) (QCDR |qr|)))))
         #1# (EXIT #1#)))))))) 

(DEFUN |OREPCTO;localRightDivide| (|a| |b| |sigma| |b1| $)
  (PROG (|qr| |q| #1=#:G708 |n| |m|)
    (RETURN
     (SEQ
      (COND
       ((SPADCALL |b| (QREFELT $ 9)) (|error| "rightDivide: division by 0"))
       (#2='T
        (SEQ
         (EXIT
          (SEQ
           (COND
            ((SPADCALL |a| (QREFELT $ 9))
             (EXIT (CONS (|spadConstant| $ 10) |a|)))
            (#2#
             (SEQ
              (LETT |n|
                    (SPADCALL (SPADCALL |a| (QREFELT $ 15))
                              (LETT |m| (SPADCALL |b| (QREFELT $ 15))
                                    . #3=(|OREPCTO;localRightDivide|))
                              (QREFELT $ 24))
                    . #3#)
              (EXIT
               (COND
                ((QEQCAR |n| 1)
                 (PROGN
                  (LETT #1# (CONS (|spadConstant| $ 10) |a|) . #3#)
                  (GO #1#))))))))
           (LETT |q|
                 (SPADCALL
                  (SPADCALL (SPADCALL |a| (QREFELT $ 13))
                            (SPADCALL
                             (SPADCALL |sigma| (QCDR |n|) (QREFELT $ 33)) |b1|
                             (QREFELT $ 26))
                            (QREFELT $ 29))
                  (QCDR |n|) (QREFELT $ 27))
                 . #3#)
           (LETT |qr|
                 (|OREPCTO;localRightDivide|
                  (SPADCALL |a| (SPADCALL |q| |b| (QREFELT $ 34))
                            (QREFELT $ 35))
                  |b| |sigma| |b1| $)
                 . #3#)
           (EXIT
            (CONS (SPADCALL |q| (QCAR |qr|) (QREFELT $ 16)) (QCDR |qr|)))))
         #1# (EXIT #1#)))))))) 

(DEFUN |OREPCTO;monicLeftDivide;2CAR;6| (|a| |b| |sigma| $)
  (PROG (#1=#:G713 |u|)
    (RETURN
     (COND
      ((SPADCALL
        (LETT |u| (SPADCALL |b| (QREFELT $ 13))
              . #2=(|OREPCTO;monicLeftDivide;2CAR;6|))
        (QREFELT $ 36))
       (|OREPCTO;localLeftDivide| |a| |b| |sigma|
        (PROG2
            (LETT #1# (SPADCALL |u| (QREFELT $ 37)) . #2#)
            (QCDR #1#)
          (|check-union| (QEQCAR #1# 0) (QREFELT $ 6) #1#))
        $))
      ('T (|error| "monicLeftDivide: divisor is not monic")))))) 

(DEFUN |OREPCTO;monicRightDivide;2CAR;7| (|a| |b| |sigma| $)
  (PROG (#1=#:G720 |u|)
    (RETURN
     (COND
      ((SPADCALL
        (LETT |u| (SPADCALL |b| (QREFELT $ 13))
              . #2=(|OREPCTO;monicRightDivide;2CAR;7|))
        (QREFELT $ 36))
       (|OREPCTO;localRightDivide| |a| |b| |sigma|
        (PROG2
            (LETT #1# (SPADCALL |u| (QREFELT $ 37)) . #2#)
            (QCDR #1#)
          (|check-union| (QEQCAR #1# 0) (QREFELT $ 6) #1#))
        $))
      ('T (|error| "monicRightDivide: divisor is not monic")))))) 

(DEFUN |OREPCTO;leftDivide;2CAR;8| (|a| |b| |sigma| $)
  (|OREPCTO;localLeftDivide| |a| |b| |sigma|
   (SPADCALL (SPADCALL |b| (QREFELT $ 13)) (QREFELT $ 41)) $)) 

(DEFUN |OREPCTO;rightDivide;2CAR;9| (|a| |b| |sigma| $)
  (|OREPCTO;localRightDivide| |a| |b| |sigma|
   (SPADCALL (SPADCALL |b| (QREFELT $ 13)) (QREFELT $ 41)) $)) 

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

(DEFUN |UnivariateSkewPolynomialCategoryOps;| (|#1| |#2|)
  (PROG (|pv$| $ |dv$| DV$2 DV$1)
    (RETURN
     (PROGN
      (LETT DV$1 (|devaluate| |#1|)
            . #1=(|UnivariateSkewPolynomialCategoryOps|))
      (LETT DV$2 (|devaluate| |#2|) . #1#)
      (LETT |dv$| (LIST '|UnivariateSkewPolynomialCategoryOps| DV$1 DV$2)
            . #1#)
      (LETT $ (GETREFV 44) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3
                (LETT |pv$|
                      (|buildPredVector| 0 0
                                         (LIST (|HasCategory| |#1| '(|Field|))
                                               (|HasCategory| |#1|
                                                              '(|IntegralDomain|))))
                      . #1#))
      (|haddProp| |$ConstructorCache| '|UnivariateSkewPolynomialCategoryOps|
                  (LIST DV$1 DV$2) (CONS 1 $))
      (|stuffDomainSlots| $)
      (QSETREFV $ 6 |#1|)
      (QSETREFV $ 7 |#2|)
      (COND
       ((|testBitVector| |pv$| 2)
        (PROGN
         (QSETREFV $ 39
                   (CONS (|dispatchFunction| |OREPCTO;monicLeftDivide;2CAR;6|)
                         $))
         (QSETREFV $ 40
                   (CONS (|dispatchFunction| |OREPCTO;monicRightDivide;2CAR;7|)
                         $)))))
      (COND
       ((|testBitVector| |pv$| 1)
        (PROGN
         (QSETREFV $ 42
                   (CONS (|dispatchFunction| |OREPCTO;leftDivide;2CAR;8|) $))
         (QSETREFV $ 43
                   (CONS (|dispatchFunction| |OREPCTO;rightDivide;2CAR;9|)
                         $)))))
      $)))) 

(MAKEPROP '|UnivariateSkewPolynomialCategoryOps| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|) (|Boolean|)
              (0 . |zero?|) (5 . |Zero|) (9 . |Zero|) (13 . =)
              (19 . |leadingCoefficient|) (|NonNegativeInteger|)
              (24 . |degree|) (29 . +) (35 . |reductum|) (|Automorphism| 6)
              (|Mapping| 6 6) |OREPCTO;times;2CAMC;1| (40 . |One|) (44 . |One|)
              (|Union| $ '"failed") (48 . |subtractIfCan|) (54 . *)
              (60 . |elt|) (66 . |monomial|) (72 . |coefficient|) (78 . *)
              (84 . +) |OREPCTO;apply;C2RAMR;3| (|Integer|) (90 . ^) (96 . *)
              (102 . -) (108 . |unit?|) (113 . |recip|)
              (|Record| (|:| |quotient| 7) (|:| |remainder| 7))
              (118 . |monicLeftDivide|) (125 . |monicRightDivide|)
              (132 . |inv|) (137 . |leftDivide|) (144 . |rightDivide|))
           '#(|times| 151 |rightDivide| 159 |monicRightDivide| 166
              |monicLeftDivide| 173 |leftDivide| 180 |apply| 187)
           'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 43
                                                 '(1 7 8 0 9 0 7 0 10 0 6 0 11
                                                   2 7 8 0 0 12 1 7 6 0 13 1 7
                                                   14 0 15 2 7 0 0 0 16 1 7 0 0
                                                   17 0 6 0 21 0 7 0 22 2 14 23
                                                   0 0 24 2 7 0 6 0 25 2 18 6 0
                                                   6 26 2 7 0 6 14 27 2 7 6 0
                                                   14 28 2 6 0 0 0 29 2 6 0 0 0
                                                   30 2 18 0 0 32 33 2 7 0 0 0
                                                   34 2 7 0 0 0 35 1 6 8 0 36 1
                                                   6 23 0 37 3 0 38 7 7 18 39 3
                                                   0 38 7 7 18 40 1 6 0 0 41 3
                                                   0 38 7 7 18 42 3 0 38 7 7 18
                                                   43 4 0 7 7 7 18 19 20 3 1 38
                                                   7 7 18 43 3 2 38 7 7 18 40 3
                                                   2 38 7 7 18 39 3 1 38 7 7 18
                                                   42 5 0 6 7 6 6 18 19 31)))))
           '|lookupComplete|)) 
