
(/VERSIONCHECK 2) 

(DEFUN |XPR;One;$;1| ($)
  (LIST (CONS (|spadConstant| $ 9) (|spadConstant| $ 10)))) 

(DEFUN |XPR;characteristic;Nni;2| ($) (SPADCALL (QREFELT $ 13))) 

(PUT '|XPR;#;$Nni;3| '|SPADreplace| 'LENGTH) 

(DEFUN |XPR;#;$Nni;3| (|x| $) (LENGTH |x|)) 

(DEFUN |XPR;maxdeg;$E;4| (|p| $)
  (COND
    ((NULL |p|) (|error| " polynome nul !!"))
    ('T (QCAR (|SPADfirst| |p|))))) 

(DEFUN |XPR;mindeg;$E;5| (|p| $)
  (COND
    ((NULL |p|) (|error| " polynome nul !!"))
    ('T (QCAR (SPADCALL |p| (QREFELT $ 18)))))) 

(DEFUN |XPR;coef;$ER;6| (|p| |e| $)
  (PROG (|tm| #0=#:G1842 #1=#:G1841 #2=#:G1837)
    (RETURN
      (SEQ (EXIT (SEQ (SEQ (LETT |tm| NIL . #3=(|XPR;coef;$ER;6|))
                           (LETT #0# |p| . #3#) G190
                           (COND
                             ((OR (ATOM #0#)
                                  (PROGN
                                    (LETT |tm| (CAR #0#) . #3#)
                                    NIL))
                              (GO G191)))
                           (SEQ (EXIT (COND
                                        ((SPADCALL (QCAR |tm|) |e|
                                          (QREFELT $ 21))
                                         (PROGN
                                           (LETT #1# (QCDR |tm|) . #3#)
                                           (GO #1#)))
                                        ('T
                                         (SEQ
                                          (EXIT
                                           (COND
                                             ((SPADCALL (QCAR |tm|) |e|
                                               (QREFELT $ 22))
                                              (PROGN
                                                (LETT #2#
                                                 (PROGN
                                                   (LETT #1#
                                                    (|spadConstant| $
                                                     23) . #3#)
                                                   (GO #1#)) . #3#)
                                                (GO #2#)))))
                                          #2# (EXIT #2#))))))
                           (LETT #0# (CDR #0#) . #3#) (GO G190) G191
                           (EXIT NIL))
                      (EXIT (|spadConstant| $ 23))))
           #1# (EXIT #1#))))) 

(DEFUN |XPR;constant?;$B;7| (|p| $)
  (COND
    ((SPADCALL |p| (|spadConstant| $ 25) (QREFELT $ 26)) 'T)
    ('T
     (SPADCALL (SPADCALL |p| (QREFELT $ 16)) (|spadConstant| $ 9)
         (QREFELT $ 21))))) 

(DEFUN |XPR;constant;$R;8| (|p| $)
  (SPADCALL |p| (|spadConstant| $ 9) (QREFELT $ 24))) 

(DEFUN |XPR;quasiRegular?;$B;9| (|p| $)
  (COND
    ((OR (SPADCALL |p| (|spadConstant| $ 25) (QREFELT $ 26))
         (NULL (SPADCALL (QCAR (SPADCALL |p| (QREFELT $ 18)))
                   (|spadConstant| $ 9) (QREFELT $ 21))))
     'T)
    ('T 'NIL))) 

(DEFUN |XPR;quasiRegular;2$;10| (|p| $)
  (PROG (#0=#:G1854 |t| #1=#:G1855)
    (RETURN
      (SEQ (COND
             ((SPADCALL |p| (QREFELT $ 29)) |p|)
             ('T
              (PROGN
                (LETT #0# NIL . #2=(|XPR;quasiRegular;2$;10|))
                (SEQ (LETT |t| NIL . #2#) (LETT #1# |p| . #2#) G190
                     (COND
                       ((OR (ATOM #1#)
                            (PROGN (LETT |t| (CAR #1#) . #2#) NIL))
                        (GO G191)))
                     (SEQ (EXIT (COND
                                  ((COND
                                     ((SPADCALL (QCAR |t|)
                                       (|spadConstant| $ 9)
                                       (QREFELT $ 21))
                                      'NIL)
                                     ('T 'T))
                                   (LETT #0# (CONS |t| #0#) . #2#)))))
                     (LETT #1# (CDR #1#) . #2#) (GO G190) G191
                     (EXIT (NREVERSE0 #0#)))))))))) 

(DEFUN |XPR;recip;$U;11| (|p| $)
  (PROG (|u|)
    (RETURN
      (SEQ (COND
             ((OR (SPADCALL |p| (|spadConstant| $ 25) (QREFELT $ 26))
                  (SPADCALL (|spadConstant| $ 9)
                      (QCAR (|SPADfirst| |p|)) (QREFELT $ 22)))
              (CONS 1 "failed"))
             ('T
              (SEQ (LETT |u|
                         (SPADCALL (QCDR (|SPADfirst| |p|))
                             (QREFELT $ 32))
                         |XPR;recip;$U;11|)
                   (EXIT (COND
                           ((QEQCAR |u| 1) (CONS 1 "failed"))
                           ('T
                            (CONS 0
                                  (SPADCALL (QCDR |u|) (QREFELT $ 33))))))))))))) 

(DEFUN |XPR;coerce;R$;12| (|r| $)
  (COND
    ((SPADCALL |r| (|spadConstant| $ 23) (QREFELT $ 35))
     (|spadConstant| $ 25))
    ('T (LIST (CONS (|spadConstant| $ 9) |r|))))) 

(DEFUN |XPR;coerce;I$;13| (|n| $)
  (SPADCALL (SPADCALL |n| (QREFELT $ 37)) (QREFELT $ 33))) 

(DEFUN |XPR;*;3$;14| (|p1| |p2| $)
  (PROG (|t1| #0=#:G1880 #1=#:G1881 |t2| #2=#:G1882 #3=#:G1876
              #4=#:G1874 #5=#:G1875)
    (RETURN
      (SEQ (COND
             ((OR (NULL |p1|) (NULL |p2|)) (|spadConstant| $ 25))
             ('T
              (COND
                ((SPADCALL (QCAR (|SPADfirst| |p1|))
                     (|spadConstant| $ 9) (QREFELT $ 21))
                 (SPADCALL (QCDR (|SPADfirst| |p1|)) |p2|
                     (QREFELT $ 39)))
                ((SPADCALL |p2| (|spadConstant| $ 11) (QREFELT $ 26))
                 |p1|)
                ('T
                 (PROGN
                   (LETT #5# NIL . #6=(|XPR;*;3$;14|))
                   (SEQ (LETT |t1| NIL . #6#) (LETT #0# |p1| . #6#)
                        G190
                        (COND
                          ((OR (ATOM #0#)
                               (PROGN (LETT |t1| (CAR #0#) . #6#) NIL))
                           #7=(GO G191)))
                        (SEQ (EXIT (PROGN
                                     (LETT #3#
                                      (PROGN
                                        (LETT #1# NIL . #6#)
                                        (SEQ (LETT |t2| NIL . #6#)
                                         (LETT #2# |p2| . #6#) G190
                                         (COND
                                           ((OR (ATOM #2#)
                                             (PROGN
                                               (LETT |t2|
                                                (CAR #2#) . #6#)
                                               NIL))
                                            #7#))
                                         (SEQ
                                          (EXIT
                                           (LETT #1#
                                            (CONS
                                             (CONS
                                              (SPADCALL (QCAR |t1|)
                                               (QCAR |t2|)
                                               (QREFELT $ 40))
                                              (SPADCALL (QCDR |t1|)
                                               (QCDR |t2|)
                                               (QREFELT $ 41)))
                                             #1#) . #6#)))
                                         (LETT #2# (CDR #2#) . #6#)
                                         #8=(GO G190) G191
                                         (EXIT (NREVERSE0 #1#)))) . #6#)
                                     (COND
                                       (#5#
                                        (LETT #4#
                                         (SPADCALL #4# #3#
                                          (QREFELT $ 42)) . #6#))
                                       ('T
                                        (PROGN
                                          (LETT #4# #3# . #6#)
                                          (LETT #5# 'T . #6#)))))))
                        (LETT #0# (CDR #0#) . #6#) #8# G191 (EXIT NIL))
                   (COND (#5# #4#) ('T (|spadConstant| $ 25)))))))))))) 

(DEFUN |XPR;*;3$;15| (|p1| |p2| $)
  (PROG (|t1| #0=#:G1891 #1=#:G1892 |t2| #2=#:G1893 |r| #3=#:G1886
              #4=#:G1884 #5=#:G1885)
    (RETURN
      (SEQ (COND
             ((OR (NULL |p1|) (NULL |p2|)) (|spadConstant| $ 25))
             ('T
              (COND
                ((SPADCALL (QCAR (|SPADfirst| |p1|))
                     (|spadConstant| $ 9) (QREFELT $ 21))
                 (SPADCALL (QCDR (|SPADfirst| |p1|)) |p2|
                     (QREFELT $ 39)))
                ((SPADCALL |p2| (|spadConstant| $ 11) (QREFELT $ 26))
                 |p1|)
                ('T
                 (PROGN
                   (LETT #5# NIL . #6=(|XPR;*;3$;15|))
                   (SEQ (LETT |t1| NIL . #6#) (LETT #0# |p1| . #6#)
                        G190
                        (COND
                          ((OR (ATOM #0#)
                               (PROGN (LETT |t1| (CAR #0#) . #6#) NIL))
                           #7=(GO G191)))
                        (SEQ (EXIT (PROGN
                                     (LETT #3#
                                      (PROGN
                                        (LETT #1# NIL . #6#)
                                        (SEQ (LETT |t2| NIL . #6#)
                                         (LETT #2# |p2| . #6#) G190
                                         (COND
                                           ((OR (ATOM #2#)
                                             (PROGN
                                               (LETT |t2|
                                                (CAR #2#) . #6#)
                                               NIL))
                                            #7#))
                                         (SEQ
                                          (EXIT
                                           (COND
                                             ((SEQ
                                               (LETT |r|
                                                (SPADCALL (QCDR |t1|)
                                                 (QCDR |t2|)
                                                 (QREFELT $ 41)) . #6#)
                                               (EXIT
                                                (COND
                                                  ((SPADCALL |r|
                                                    (|spadConstant| $
                                                     23)
                                                    (QREFELT $ 35))
                                                   'NIL)
                                                  ('T 'T))))
                                              (LETT #1#
                                               (CONS
                                                (CONS
                                                 (SPADCALL (QCAR |t1|)
                                                  (QCAR |t2|)
                                                  (QREFELT $ 40))
                                                 |r|)
                                                #1#) . #6#)))))
                                         (LETT #2# (CDR #2#) . #6#)
                                         #8=(GO G190) G191
                                         (EXIT (NREVERSE0 #1#)))) . #6#)
                                     (COND
                                       (#5#
                                        (LETT #4#
                                         (SPADCALL #4# #3#
                                          (QREFELT $ 42)) . #6#))
                                       ('T
                                        (PROGN
                                          (LETT #4# #3# . #6#)
                                          (LETT #5# 'T . #6#)))))))
                        (LETT #0# (CDR #0#) . #6#) #8# G191 (EXIT NIL))
                   (COND (#5# #4#) ('T (|spadConstant| $ 25)))))))))))) 

(DEFUN |XPR;**;$Nni$;16| (|p| |nn| $)
  (|XPR;repeatMultExpt| |p| |nn| $)) 

(DEFUN |XPR;repeatMultExpt| (|x| |nn| $)
  (PROG (|i| |y|)
    (RETURN
      (SEQ (COND
             ((EQL |nn| 0) (|spadConstant| $ 11))
             ('T
              (SEQ (LETT |y| |x| . #0=(|XPR;repeatMultExpt|))
                   (SEQ (LETT |i| 2 . #0#) G190
                        (COND ((QSGREATERP |i| |nn|) (GO G191)))
                        (SEQ (EXIT (LETT |y|
                                    (SPADCALL |x| |y| (QREFELT $ 43)) . #0#)))
                        (LETT |i| (QSADD1 |i|) . #0#) (GO G190) G191
                        (EXIT NIL))
                   (EXIT |y|)))))))) 

(DEFUN |XPR;outTerm| (|r| |m| $)
  (COND
    ((SPADCALL |r| (|spadConstant| $ 10) (QREFELT $ 35))
     (SPADCALL |m| (QREFELT $ 46)))
    ((SPADCALL |m| (|spadConstant| $ 9) (QREFELT $ 21))
     (SPADCALL |r| (QREFELT $ 47)))
    ('T
     (SPADCALL (SPADCALL |r| (QREFELT $ 47))
         (SPADCALL |m| (QREFELT $ 46)) (QREFELT $ 48))))) 

(DEFUN |XPR;coerce;$Of;19| (|a| $)
  (PROG (#0=#:G1904 |t| #1=#:G1905)
    (RETURN
      (SEQ (COND
             ((NULL |a|)
              (SPADCALL (|spadConstant| $ 23) (QREFELT $ 47)))
             ('T
              (SPADCALL (ELT $ 49)
                  (NREVERSE
                      (PROGN
                        (LETT #0# NIL . #2=(|XPR;coerce;$Of;19|))
                        (SEQ (LETT |t| NIL . #2#) (LETT #1# |a| . #2#)
                             G190
                             (COND
                               ((OR (ATOM #1#)
                                    (PROGN
                                      (LETT |t| (CAR #1#) . #2#)
                                      NIL))
                                (GO G191)))
                             (SEQ (EXIT (LETT #0#
                                         (CONS
                                          (|XPR;outTerm| (QCDR |t|)
                                           (QCAR |t|) $)
                                          #0#) . #2#)))
                             (LETT #1# (CDR #1#) . #2#) (GO G190) G191
                             (EXIT (NREVERSE0 #0#)))))
                  (QREFELT $ 52)))))))) 

(DEFUN |XPR;/;$R$;20| (|x| |r| $)
  (SPADCALL (SPADCALL |r| (QREFELT $ 54)) |x| (QREFELT $ 39))) 

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

(DEFUN |XPolynomialRing;| (|#1| |#2|)
  (PROG (DV$1 DV$2 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|) . #0=(|XPolynomialRing|))
        (LETT DV$2 (|devaluate| |#2|) . #0#)
        (LETT |dv$| (LIST '|XPolynomialRing| DV$1 DV$2) . #0#)
        (LETT $ (GETREFV 64) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3
            (LETT |pv$|
                  (|buildPredVector| 0 0
                      (LIST (|HasCategory| |#1|
                                '(|canonicalUnitNormal|))
                            (|HasCategory| |#1| '(|noZeroDivisors|))
                            (|HasCategory| |#1| '(|CommutativeRing|))
                            (|HasCategory| |#1| '(|Field|))
                            (|HasCategory| |#1| '(|unitsKnown|)))) . #0#))
        (|haddProp| |$ConstructorCache| '|XPolynomialRing|
            (LIST DV$1 DV$2) (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (QSETREFV $ 7 |#2|)
        (QSETREFV $ 8
            (|List| (|Record| (|:| |k| |#2|) (|:| |c| |#1|))))
        (COND
          ((|testBitVector| |pv$| 2)
           (QSETREFV $ 43 (CONS (|dispatchFunction| |XPR;*;3$;14|) $)))
          ('T
           (QSETREFV $ 43 (CONS (|dispatchFunction| |XPR;*;3$;15|) $))))
        (COND
          ((|testBitVector| |pv$| 4)
           (QSETREFV $ 55 (CONS (|dispatchFunction| |XPR;/;$R$;20|) $))))
        $)))) 

(MAKEPROP '|XPolynomialRing| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL (|FreeModule1| 6 7) (|local| |#1|)
             (|local| |#2|) '|Rep| (0 . |One|) (4 . |One|)
             (CONS IDENTITY
                   (FUNCALL (|dispatchFunction| |XPR;One;$;1|) $))
             (|NonNegativeInteger|) (8 . |characteristic|)
             |XPR;characteristic;Nni;2| |XPR;#;$Nni;3|
             |XPR;maxdeg;$E;4| (|Record| (|:| |k| 7) (|:| |c| 6))
             (12 . |last|) |XPR;mindeg;$E;5| (|Boolean|) (17 . =)
             (23 . <) (29 . |Zero|) |XPR;coef;$ER;6| (33 . |Zero|)
             (37 . =) |XPR;constant?;$B;7| |XPR;constant;$R;8|
             |XPR;quasiRegular?;$B;9| |XPR;quasiRegular;2$;10|
             (|Union| $ '"failed") (43 . |recip|) |XPR;coerce;R$;12|
             |XPR;recip;$U;11| (48 . =) (|Integer|) (54 . |coerce|)
             |XPR;coerce;I$;13| (59 . *) (65 . *) (71 . *) (77 . +)
             (83 . *) |XPR;**;$Nni$;16| (|OutputForm|) (89 . |coerce|)
             (94 . |coerce|) (99 . *) (105 . +) (|Mapping| 45 45 45)
             (|List| 45) (111 . |reduce|) |XPR;coerce;$Of;19|
             (117 . |inv|) (122 . /) (|Union| 7 '"failed")
             (|Mapping| 6 6) (|List| 6) (|List| 17) (|List| $)
             (|PositiveInteger|) (|String|) (|SingleInteger|))
          '#(~= 128 |zero?| 134 |subtractIfCan| 139 |sample| 145
             |retractIfCan| 149 |retract| 154 |reductum| 159 |recip|
             164 |quasiRegular?| 169 |quasiRegular| 174 |one?| 179
             |numberOfMonomials| 184 |monomials| 189 |monomial?| 194
             |monom| 199 |mindeg| 205 |maxdeg| 210 |map| 215
             |leadingTerm| 221 |leadingMonomial| 226
             |leadingCoefficient| 231 |latex| 236 |hash| 241
             |constant?| 246 |constant| 251 |coerce| 256 |coefficients|
             276 |coefficient| 281 |coef| 287 |characteristic| 293 ^
             297 |Zero| 309 |One| 313 |ListOfTerms| 317 = 322 / 328 -
             334 + 345 ** 351 * 363 |#| 405)
          'NIL
          (CONS (|makeByteWordVec2| 3
                    '(0 0 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
                      2))
                (CONS '#(NIL NIL |Algebra&| |Module&| NIL |Ring&| NIL
                         NIL NIL NIL |AbelianGroup&| NIL NIL
                         |AbelianMonoid&| |Monoid&| NIL |SemiGroup&|
                         |AbelianSemiGroup&| |SetCategory&|
                         |RetractableTo&| NIL |BasicType&| NIL NIL NIL)
                      (CONS '#((|XAlgebra| 6) (|FreeModuleCat| 6 7)
                               (|Algebra| 6) (|Module| 6)
                               (|BiModule| 6 6) (|Ring|)
                               (|LeftModule| 6) (|Rng|)
                               (|RightModule| 6) (|LeftModule| $$)
                               (|AbelianGroup|)
                               (|CancellationAbelianMonoid|)
                               (|SemiRing|) (|AbelianMonoid|)
                               (|Monoid|) (|SemiRng|) (|SemiGroup|)
                               (|AbelianSemiGroup|) (|SetCategory|)
                               (|RetractableTo| 7) (|unitsKnown|)
                               (|BasicType|) (|CoercibleTo| 45)
                               (|canonicalUnitNormal|)
                               (|noZeroDivisors|))
                            (|makeByteWordVec2| 63
                                '(0 7 0 9 0 6 0 10 0 6 12 13 1 8 17 0
                                  18 2 7 20 0 0 21 2 7 20 0 0 22 0 6 0
                                  23 0 0 0 25 2 0 20 0 0 26 1 6 31 0 32
                                  2 6 20 0 0 35 1 6 0 36 37 2 0 0 6 0
                                  39 2 7 0 0 0 40 2 6 0 0 0 41 2 0 0 0
                                  0 42 2 0 0 0 0 43 1 7 45 0 46 1 6 45
                                  0 47 2 45 0 0 0 48 2 45 0 0 0 49 2 51
                                  45 50 0 52 1 6 0 0 54 2 0 0 0 6 55 2
                                  0 20 0 0 1 1 0 20 0 1 2 0 31 0 0 1 0
                                  0 0 1 1 0 56 0 1 1 0 7 0 1 1 0 0 0 1
                                  1 0 31 0 34 1 0 20 0 29 1 0 0 0 30 1
                                  0 20 0 1 1 0 12 0 1 1 0 60 0 1 1 0 20
                                  0 1 2 0 0 7 6 1 1 0 7 0 19 1 0 7 0 16
                                  2 0 0 57 0 1 1 0 17 0 1 1 0 7 0 1 1 0
                                  6 0 1 1 0 62 0 1 1 0 63 0 1 1 0 20 0
                                  27 1 0 6 0 28 1 0 0 7 1 1 0 0 36 38 1
                                  0 0 6 33 1 0 45 0 53 1 0 58 0 1 2 0 6
                                  0 7 1 2 0 6 0 7 24 0 0 12 14 2 0 0 0
                                  12 1 2 0 0 0 61 1 0 0 0 25 0 0 0 11 1
                                  0 59 0 1 2 0 20 0 0 26 2 4 0 0 6 55 2
                                  0 0 0 0 1 1 0 0 0 1 2 0 0 0 0 42 2 0
                                  0 0 12 44 2 0 0 0 61 1 2 0 0 6 7 1 2
                                  0 0 0 6 1 2 0 0 6 0 39 2 0 0 36 0 1 2
                                  0 0 0 0 43 2 0 0 12 0 1 2 0 0 61 0 1
                                  1 0 12 0 15)))))
          '|lookupComplete|)) 
