
(/VERSIONCHECK 2) 

(DEFUN |PSETCAT-;elements| (|ps| $)
  (PROG (|lp|)
    (RETURN
      (LETT |lp| (SPADCALL |ps| (QREFELT $ 12)) |PSETCAT-;elements|)))) 

(DEFUN |PSETCAT-;variables1| (|lp| $)
  (PROG (#0=#:G1867 |p| #1=#:G1868 |lvars|)
    (RETURN
      (SEQ (LETT |lvars|
                 (PROGN
                   (LETT #0# NIL . #2=(|PSETCAT-;variables1|))
                   (SEQ (LETT |p| NIL . #2#) (LETT #1# |lp| . #2#) G190
                        (COND
                          ((OR (ATOM #1#)
                               (PROGN (LETT |p| (CAR #1#) . #2#) NIL))
                           (GO G191)))
                        (SEQ (EXIT (LETT #0#
                                    (CONS (SPADCALL |p| (QREFELT $ 14))
                                     #0#) . #2#)))
                        (LETT #1# (CDR #1#) . #2#) (GO G190) G191
                        (EXIT (NREVERSE0 #0#)))) . #2#)
           (EXIT (SPADCALL (CONS #'|PSETCAT-;variables1!0| $)
                     (SPADCALL (SPADCALL |lvars| (QREFELT $ 18))
                         (QREFELT $ 19))
                     (QREFELT $ 21))))))) 

(DEFUN |PSETCAT-;variables1!0| (|#1| |#2| $)
  (SPADCALL |#2| |#1| (QREFELT $ 16))) 

(DEFUN |PSETCAT-;variables2| (|lp| $)
  (PROG (#0=#:G1872 |p| #1=#:G1873 |lvars|)
    (RETURN
      (SEQ (LETT |lvars|
                 (PROGN
                   (LETT #0# NIL . #2=(|PSETCAT-;variables2|))
                   (SEQ (LETT |p| NIL . #2#) (LETT #1# |lp| . #2#) G190
                        (COND
                          ((OR (ATOM #1#)
                               (PROGN (LETT |p| (CAR #1#) . #2#) NIL))
                           (GO G191)))
                        (SEQ (EXIT (LETT #0#
                                    (CONS (SPADCALL |p| (QREFELT $ 22))
                                     #0#) . #2#)))
                        (LETT #1# (CDR #1#) . #2#) (GO G190) G191
                        (EXIT (NREVERSE0 #0#)))) . #2#)
           (EXIT (SPADCALL (CONS #'|PSETCAT-;variables2!0| $)
                     (SPADCALL |lvars| (QREFELT $ 19)) (QREFELT $ 21))))))) 

(DEFUN |PSETCAT-;variables2!0| (|#1| |#2| $)
  (SPADCALL |#2| |#1| (QREFELT $ 16))) 

(DEFUN |PSETCAT-;variables;SL;4| (|ps| $)
  (|PSETCAT-;variables1| (|PSETCAT-;elements| |ps| $) $)) 

(DEFUN |PSETCAT-;mainVariables;SL;5| (|ps| $)
  (|PSETCAT-;variables2|
      (SPADCALL (ELT $ 24) (|PSETCAT-;elements| |ps| $) (QREFELT $ 26))
      $)) 

(DEFUN |PSETCAT-;mainVariable?;VarSetSB;6| (|v| |ps| $)
  (PROG (|lp|)
    (RETURN
      (SEQ (LETT |lp|
                 (SPADCALL (ELT $ 24) (|PSETCAT-;elements| |ps| $)
                     (QREFELT $ 26))
                 . #0=(|PSETCAT-;mainVariable?;VarSetSB;6|))
           (SEQ G190
                (COND
                  ((NULL (COND
                           ((OR (NULL |lp|)
                                (SPADCALL
                                    (SPADCALL (|SPADfirst| |lp|)
                                     (QREFELT $ 22))
                                    |v| (QREFELT $ 28)))
                            'NIL)
                           ('T 'T)))
                   (GO G191)))
                (SEQ (EXIT (LETT |lp| (CDR |lp|) . #0#))) NIL (GO G190)
                G191 (EXIT NIL))
           (EXIT (COND ((NULL |lp|) 'NIL) ('T 'T))))))) 

(DEFUN |PSETCAT-;collectUnder;SVarSetS;7| (|ps| |v| $)
  (PROG (|p| |lp| |lq|)
    (RETURN
      (SEQ (LETT |lp| (|PSETCAT-;elements| |ps| $)
                 . #0=(|PSETCAT-;collectUnder;SVarSetS;7|))
           (LETT |lq| NIL . #0#)
           (SEQ G190
                (COND
                  ((NULL (COND ((NULL |lp|) 'NIL) ('T 'T))) (GO G191)))
                (SEQ (LETT |p| (|SPADfirst| |lp|) . #0#)
                     (LETT |lp| (CDR |lp|) . #0#)
                     (EXIT (COND
                             ((OR (SPADCALL |p| (QREFELT $ 24))
                                  (SPADCALL
                                      (SPADCALL |p| (QREFELT $ 22)) |v|
                                      (QREFELT $ 16)))
                              (LETT |lq| (CONS |p| |lq|) . #0#)))))
                NIL (GO G190) G191 (EXIT NIL))
           (EXIT (SPADCALL |lq| (QREFELT $ 30))))))) 

(DEFUN |PSETCAT-;collectUpper;SVarSetS;8| (|ps| |v| $)
  (PROG (|p| |lp| |lq|)
    (RETURN
      (SEQ (LETT |lp| (|PSETCAT-;elements| |ps| $)
                 . #0=(|PSETCAT-;collectUpper;SVarSetS;8|))
           (LETT |lq| NIL . #0#)
           (SEQ G190
                (COND
                  ((NULL (COND ((NULL |lp|) 'NIL) ('T 'T))) (GO G191)))
                (SEQ (LETT |p| (|SPADfirst| |lp|) . #0#)
                     (LETT |lp| (CDR |lp|) . #0#)
                     (EXIT (COND
                             ((NULL (SPADCALL |p| (QREFELT $ 24)))
                              (COND
                                ((SPADCALL |v|
                                     (SPADCALL |p| (QREFELT $ 22))
                                     (QREFELT $ 16))
                                 (LETT |lq| (CONS |p| |lq|) . #0#)))))))
                NIL (GO G190) G191 (EXIT NIL))
           (EXIT (SPADCALL |lq| (QREFELT $ 30))))))) 

(DEFUN |PSETCAT-;collect;SVarSetS;9| (|ps| |v| $)
  (PROG (|p| |lp| |lq|)
    (RETURN
      (SEQ (LETT |lp| (|PSETCAT-;elements| |ps| $)
                 . #0=(|PSETCAT-;collect;SVarSetS;9|))
           (LETT |lq| NIL . #0#)
           (SEQ G190
                (COND
                  ((NULL (COND ((NULL |lp|) 'NIL) ('T 'T))) (GO G191)))
                (SEQ (LETT |p| (|SPADfirst| |lp|) . #0#)
                     (LETT |lp| (CDR |lp|) . #0#)
                     (EXIT (COND
                             ((NULL (SPADCALL |p| (QREFELT $ 24)))
                              (COND
                                ((SPADCALL
                                     (SPADCALL |p| (QREFELT $ 22)) |v|
                                     (QREFELT $ 28))
                                 (LETT |lq| (CONS |p| |lq|) . #0#)))))))
                NIL (GO G190) G191 (EXIT NIL))
           (EXIT (SPADCALL |lq| (QREFELT $ 30))))))) 

(DEFUN |PSETCAT-;sort;SVarSetR;10| (|ps| |v| $)
  (PROG (|p| |lp| |us| |vs| |ws|)
    (RETURN
      (SEQ (LETT |lp| (|PSETCAT-;elements| |ps| $)
                 . #0=(|PSETCAT-;sort;SVarSetR;10|))
           (LETT |us| NIL . #0#) (LETT |vs| NIL . #0#)
           (LETT |ws| NIL . #0#)
           (SEQ G190
                (COND
                  ((NULL (COND ((NULL |lp|) 'NIL) ('T 'T))) (GO G191)))
                (SEQ (LETT |p| (|SPADfirst| |lp|) . #0#)
                     (LETT |lp| (CDR |lp|) . #0#)
                     (EXIT (COND
                             ((OR (SPADCALL |p| (QREFELT $ 24))
                                  (SPADCALL
                                      (SPADCALL |p| (QREFELT $ 22)) |v|
                                      (QREFELT $ 16)))
                              (LETT |us| (CONS |p| |us|) . #0#))
                             ((SPADCALL (SPADCALL |p| (QREFELT $ 22))
                                  |v| (QREFELT $ 28))
                              (LETT |vs| (CONS |p| |vs|) . #0#))
                             ('T (LETT |ws| (CONS |p| |ws|) . #0#)))))
                NIL (GO G190) G191 (EXIT NIL))
           (EXIT (VECTOR (SPADCALL |us| (QREFELT $ 30))
                         (SPADCALL |vs| (QREFELT $ 30))
                         (SPADCALL |ws| (QREFELT $ 30)))))))) 

(DEFUN |PSETCAT-;=;2SB;11| (|ps1| |ps2| $)
  (PROG (#0=#:G1912 #1=#:G1913 #2=#:G1914 |p| #3=#:G1915)
    (RETURN
      (SEQ (SPADCALL
               (SPADCALL
                   (PROGN
                     (LETT #0# NIL . #4=(|PSETCAT-;=;2SB;11|))
                     (SEQ (LETT |p| NIL . #4#)
                          (LETT #1#
                                (|PSETCAT-;elements| |ps1| $) . #4#)
                          G190
                          (COND
                            ((OR (ATOM #1#)
                                 (PROGN
                                   (LETT |p| (CAR #1#) . #4#)
                                   NIL))
                             #5=(GO G191)))
                          (SEQ (EXIT (LETT #0# (CONS |p| #0#) . #4#)))
                          (LETT #1# (CDR #1#) . #4#) #6=(GO G190) G191
                          (EXIT (NREVERSE0 #0#))))
                   (QREFELT $ 37))
               (SPADCALL
                   (PROGN
                     (LETT #2# NIL . #4#)
                     (SEQ (LETT |p| NIL . #4#)
                          (LETT #3#
                                (|PSETCAT-;elements| |ps2| $) . #4#)
                          G190
                          (COND
                            ((OR (ATOM #3#)
                                 (PROGN
                                   (LETT |p| (CAR #3#) . #4#)
                                   NIL))
                             #5#))
                          (SEQ (EXIT (LETT #2# (CONS |p| #2#) . #4#)))
                          (LETT #3# (CDR #3#) . #4#) #6# G191
                          (EXIT (NREVERSE0 #2#))))
                   (QREFELT $ 37))
               (QREFELT $ 38)))))) 

(DEFUN |PSETCAT-;localInf?| (|p| |q| $)
  (SPADCALL (SPADCALL |p| (QREFELT $ 40)) (SPADCALL |q| (QREFELT $ 40))
            (QREFELT $ 41))) 

(DEFUN |PSETCAT-;localTriangular?| (|lp| $)
  (PROG (|q| |p|)
    (RETURN
      (SEQ (LETT |lp| (SPADCALL (ELT $ 42) |lp| (QREFELT $ 26))
                 . #0=(|PSETCAT-;localTriangular?|))
           (EXIT (COND
                   ((NULL |lp|) 'T)
                   ((SPADCALL (ELT $ 24) |lp| (QREFELT $ 43)) 'NIL)
                   ('T
                    (SEQ (LETT |lp|
                               (SPADCALL
                                   (CONS
                                    #'|PSETCAT-;localTriangular?!0| $)
                                   |lp| (QREFELT $ 45)) . #0#)
                         (LETT |p| (|SPADfirst| |lp|) . #0#)
                         (LETT |lp| (CDR |lp|) . #0#)
                         (SEQ G190
                              (COND
                                ((NULL (COND
                                         ((NULL |lp|) 'NIL)
                                         ('T
                                          (SPADCALL
                                           (SPADCALL
                                            (LETT |q|
                                             (|SPADfirst| |lp|) . #0#)
                                            (QREFELT $ 22))
                                           (SPADCALL |p|
                                            (QREFELT $ 22))
                                           (QREFELT $ 16)))))
                                 (GO G191)))
                              (SEQ (LETT |p| |q| . #0#)
                                   (EXIT (LETT |lp| (CDR |lp|) . #0#)))
                              NIL (GO G190) G191 (EXIT NIL))
                         (EXIT (NULL |lp|)))))))))) 

(DEFUN |PSETCAT-;localTriangular?!0| (|#1| |#2| $)
  (SPADCALL (SPADCALL |#2| (QREFELT $ 22))
      (SPADCALL |#1| (QREFELT $ 22)) (QREFELT $ 16))) 

(DEFUN |PSETCAT-;triangular?;SB;14| (|ps| $)
  (|PSETCAT-;localTriangular?| (|PSETCAT-;elements| |ps| $) $)) 

(DEFUN |PSETCAT-;trivialIdeal?;SB;15| (|ps| $)
  (NULL (SPADCALL (ELT $ 42) (|PSETCAT-;elements| |ps| $)
            (QREFELT $ 26)))) 

(DEFUN |PSETCAT-;roughUnitIdeal?;SB;16| (|ps| $)
  (SPADCALL (ELT $ 24)
      (SPADCALL (ELT $ 42) (|PSETCAT-;elements| |ps| $) (QREFELT $ 26))
      (QREFELT $ 43))) 

(DEFUN |PSETCAT-;relativelyPrimeLeadingMonomials?| (|p| |q| $)
  (PROG (|dp| |dq|)
    (RETURN
      (SEQ (LETT |dp| (SPADCALL |p| (QREFELT $ 40))
                 . #0=(|PSETCAT-;relativelyPrimeLeadingMonomials?|))
           (LETT |dq| (SPADCALL |q| (QREFELT $ 40)) . #0#)
           (EXIT (SPADCALL (SPADCALL |dp| |dq| (QREFELT $ 49))
                     (SPADCALL |dp| |dq| (QREFELT $ 50))
                     (QREFELT $ 51))))))) 

(DEFUN |PSETCAT-;roughBase?;SB;18| (|ps| $)
  (PROG (|p| |lp| |rB?| |copylp|)
    (RETURN
      (SEQ (LETT |lp|
                 (SPADCALL (ELT $ 42) (|PSETCAT-;elements| |ps| $)
                     (QREFELT $ 26))
                 . #0=(|PSETCAT-;roughBase?;SB;18|))
           (EXIT (COND
                   ((NULL |lp|) 'T)
                   ('T
                    (SEQ (LETT |rB?| 'T . #0#)
                         (SEQ G190
                              (COND
                                ((NULL (COND
                                         ((NULL |lp|) 'NIL)
                                         ('T |rB?|)))
                                 #1=(GO G191)))
                              (SEQ (LETT |p| (|SPADfirst| |lp|) . #0#)
                                   (LETT |lp| (CDR |lp|) . #0#)
                                   (LETT |copylp| |lp| . #0#)
                                   (EXIT
                                    (SEQ G190
                                     (COND
                                       ((NULL
                                         (COND
                                           ((NULL |copylp|) 'NIL)
                                           ('T |rB?|)))
                                        #1#))
                                     (SEQ
                                      (LETT |rB?|
                                       (|PSETCAT-;relativelyPrimeLeadingMonomials?|
                                        |p| (|SPADfirst| |copylp|) $) . #0#)
                                      (EXIT
                                       (LETT |copylp|
                                        (CDR |copylp|) . #0#)))
                                     NIL #2=(GO G190) G191 (EXIT NIL))))
                              NIL #2# G191 (EXIT NIL))
                         (EXIT |rB?|))))))))) 

(DEFUN |PSETCAT-;roughSubIdeal?;2SB;19| (|ps1| |ps2| $)
  (PROG (|lp|)
    (RETURN
      (SEQ (LETT |lp|
                 (SPADCALL (|PSETCAT-;elements| |ps1| $) |ps2|
                     (QREFELT $ 53))
                 |PSETCAT-;roughSubIdeal?;2SB;19|)
           (EXIT (NULL (SPADCALL (ELT $ 42) |lp| (QREFELT $ 26)))))))) 

(DEFUN |PSETCAT-;roughEqualIdeals?;2SB;20| (|ps1| |ps2| $)
  (COND
    ((SPADCALL |ps1| |ps2| (QREFELT $ 55)) 'T)
    ((SPADCALL |ps1| |ps2| (QREFELT $ 56))
     (SPADCALL |ps2| |ps1| (QREFELT $ 56)))
    ('T 'NIL))) 

(DEFUN |PSETCAT-;iexactQuo;3R;21| (|r| |s| $)
  (SPADCALL |r| |s| (QREFELT $ 58))) 

(DEFUN |PSETCAT-;iexactQuo;3R;22| (|r| |s| $)
  (PROG (#0=#:G1948)
    (RETURN
      (PROG2 (LETT #0# (SPADCALL |r| |s| (QREFELT $ 61))
                   |PSETCAT-;iexactQuo;3R;22|)
             (QCDR #0#)
        (|check-union| (QEQCAR #0# 0) (QREFELT $ 7) #0#))))) 

(DEFUN |PSETCAT-;exactQuo| (|r| |s| $)
  (SPADCALL |r| |s| (QREFELT $ 62))) 

(DEFUN |PSETCAT-;headRemainder;PSR;24| (|a| |ps| $)
  (PROG (|lp1| |p| |e| |g| |#G49| |#G50| |lca| |lcp| |r| |lp2|)
    (RETURN
      (SEQ (LETT |lp1|
                 (SPADCALL (ELT $ 42) (|PSETCAT-;elements| |ps| $)
                     (QREFELT $ 26))
                 . #0=(|PSETCAT-;headRemainder;PSR;24|))
           (EXIT (COND
                   ((NULL |lp1|) (CONS |a| (|spadConstant| $ 63)))
                   ((SPADCALL (ELT $ 24) |lp1| (QREFELT $ 43))
                    (CONS (SPADCALL |a| (QREFELT $ 64))
                          (|spadConstant| $ 63)))
                   ('T
                    (SEQ (LETT |r| (|spadConstant| $ 63) . #0#)
                         (LETT |lp1|
                               (SPADCALL
                                   (CONS
                                    (|function| |PSETCAT-;localInf?|)
                                    $)
                                   (REVERSE
                                    (|PSETCAT-;elements| |ps| $))
                                   (QREFELT $ 45)) . #0#)
                         (LETT |lp2| |lp1| . #0#)
                         (SEQ G190
                              (COND
                                ((NULL (COND
                                         ((OR
                                           (SPADCALL |a|
                                            (QREFELT $ 42))
                                           (NULL |lp2|))
                                          'NIL)
                                         ('T 'T)))
                                 (GO G191)))
                              (SEQ (LETT |p| (|SPADfirst| |lp2|) . #0#)
                                   (LETT |e|
                                    (SPADCALL
                                     (SPADCALL |a| (QREFELT $ 40))
                                     (SPADCALL |p| (QREFELT $ 40))
                                     (QREFELT $ 65)) . #0#)
                                   (EXIT
                                    (COND
                                      ((QEQCAR |e| 0)
                                       (SEQ
                                        (LETT |g|
                                         (SPADCALL
                                          (LETT |lca|
                                           (SPADCALL |a|
                                            (QREFELT $ 66)) . #0#)
                                          (LETT |lcp|
                                           (SPADCALL |p|
                                            (QREFELT $ 66)) . #0#)
                                          (QREFELT $ 67)) . #0#)
                                        (PROGN
                                          (LETT |#G49|
                                           (|PSETCAT-;exactQuo| |lca|
                                            |g| $) . #0#)
                                          (LETT |#G50|
                                           (|PSETCAT-;exactQuo| |lcp|
                                            |g| $) . #0#)
                                          (LETT |lca| |#G49| . #0#)
                                          (LETT |lcp| |#G50| . #0#))
                                        (LETT |a|
                                         (SPADCALL
                                          (SPADCALL |lcp|
                                           (SPADCALL |a|
                                            (QREFELT $ 64))
                                           (QREFELT $ 68))
                                          (SPADCALL
                                           (SPADCALL |lca| (QCDR |e|)
                                            (QREFELT $ 69))
                                           (SPADCALL |p|
                                            (QREFELT $ 64))
                                           (QREFELT $ 70))
                                          (QREFELT $ 71)) . #0#)
                                        (LETT |r|
                                         (SPADCALL |r| |lcp|
                                          (QREFELT $ 72)) . #0#)
                                        (EXIT (LETT |lp2| |lp1| . #0#))))
                                      ('T
                                       (LETT |lp2| (CDR |lp2|) . #0#)))))
                              NIL (GO G190) G191 (EXIT NIL))
                         (EXIT (CONS |a| |r|)))))))))) 

(DEFUN |PSETCAT-;makeIrreducible!| (|frac| $)
  (PROG (|g|)
    (RETURN
      (SEQ (LETT |g|
                 (SPADCALL (QCDR |frac|) (QCAR |frac|) (QREFELT $ 75))
                 |PSETCAT-;makeIrreducible!|)
           (EXIT (COND
                   ((SPADCALL |g| (|spadConstant| $ 63) (QREFELT $ 77))
                    |frac|)
                   ('T
                    (SEQ (PROGN
                           (RPLACA |frac|
                                   (SPADCALL (QCAR |frac|) |g|
                                    (QREFELT $ 78)))
                           (QCAR |frac|))
                         (PROGN
                           (RPLACD |frac|
                                   (|PSETCAT-;exactQuo| (QCDR |frac|)
                                    |g| $))
                           (QCDR |frac|))
                         (EXIT |frac|))))))))) 

(DEFUN |PSETCAT-;remainder;PSR;26| (|a| |ps| $)
  (PROG (|hRa| |r| |lca| |g| |b| |c|)
    (RETURN
      (SEQ (LETT |hRa|
                 (|PSETCAT-;makeIrreducible!|
                     (SPADCALL |a| |ps| (QREFELT $ 79)) $)
                 . #0=(|PSETCAT-;remainder;PSR;26|))
           (LETT |a| (QCAR |hRa|) . #0#) (LETT |r| (QCDR |hRa|) . #0#)
           (EXIT (COND
                   ((SPADCALL |a| (QREFELT $ 42))
                    (VECTOR (|spadConstant| $ 63) |a| |r|))
                   ('T
                    (SEQ (LETT |b|
                               (SPADCALL (|spadConstant| $ 63)
                                   (SPADCALL |a| (QREFELT $ 40))
                                   (QREFELT $ 69)) . #0#)
                         (LETT |c| (SPADCALL |a| (QREFELT $ 66)) . #0#)
                         (SEQ G190
                              (COND
                                ((NULL (COND
                                         ((SPADCALL
                                           (LETT |a|
                                            (SPADCALL |a|
                                             (QREFELT $ 64)) . #0#)
                                           (QREFELT $ 42))
                                          'NIL)
                                         ('T 'T)))
                                 (GO G191)))
                              (SEQ (LETT |hRa|
                                    (|PSETCAT-;makeIrreducible!|
                                     (SPADCALL |a| |ps| (QREFELT $ 79))
                                     $) . #0#)
                                   (LETT |a| (QCAR |hRa|) . #0#)
                                   (LETT |r|
                                    (SPADCALL |r| (QCDR |hRa|)
                                     (QREFELT $ 72)) . #0#)
                                   (LETT |g|
                                    (SPADCALL |c|
                                     (LETT |lca|
                                      (SPADCALL |a| (QREFELT $ 66)) . #0#)
                                     (QREFELT $ 67)) . #0#)
                                   (LETT |b|
                                    (SPADCALL
                                     (SPADCALL
                                      (SPADCALL (QCDR |hRa|)
                                       (|PSETCAT-;exactQuo| |c| |g| $)
                                       (QREFELT $ 72))
                                      |b| (QREFELT $ 68))
                                     (SPADCALL
                                      (|PSETCAT-;exactQuo| |lca| |g| $)
                                      (SPADCALL |a| (QREFELT $ 40))
                                      (QREFELT $ 69))
                                     (QREFELT $ 80)) . #0#)
                                   (EXIT (LETT |c| |g| . #0#)))
                              NIL (GO G190) G191 (EXIT NIL))
                         (EXIT (VECTOR |c| |b| |r|)))))))))) 

(DEFUN |PSETCAT-;rewriteIdealWithHeadRemainder;LSL;27| (|ps| |cs| $)
  (PROG (|p| |rs|)
    (RETURN
      (SEQ (COND
             ((SPADCALL |cs| (QREFELT $ 83)) |ps|)
             ((SPADCALL |cs| (QREFELT $ 84))
              (LIST (|spadConstant| $ 85)))
             ('T
              (SEQ (LETT |ps| (SPADCALL (ELT $ 42) |ps| (QREFELT $ 26))
                         . #0=(|PSETCAT-;rewriteIdealWithHeadRemainder;LSL;27|))
                   (EXIT (COND
                           ((NULL |ps|) |ps|)
                           ((SPADCALL (ELT $ 24) |ps| (QREFELT $ 43))
                            (LIST (|spadConstant| $ 76)))
                           ('T
                            (SEQ (LETT |rs| NIL . #0#)
                                 (SEQ G190
                                      (COND
                                        ((NULL
                                          (COND
                                            ((NULL |ps|) 'NIL)
                                            ('T 'T)))
                                         (GO G191)))
                                      (SEQ
                                       (LETT |p|
                                        (|SPADfirst| |ps|) . #0#)
                                       (LETT |ps| (CDR |ps|) . #0#)
                                       (LETT |p|
                                        (QCAR
                                         (SPADCALL |p| |cs|
                                          (QREFELT $ 79))) . #0#)
                                       (EXIT
                                        (COND
                                          ((NULL
                                            (SPADCALL |p|
                                             (QREFELT $ 42)))
                                           (COND
                                             ((SPADCALL |p|
                                               (QREFELT $ 24))
                                              (SEQ
                                               (LETT |ps| NIL . #0#)
                                               (EXIT
                                                (LETT |rs|
                                                 (LIST
                                                  (|spadConstant| $ 76)) . #0#))))
                                             ('T
                                              (SEQ
                                               (SPADCALL |p|
                                                (QREFELT $ 86))
                                               (EXIT
                                                (LETT |rs|
                                                 (CONS |p| |rs|) . #0#)))))))))
                                      NIL (GO G190) G191 (EXIT NIL))
                                 (EXIT (SPADCALL |rs| (QREFELT $ 87)))))))))))))) 

(DEFUN |PSETCAT-;rewriteIdealWithRemainder;LSL;28| (|ps| |cs| $)
  (PROG (|p| |rs|)
    (RETURN
      (SEQ (COND
             ((SPADCALL |cs| (QREFELT $ 83)) |ps|)
             ((SPADCALL |cs| (QREFELT $ 84))
              (LIST (|spadConstant| $ 85)))
             ('T
              (SEQ (LETT |ps| (SPADCALL (ELT $ 42) |ps| (QREFELT $ 26))
                         . #0=(|PSETCAT-;rewriteIdealWithRemainder;LSL;28|))
                   (EXIT (COND
                           ((NULL |ps|) |ps|)
                           ((SPADCALL (ELT $ 24) |ps| (QREFELT $ 43))
                            (LIST (|spadConstant| $ 76)))
                           ('T
                            (SEQ (LETT |rs| NIL . #0#)
                                 (SEQ G190
                                      (COND
                                        ((NULL
                                          (COND
                                            ((NULL |ps|) 'NIL)
                                            ('T 'T)))
                                         (GO G191)))
                                      (SEQ
                                       (LETT |p|
                                        (|SPADfirst| |ps|) . #0#)
                                       (LETT |ps| (CDR |ps|) . #0#)
                                       (LETT |p|
                                        (QVELT
                                         (SPADCALL |p| |cs|
                                          (QREFELT $ 89))
                                         1) . #0#)
                                       (EXIT
                                        (COND
                                          ((NULL
                                            (SPADCALL |p|
                                             (QREFELT $ 42)))
                                           (COND
                                             ((SPADCALL |p|
                                               (QREFELT $ 24))
                                              (SEQ
                                               (LETT |ps| NIL . #0#)
                                               (EXIT
                                                (LETT |rs|
                                                 (LIST
                                                  (|spadConstant| $ 76)) . #0#))))
                                             ('T
                                              (LETT |rs|
                                               (CONS
                                                (SPADCALL |p|
                                                 (QREFELT $ 90))
                                                |rs|) . #0#)))))))
                                      NIL (GO G190) G191 (EXIT NIL))
                                 (EXIT (SPADCALL |rs| (QREFELT $ 87)))))))))))))) 

(DEFUN |PolynomialSetCategory&| (|#1| |#2| |#3| |#4| |#5|)
  (PROG (DV$1 DV$2 DV$3 DV$4 DV$5 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|) . #0=(|PolynomialSetCategory&|))
        (LETT DV$2 (|devaluate| |#2|) . #0#)
        (LETT DV$3 (|devaluate| |#3|) . #0#)
        (LETT DV$4 (|devaluate| |#4|) . #0#)
        (LETT DV$5 (|devaluate| |#5|) . #0#)
        (LETT |dv$|
              (LIST '|PolynomialSetCategory&| DV$1 DV$2 DV$3 DV$4 DV$5) . #0#)
        (LETT $ (GETREFV 92) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3
            (LETT |pv$|
                  (|buildPredVector| 0 0
                      (LIST (|HasCategory| |#2| '(|IntegralDomain|)))) . #0#))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (QSETREFV $ 7 |#2|)
        (QSETREFV $ 8 |#3|)
        (QSETREFV $ 9 |#4|)
        (QSETREFV $ 10 |#5|)
        (COND
          ((|testBitVector| |pv$| 1)
           (PROGN
             (QSETREFV $ 48
                 (CONS (|dispatchFunction|
                           |PSETCAT-;roughUnitIdeal?;SB;16|)
                       $))
             (QSETREFV $ 52
                 (CONS (|dispatchFunction| |PSETCAT-;roughBase?;SB;18|)
                       $))
             (QSETREFV $ 54
                 (CONS (|dispatchFunction|
                           |PSETCAT-;roughSubIdeal?;2SB;19|)
                       $))
             (QSETREFV $ 57
                 (CONS (|dispatchFunction|
                           |PSETCAT-;roughEqualIdeals?;2SB;20|)
                       $)))))
        (COND
          ((|HasCategory| |#2| '(|GcdDomain|))
           (COND
             ((|HasCategory| |#4| '(|ConvertibleTo| (|Symbol|)))
              (PROGN
                (COND
                  ((|HasCategory| |#2| '(|EuclideanDomain|))
                   (QSETREFV $ 59
                       (CONS (|dispatchFunction|
                                 |PSETCAT-;iexactQuo;3R;21|)
                             $)))
                  ('T
                   (QSETREFV $ 59
                       (CONS (|dispatchFunction|
                                 |PSETCAT-;iexactQuo;3R;22|)
                             $))))
                (QSETREFV $ 74
                    (CONS (|dispatchFunction|
                              |PSETCAT-;headRemainder;PSR;24|)
                          $))
                (QSETREFV $ 82
                    (CONS (|dispatchFunction|
                              |PSETCAT-;remainder;PSR;26|)
                          $))
                (QSETREFV $ 88
                    (CONS (|dispatchFunction|
                              |PSETCAT-;rewriteIdealWithHeadRemainder;LSL;27|)
                          $))
                (QSETREFV $ 91
                    (CONS (|dispatchFunction|
                              |PSETCAT-;rewriteIdealWithRemainder;LSL;28|)
                          $)))))))
        $)))) 

(MAKEPROP '|PolynomialSetCategory&| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
             (|local| |#3|) (|local| |#4|) (|local| |#5|) (|List| 10)
             (0 . |members|) (|List| 9) (5 . |variables|) (|Boolean|)
             (10 . <) (|List| $) (16 . |concat|)
             (21 . |removeDuplicates|) (|Mapping| 15 9 9) (26 . |sort|)
             (32 . |mvar|) |PSETCAT-;variables;SL;4| (37 . |ground?|)
             (|Mapping| 15 10) (42 . |remove|)
             |PSETCAT-;mainVariables;SL;5| (48 . =)
             |PSETCAT-;mainVariable?;VarSetSB;6| (54 . |construct|)
             |PSETCAT-;collectUnder;SVarSetS;7|
             |PSETCAT-;collectUpper;SVarSetS;8|
             |PSETCAT-;collect;SVarSetS;9|
             (|Record| (|:| |under| $) (|:| |floor| $) (|:| |upper| $))
             |PSETCAT-;sort;SVarSetR;10| (|Set| 10) (59 . |brace|)
             (64 . =) |PSETCAT-;=;2SB;11| (70 . |degree|) (75 . <)
             (81 . |zero?|) (86 . |any?|) (|Mapping| 15 10 10)
             (92 . |sort|) |PSETCAT-;triangular?;SB;14|
             |PSETCAT-;trivialIdeal?;SB;15| (98 . |roughUnitIdeal?|)
             (103 . |sup|) (109 . +) (115 . =) (121 . |roughBase?|)
             (126 . |rewriteIdealWithRemainder|)
             (132 . |roughSubIdeal?|) (138 . =)
             (144 . |roughSubIdeal?|) (150 . |roughEqualIdeals?|)
             (156 . |quo|) (162 . |iexactQuo|) (|Union| $ '"failed")
             (168 . |exquo|) (174 . |iexactQuo|) (180 . |One|)
             (184 . |reductum|) (189 . |subtractIfCan|)
             (195 . |leadingCoefficient|) (200 . |gcd|) (206 . *)
             (212 . |monomial|) (218 . *) (224 . -) (230 . *)
             (|Record| (|:| |num| 10) (|:| |den| 7))
             (236 . |headRemainder|) (242 . |gcd|) (248 . |One|)
             (252 . =) (258 . |exactQuotient!|) (264 . |headRemainder|)
             (270 . +)
             (|Record| (|:| |rnum| 7) (|:| |polnum| 10) (|:| |den| 7))
             (276 . |remainder|) (282 . |trivialIdeal?|)
             (287 . |roughUnitIdeal?|) (292 . |Zero|)
             (296 . |primitivePart!|) (301 . |removeDuplicates|)
             (306 . |rewriteIdealWithHeadRemainder|)
             (312 . |remainder|) (318 . |unitCanonical|)
             (323 . |rewriteIdealWithRemainder|))
          '#(|variables| 329 |trivialIdeal?| 334 |triangular?| 339
             |sort| 344 |roughUnitIdeal?| 350 |roughSubIdeal?| 355
             |roughEqualIdeals?| 361 |roughBase?| 367
             |rewriteIdealWithRemainder| 372
             |rewriteIdealWithHeadRemainder| 378 |remainder| 384
             |mainVariables| 390 |mainVariable?| 395 |iexactQuo| 401
             |headRemainder| 407 |collectUpper| 413 |collectUnder| 419
             |collect| 425 = 431)
          'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 91
                                '(1 6 11 0 12 1 10 13 0 14 2 9 15 0 0
                                  16 1 13 0 17 18 1 13 0 0 19 2 13 0 20
                                  0 21 1 10 9 0 22 1 10 15 0 24 2 11 0
                                  25 0 26 2 9 15 0 0 28 1 6 0 11 30 1
                                  36 0 11 37 2 36 15 0 0 38 1 10 8 0 40
                                  2 8 15 0 0 41 1 10 15 0 42 2 11 15 25
                                  0 43 2 11 0 44 0 45 1 0 15 0 48 2 8 0
                                  0 0 49 2 8 0 0 0 50 2 8 15 0 0 51 1 0
                                  15 0 52 2 6 11 11 0 53 2 0 15 0 0 54
                                  2 6 15 0 0 55 2 6 15 0 0 56 2 0 15 0
                                  0 57 2 7 0 0 0 58 2 0 7 7 7 59 2 7 60
                                  0 0 61 2 6 7 7 7 62 0 7 0 63 1 10 0 0
                                  64 2 8 60 0 0 65 1 10 7 0 66 2 7 0 0
                                  0 67 2 10 0 7 0 68 2 10 0 7 8 69 2 10
                                  0 0 0 70 2 10 0 0 0 71 2 7 0 0 0 72 2
                                  0 73 10 0 74 2 10 7 7 0 75 0 10 0 76
                                  2 7 15 0 0 77 2 10 0 0 7 78 2 6 73 10
                                  0 79 2 10 0 0 0 80 2 0 81 10 0 82 1 6
                                  15 0 83 1 6 15 0 84 0 10 0 85 1 10 0
                                  0 86 1 11 0 0 87 2 0 11 11 0 88 2 6
                                  81 10 0 89 1 10 0 0 90 2 0 11 11 0 91
                                  1 0 13 0 23 1 0 15 0 47 1 0 15 0 46 2
                                  0 34 0 9 35 1 0 15 0 48 2 0 15 0 0 54
                                  2 0 15 0 0 57 1 0 15 0 52 2 0 11 11 0
                                  91 2 0 11 11 0 88 2 0 81 10 0 82 1 0
                                  13 0 27 2 0 15 9 0 29 2 0 7 7 7 59 2
                                  0 73 10 0 74 2 0 0 0 9 32 2 0 0 0 9
                                  31 2 0 0 0 9 33 2 0 15 0 0 39)))))
          '|lookupComplete|)) 
