
(/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)
                         . #0=(|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)) . #0#)
                             (EXIT (LETT |x|
                                    (SPADCALL |x| (QREFELT $ 17)) . #0#)))
                        NIL (GO G190) G191 (EXIT NIL))
                   (EXIT |z|)))))))) 

(DEFUN |OREPCTO;termPoly| (|a| |n| |y| |sigma| |delta| $)
  (PROG (|u| |n1| |m| |b| |z|)
    (RETURN
      (SEQ (COND
             ((SPADCALL |y| (QREFELT $ 9)) (|spadConstant| $ 10))
             ('T
              (SEQ (LETT |u| (SPADCALL |n| 1 (QREFELT $ 24))
                         . #0=(|OREPCTO;termPoly|))
                   (EXIT (COND
                           ((QEQCAR |u| 1)
                            (SPADCALL |a| |y| (QREFELT $ 25)))
                           ('T
                            (SEQ (LETT |n1| (QCDR |u|) . #0#)
                                 (LETT |z| (|spadConstant| $ 10) . #0#)
                                 (SEQ G190
                                      (COND
                                        ((NULL
                                          (COND
                                            ((SPADCALL |y|
                                              (|spadConstant| $ 10)
                                              (QREFELT $ 12))
                                             'NIL)
                                            ('T 'T)))
                                         (GO G191)))
                                      (SEQ
                                       (LETT |m|
                                        (SPADCALL |y| (QREFELT $ 15)) . #0#)
                                       (LETT |b|
                                        (SPADCALL |y| (QREFELT $ 13)) . #0#)
                                       (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)) . #0#)
                                       (EXIT
                                        (LETT |y|
                                         (SPADCALL |y| (QREFELT $ 17)) . #0#)))
                                      NIL (GO G190) G191 (EXIT NIL))
                                 (EXIT |z|)))))))))))) 

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

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

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

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

(DEFUN |OREPCTO;monicRightDivide;2CAR;7| (|a| |b| |sigma| $)
  (PROG (|u| #0=#:G1874)
    (RETURN
      (COND
        ((SPADCALL
             (LETT |u| (SPADCALL |b| (QREFELT $ 13))
                   . #1=(|OREPCTO;monicRightDivide;2CAR;7|))
             (QREFELT $ 36))
         (|OREPCTO;localRightDivide| |a| |b| |sigma|
             (PROG2 (LETT #0# (SPADCALL |u| (QREFELT $ 37)) . #1#)
                    (QCDR #0#)
               (|check-union| (QEQCAR #0# 0) (QREFELT $ 6) #0#))
             $))
        ('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 #0=#:G1882)
  (PROG ()
    (RETURN
      (PROG (#1=#:G1883)
        (RETURN
          (COND
            ((LETT #1#
                   (|lassocShiftWithFunction| (|devaluateList| #0#)
                       (HGET |$ConstructorCache|
                             '|UnivariateSkewPolynomialCategoryOps|)
                       '|domainEqualList|)
                   . #2=(|UnivariateSkewPolynomialCategoryOps|))
             (|CDRwithIncrement| #1#))
            ('T
             (UNWIND-PROTECT
               (PROG1 (APPLY (|function|
                                 |UnivariateSkewPolynomialCategoryOps;|)
                             #0#)
                 (LETT #1# T . #2#))
               (COND
                 ((NOT #1#)
                  (HREM |$ConstructorCache|
                        '|UnivariateSkewPolynomialCategoryOps|))))))))))) 

(DEFUN |UnivariateSkewPolynomialCategoryOps;| (|#1| |#2|)
  (PROG (DV$1 DV$2 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|)
              . #0=(|UnivariateSkewPolynomialCategoryOps|))
        (LETT DV$2 (|devaluate| |#2|) . #0#)
        (LETT |dv$|
              (LIST '|UnivariateSkewPolynomialCategoryOps| DV$1 DV$2) . #0#)
        (LETT $ (GETREFV 44) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3
            (LETT |pv$|
                  (|buildPredVector| 0 0
                      (LIST (|HasCategory| |#1| '(|Field|))
                            (|HasCategory| |#1| '(|IntegralDomain|)))) . #0#))
        (|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|)) 
