
(/VERSIONCHECK 2) 

(DEFUN |RURPK;rur;L2BL;1| (|lp| |univ?| |check?| $)
  (PROG (|p| #0=#:G1879 |rif| |lqwt| |toSave| |lq| #1=#:G1843 |lfq|
             |fq| #2=#:G1880 #3=#:G1881 #4=#:G1882 |lsfqwt| |qwt|
             #5=#:G1883 |newts| #6=#:G1884 #7=#:G1885 |newlq| |toSee|
             |ts| #8=#:G1886 |lus| #9=#:G1887 |us| #10=#:G1888
             #11=#:G1833 |g| #12=#:G1889 |q| #13=#:G1890 |lc|
             |toReturn|)
    (RETURN
      (SEQ (LETT |lp| (SPADCALL (ELT $ 23) |lp| (QREFELT $ 26))
                 . #14=(|RURPK;rur;L2BL;1|))
           (EXIT (COND
                   ((NULL |lp|) (|error| "rur$RURPACK: #1 is empty"))
                   ((SPADCALL (ELT $ 27) |lp| (QREFELT $ 28))
                    (|error| "rur$RURPACK: #1 is not a triangular set"))
                   ('T
                    (SEQ (LETT |ts|
                               (SPADCALL (LIST (QREFELT $ 20))
                                   (QREFELT $ 31)) . #14#)
                         (LETT |lq| NIL . #14#)
                         (SEQ (LETT |p| NIL . #14#)
                              (LETT #0# |lp| . #14#) G190
                              (COND
                                ((OR (ATOM #0#)
                                     (PROGN
                                       (LETT |p| (CAR #0#) . #14#)
                                       NIL))
                                 #15=(GO G191)))
                              (SEQ (LETT |rif|
                                    (SPADCALL |p| (QREFELT $ 32)) . #14#)
                                   (EXIT
                                    (COND
                                      ((QEQCAR |rif| 1)
                                       (|error|
                                        "rur$RURPACK: #1 is not a subset of R[ls]"))
                                      ('T
                                       (SEQ
                                        (LETT |q| (QCDR |rif|) . #14#)
                                        (EXIT
                                         (LETT |lq|
                                          (CONS |q| |lq|) . #14#)))))))
                              (LETT #0# (CDR #0#) . #14#) #16=(GO G190)
                              G191 (EXIT NIL))
                         (LETT |lq|
                               (SPADCALL (ELT $ 33) |lq|
                                   (QREFELT $ 35)) . #14#)
                         (LETT |toSee| (LIST (CONS |lq| |ts|)) . #14#)
                         (LETT |toSave| NIL . #14#)
                         (SEQ G190
                              (COND
                                ((NULL (COND
                                         ((NULL |toSee|) 'NIL)
                                         ('T 'T)))
                                 #15#))
                              (SEQ (LETT |lqwt|
                                    (|SPADfirst| |toSee|) . #14#)
                                   (LETT |toSee| (CDR |toSee|) . #14#)
                                   (LETT |lq| (QCAR |lqwt|) . #14#)
                                   (LETT |ts| (QCDR |lqwt|) . #14#)
                                   (EXIT
                                    (COND
                                      ((NULL |lq|)
                                       (LETT |toSave|
                                        (CONS |ts| |toSave|) . #14#))
                                      ('T
                                       (SEQ
                                        (LETT |q|
                                         (|SPADfirst| |lq|) . #14#)
                                        (LETT |lq| (CDR |lq|) . #14#)
                                        (COND
                                          ((NULL
                                            (SPADCALL
                                             (SPADCALL |ts|
                                              (QREFELT $ 36))
                                             (SPADCALL |q|
                                              (QREFELT $ 37))
                                             (QREFELT $ 38)))
                                           (EXIT
                                            (|error|
                                             "rur$RURPACK: #1 is not a triangular set"))))
                                        (EXIT
                                         (COND
                                           ((SPADCALL
                                             (PROG2
                                              (LETT #1#
                                               (SPADCALL |ts|
                                                (QREFELT $ 39)) . #14#)
                                              (QCDR #1#)
                                               (|check-union|
                                                (QEQCAR #1# 0)
                                                (|SquareFreeRegularTriangularSet|
                                                 (QREFELT $ 6)
                                                 (|IndexedExponents|
                                                  (|OrderedVariableList|
                                                   (QREFELT $ 13)))
                                                 (|OrderedVariableList|
                                                  (QREFELT $ 13))
                                                 (|NewSparseMultivariatePolynomial|
                                                  (QREFELT $ 6)
                                                  (|OrderedVariableList|
                                                   (QREFELT $ 13))))
                                                #1#))
                                             (QREFELT $ 40))
                                            (SEQ
                                             (LETT |lfq|
                                              (SPADCALL (LIST |q|)
                                               (QREFELT $ 42)) . #14#)
                                             (EXIT
                                              (SEQ
                                               (LETT |fq| NIL . #14#)
                                               (LETT #2# |lfq| . #14#)
                                               G190
                                               (COND
                                                 ((OR (ATOM #2#)
                                                   (PROGN
                                                     (LETT |fq|
                                                      (CAR #2#) . #14#)
                                                     NIL))
                                                  #15#))
                                               (SEQ
                                                (LETT |newts|
                                                 (SPADCALL |fq| |ts|
                                                  (QREFELT $ 43)) . #14#)
                                                (LETT |newlq|
                                                 (PROGN
                                                   (LETT #3#
                                                    NIL . #14#)
                                                   (SEQ
                                                    (LETT |q|
                                                     NIL . #14#)
                                                    (LETT #4#
                                                     |lq| . #14#)
                                                    G190
                                                    (COND
                                                      ((OR (ATOM #4#)
                                                        (PROGN
                                                          (LETT |q|
                                                           (CAR #4#) . #14#)
                                                          NIL))
                                                       #15#))
                                                    (SEQ
                                                     (EXIT
                                                      (LETT #3#
                                                       (CONS
                                                        (QVELT
                                                         (SPADCALL |q|
                                                          |newts|
                                                          (QREFELT $
                                                           45))
                                                         1)
                                                        #3#) . #14#)))
                                                    (LETT #4#
                                                     (CDR #4#) . #14#)
                                                    #16# G191
                                                    (EXIT
                                                     (NREVERSE0 #3#)))) . #14#)
                                                (EXIT
                                                 (LETT |toSee|
                                                  (CONS
                                                   (CONS |newlq|
                                                    |newts|)
                                                   |toSee|) . #14#)))
                                               (LETT #2#
                                                (CDR #2#) . #14#)
                                               #16# G191 (EXIT NIL)))))
                                           ('T
                                            (SEQ
                                             (LETT |lsfqwt|
                                              (SPADCALL |q| |ts|
                                               (QREFELT $ 48)) . #14#)
                                             (EXIT
                                              (SEQ
                                               (LETT |qwt| NIL . #14#)
                                               (LETT #5#
                                                |lsfqwt| . #14#)
                                               G190
                                               (COND
                                                 ((OR (ATOM #5#)
                                                   (PROGN
                                                     (LETT |qwt|
                                                      (CAR #5#) . #14#)
                                                     NIL))
                                                  #15#))
                                               (SEQ
                                                (LETT |q|
                                                 (QCAR |qwt|) . #14#)
                                                (LETT |ts|
                                                 (QCDR |qwt|) . #14#)
                                                (COND
                                                  ((NULL
                                                    (SPADCALL
                                                     (SPADCALL |q|
                                                      (QREFELT $ 49))
                                                     (QREFELT $ 50)))
                                                   (LETT |q|
                                                    (SPADCALL |q| |ts|
                                                     (QREFELT $ 52)) . #14#)))
                                                (LETT |newts|
                                                 (SPADCALL |q| |ts|
                                                  (QREFELT $ 43)) . #14#)
                                                (LETT |newlq|
                                                 (PROGN
                                                   (LETT #6#
                                                    NIL . #14#)
                                                   (SEQ
                                                    (LETT |q|
                                                     NIL . #14#)
                                                    (LETT #7#
                                                     |lq| . #14#)
                                                    G190
                                                    (COND
                                                      ((OR (ATOM #7#)
                                                        (PROGN
                                                          (LETT |q|
                                                           (CAR #7#) . #14#)
                                                          NIL))
                                                       #15#))
                                                    (SEQ
                                                     (EXIT
                                                      (LETT #6#
                                                       (CONS
                                                        (QVELT
                                                         (SPADCALL |q|
                                                          |newts|
                                                          (QREFELT $
                                                           45))
                                                         1)
                                                        #6#) . #14#)))
                                                    (LETT #7#
                                                     (CDR #7#) . #14#)
                                                    #16# G191
                                                    (EXIT
                                                     (NREVERSE0 #6#)))) . #14#)
                                                (EXIT
                                                 (LETT |toSee|
                                                  (CONS
                                                   (CONS |newlq|
                                                    |newts|)
                                                   |toSee|) . #14#)))
                                               (LETT #5#
                                                (CDR #5#) . #14#)
                                               #16# G191 (EXIT NIL))))))))))))
                              NIL #16# G191 (EXIT NIL))
                         (LETT |toReturn| NIL . #14#)
                         (SEQ (LETT |ts| NIL . #14#)
                              (LETT #8# |toSave| . #14#) G190
                              (COND
                                ((OR (ATOM #8#)
                                     (PROGN
                                       (LETT |ts| (CAR #8#) . #14#)
                                       NIL))
                                 #15#))
                              (SEQ (LETT |lus|
                                    (SPADCALL |ts| |univ?|
                                     (QREFELT $ 55)) . #14#)
                                   (COND
                                     (|check?|
                                      (COND
                                        ((NULL
                                          (SPADCALL |ts| |lus|
                                           (QREFELT $ 56)))
                                         (EXIT
                                          (SEQ
                                           (SPADCALL "RUR for: "
                                            (QREFELT $ 60))
                                           (SPADCALL
                                            (SPADCALL |ts|
                                             (QREFELT $ 62))
                                            (QREFELT $ 63))
                                           (SPADCALL "Is: "
                                            (QREFELT $ 60))
                                           (SEQ (LETT |us| NIL . #14#)
                                            (LETT #9# |lus| . #14#)
                                            G190
                                            (COND
                                              ((OR (ATOM #9#)
                                                (PROGN
                                                  (LETT |us|
                                                   (CAR #9#) . #14#)
                                                  NIL))
                                               #15#))
                                            (SEQ
                                             (EXIT
                                              (SPADCALL
                                               (SPADCALL |us|
                                                (QREFELT $ 62))
                                               (QREFELT $ 63))))
                                            (LETT #9# (CDR #9#) . #14#)
                                            #16# G191 (EXIT NIL))
                                           (EXIT
                                            (|error|
                                             "rur$RURPACK: bad result with function rur$IRURPK"))))))))
                                   (EXIT
                                    (SEQ (LETT |us| NIL . #14#)
                                     (LETT #10# |lus| . #14#) G190
                                     (COND
                                       ((OR (ATOM #10#)
                                         (PROGN
                                           (LETT |us|
                                            (CAR #10#) . #14#)
                                           NIL))
                                        #15#))
                                     (SEQ
                                      (LETT |g|
                                       (SPADCALL
                                        (PROG2
                                         (LETT #11#
                                          (SPADCALL |us| (QREFELT $ 17)
                                           (QREFELT $ 65)) . #14#)
                                         (QCDR #11#)
                                          (|check-union|
                                           (QEQCAR #11# 0)
                                           (|NewSparseMultivariatePolynomial|
                                            (QREFELT $ 6)
                                            (|OrderedVariableList|
                                             (QREFELT $ 13)))
                                           #11#))
                                        (QREFELT $ 67)) . #14#)
                                      (LETT |lc|
                                       (PROGN
                                         (LETT #12# NIL . #14#)
                                         (SEQ (LETT |q| NIL . #14#)
                                          (LETT #13#
                                           (SPADCALL
                                            (SPADCALL |us|
                                             (QREFELT $ 17)
                                             (QREFELT $ 68))
                                            (QREFELT $ 69)) . #14#)
                                          G190
                                          (COND
                                            ((OR (ATOM #13#)
                                              (PROGN
                                                (LETT |q|
                                                 (CAR #13#) . #14#)
                                                NIL))
                                             #15#))
                                          (SEQ
                                           (EXIT
                                            (LETT #12#
                                             (CONS
                                              (SPADCALL |q|
                                               (QREFELT $ 70))
                                              #12#) . #14#)))
                                          (LETT #13# (CDR #13#) . #14#)
                                          #16# G191
                                          (EXIT (NREVERSE0 #12#)))) . #14#)
                                      (EXIT
                                       (LETT |toReturn|
                                        (CONS (CONS |g| |lc|)
                                         |toReturn|) . #14#)))
                                     (LETT #10# (CDR #10#) . #14#) #16#
                                     G191 (EXIT NIL))))
                              (LETT #8# (CDR #8#) . #14#) #16# G191
                              (EXIT NIL))
                         (EXIT |toReturn|))))))))) 

(DEFUN |RURPK;rur;LBL;2| (|lp| |univ?| $)
  (SPADCALL |lp| |univ?| 'NIL (QREFELT $ 73))) 

(DEFUN |RURPK;rur;LL;3| (|lp| $) (SPADCALL |lp| 'T (QREFELT $ 74))) 

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

(DEFUN |RationalUnivariateRepresentationPackage;| (|#1| |#2|)
  (PROG (DV$1 DV$2 |dv$| $ |pv$| #0=#:G1828)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|)
              . #1=(|RationalUnivariateRepresentationPackage|))
        (LETT DV$2 (|devaluate| |#2|) . #1#)
        (LETT |dv$|
              (LIST '|RationalUnivariateRepresentationPackage| DV$1
                    DV$2) . #1#)
        (LETT $ (GETREFV 76) . #1#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#))
        (|haddProp| |$ConstructorCache|
            '|RationalUnivariateRepresentationPackage| (LIST DV$1 DV$2)
            (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (QSETREFV $ 7 |#2|)
        (QSETREFV $ 10 (SPADCALL (QREFELT $ 9)))
        (QSETREFV $ 13 (SPADCALL |#2| (QREFELT $ 10) (QREFELT $ 12)))
        (QSETREFV $ 17
            (PROG2 (LETT #0#
                         (SPADCALL (QREFELT $ 10) (QREFELT $ 16)) . #1#)
                   (QCDR #0#)
              (|check-union| (QEQCAR #0# 0)
                  (|OrderedVariableList| (QREFELT $ 13)) #0#)))
        (QSETREFV $ 20 (SPADCALL (QREFELT $ 17) (QREFELT $ 19)))
        $)))) 

(MAKEPROP '|RationalUnivariateRepresentationPackage| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
             (|Symbol|) (0 . |new|) '|news| (|List| 8) (4 . |concat|)
             '|lv| (|Union| $ '"failed") (|OrderedVariableList| 13)
             (10 . |variable|) '|newv|
             (|NewSparseMultivariatePolynomial| 6 15) (15 . |coerce|)
             '|newq| (|Boolean|) (|Polynomial| 6) (20 . |zero?|)
             (|Mapping| 21 22) (|List| 22) (25 . |remove|)
             (31 . |ground?|) (36 . |any?|) (|List| 18)
             (|SquareFreeRegularTriangularSet| 6
                 (|IndexedExponents| 15) 15 18)
             (42 . |construct|) (47 . |retractIfCan|)
             (52 . |infRittWu?|) (|Mapping| 21 18 18) (58 . |sort|)
             (64 . |mvar|) (69 . |mvar|) (74 . <) (80 . |rest|)
             (85 . |empty?|)
             (|PolynomialSetUtilitiesPackage| 6 (|IndexedExponents| 15)
                 15 18)
             (90 . |irreducibleFactors|) (95 . |internalAugment|)
             (|Record| (|:| |rnum| 6) (|:| |polnum| 18) (|:| |den| 6))
             (101 . |remainder|)
             (|Record| (|:| |val| 18) (|:| |tower| $)) (|List| 46)
             (107 . |squareFreePart|) (113 . |init|) (118 . |ground?|)
             (|NormalizationPackage| 6 (|IndexedExponents| 15) 15 18
                 30)
             (123 . |normalizedAssociate|) (|List| 30)
             (|InternalRationalUnivariateRepresentationPackage| 6
                 (|IndexedExponents| 15) 15 18 30)
             (129 . |rur|) (135 . |checkRur|) (|Void|) (|String|)
             (|OutputPackage|) (141 . |output|) (|OutputForm|)
             (146 . |coerce|) (151 . |output|) (|Union| 18 '"failed")
             (156 . |select|) (|SparseUnivariatePolynomial| 6)
             (162 . |univariate|) (167 . |collectUpper|)
             (173 . |parts|) (178 . |convert|)
             (|Record| (|:| |complexRoots| 66) (|:| |coordinates| 25))
             (|List| 71) |RURPK;rur;L2BL;1| |RURPK;rur;LBL;2|
             |RURPK;rur;LL;3|)
          '#(|rur| 183) 'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 75
                                '(0 8 0 9 2 11 0 0 8 12 1 15 14 8 16 1
                                  18 0 15 19 1 22 21 0 23 2 25 0 24 0
                                  26 1 22 21 0 27 2 25 21 24 0 28 1 30
                                  0 29 31 1 18 14 22 32 2 18 21 0 0 33
                                  2 29 0 34 0 35 1 30 15 0 36 1 18 15 0
                                  37 2 15 21 0 0 38 1 30 14 0 39 1 30
                                  21 0 40 1 41 29 29 42 2 30 0 18 0 43
                                  2 30 44 18 0 45 2 30 47 18 0 48 1 18
                                  0 0 49 1 18 21 0 50 2 51 18 18 30 52
                                  2 54 53 30 21 55 2 54 21 30 53 56 1
                                  59 57 58 60 1 30 61 0 62 1 59 57 61
                                  63 2 30 64 0 15 65 1 18 66 0 67 2 30
                                  0 0 15 68 1 30 29 0 69 1 18 22 0 70 2
                                  0 72 25 21 74 3 0 72 25 21 21 73 1 0
                                  72 25 75)))))
          '|lookupComplete|)) 
