
(/VERSIONCHECK 2) 

(DEFUN |IDEAL;npoly| (|f| $)
  (COND
   ((SPADCALL |f| (|spadConstant| $ 13) (QREFELT $ 15)) (|spadConstant| $ 16))
   ('T
    (SPADCALL
     (SPADCALL (SPADCALL |f| (QREFELT $ 17))
               (SPADCALL 0 (SPADCALL |f| (QREFELT $ 20)) (QREFELT $ 22))
               (QREFELT $ 23))
     (|IDEAL;npoly| (SPADCALL |f| (QREFELT $ 24)) $) (QREFELT $ 25))))) 

(DEFUN |IDEAL;oldpoly| (|q| $)
  (PROG (|g| |n| |dq|)
    (RETURN
     (SEQ
      (COND
       ((SPADCALL |q| (|spadConstant| $ 16) (QREFELT $ 26))
        (CONS 0 (|spadConstant| $ 13)))
       (#1='T
        (SEQ (LETT |dq| (SPADCALL |q| (QREFELT $ 27)) . #2=(|IDEAL;oldpoly|))
             (LETT |n| (SPADCALL |dq| (QREFELT $ 28)) . #2#)
             (EXIT
              (COND
               ((EQL |n| 0)
                (SEQ
                 (LETT |g| (|IDEAL;oldpoly| (SPADCALL |q| (QREFELT $ 29)) $)
                       . #2#)
                 (EXIT
                  (COND ((QEQCAR |g| 1) (CONS 1 "failed"))
                        (#1#
                         (CONS 0
                               (SPADCALL
                                (SPADCALL (SPADCALL |q| (QREFELT $ 30))
                                          (SPADCALL |dq| (QREFELT $ 31))
                                          (QREFELT $ 32))
                                (QCDR |g|) (QREFELT $ 33))))))))
               (#1# (CONS 1 "failed"))))))))))) 

(DEFUN |IDEAL;leadterm| (|f| |lvar| $)
  (PROG (|lf|)
    (RETURN
     (COND
      ((OR (NULL (LETT |lf| (SPADCALL |f| (QREFELT $ 35)) |IDEAL;leadterm|))
           (SPADCALL |lf| |lvar| (QREFELT $ 36)))
       |f|)
      ('T
       (|IDEAL;leadterm|
        (SPADCALL (SPADCALL |f| (|SPADfirst| |lf|) (QREFELT $ 38))
                  (QREFELT $ 40))
        |lvar| $)))))) 

(DEFUN |IDEAL;choosel| (|f| |g| $)
  (PROG (|f1|)
    (RETURN
     (SEQ
      (COND ((SPADCALL |g| (|spadConstant| $ 13) (QREFELT $ 15)) |f|)
            (#1='T
             (SEQ (LETT |f1| (SPADCALL |f| |g| (QREFELT $ 42)) |IDEAL;choosel|)
                  (EXIT
                   (COND ((QEQCAR |f1| 1) |f|)
                         (#1# (|IDEAL;choosel| (QCDR |f1|) |g| $))))))))))) 

(DEFUN |IDEAL;contractGrob| (I1 $)
  (PROG (#1=#:G1825 #2=#:G1852 |f| #3=#:G1851 J1)
    (RETURN
     (SEQ (LETT J1 (SPADCALL I1 (QREFELT $ 45)) . #4=(|IDEAL;contractGrob|))
          (SEQ G190
               (COND
                ((NULL (QEQCAR (|IDEAL;oldpoly| (|SPADfirst| J1) $) 1))
                 #5=(GO G191)))
               (SEQ (EXIT (LETT J1 (CDR J1) . #4#))) NIL #6=(GO G190) G191
               (EXIT NIL))
          (EXIT
           (CONS
            (PROGN
             (LETT #3# NIL . #4#)
             (SEQ (LETT |f| NIL . #4#) (LETT #2# J1 . #4#) G190
                  (COND
                   ((OR (ATOM #2#) (PROGN (LETT |f| (CAR #2#) . #4#) NIL))
                    #5#))
                  (SEQ
                   (EXIT
                    (LETT #3#
                          (CONS
                           (PROG2
                               (LETT #1# (|IDEAL;oldpoly| |f| $) . #4#)
                               (QCDR #1#)
                             (|check-union| (QEQCAR #1# 0) (QREFELT $ 9) #1#))
                           #3#)
                          . #4#)))
                  (LETT #2# (CDR #2#) . #4#) #6# G191 (EXIT (NREVERSE0 #3#))))
            'T)))))) 

(DEFUN |IDEAL;makeleast| (|fullVars| |leastVars| $)
  (PROG (#1=#:G1858 |vv| #2=#:G1857 |n|)
    (RETURN
     (SEQ (LETT |n| (LENGTH |leastVars|) . #3=(|IDEAL;makeleast|))
          (EXIT
           (COND ((< (LENGTH |fullVars|) |n|) (|error| "wrong vars"))
                 ((EQL |n| 0) |fullVars|)
                 (#4='T
                  (APPEND
                   (PROGN
                    (LETT #2# NIL . #3#)
                    (SEQ (LETT |vv| NIL . #3#) (LETT #1# |fullVars| . #3#) G190
                         (COND
                          ((OR (ATOM #1#)
                               (PROGN (LETT |vv| (CAR #1#) . #3#) NIL))
                           (GO G191)))
                         (SEQ
                          (EXIT
                           (COND
                            ((COND
                              ((SPADCALL |vv| |leastVars| (QREFELT $ 46)) 'NIL)
                              (#4# 'T))
                             (LETT #2# (CONS |vv| #2#) . #3#)))))
                         (LETT #1# (CDR #1#) . #3#) (GO G190) G191
                         (EXIT (NREVERSE0 #2#))))
                   |leastVars|)))))))) 

(DEFUN |IDEAL;isMonic?| (|f| |x| $)
  (SPADCALL (SPADCALL (SPADCALL |f| |x| (QREFELT $ 38)) (QREFELT $ 40))
            (QREFELT $ 47))) 

(DEFUN |IDEAL;subset| (|lv| $)
  (PROG (|l1| #1=#:G1874 |set| #2=#:G1873 |ll| |v|)
    (RETURN
     (SEQ
      (COND ((EQL (LENGTH |lv|) 1) (LIST |lv| NIL))
            ('T
             (SEQ
              (LETT |v| (SPADCALL |lv| 1 (QREFELT $ 51)) . #3=(|IDEAL;subset|))
              (LETT |ll| (|IDEAL;subset| (CDR |lv|) $) . #3#)
              (LETT |l1|
                    (PROGN
                     (LETT #2# NIL . #3#)
                     (SEQ (LETT |set| NIL . #3#) (LETT #1# |ll| . #3#) G190
                          (COND
                           ((OR (ATOM #1#)
                                (PROGN (LETT |set| (CAR #1#) . #3#) NIL))
                            (GO G191)))
                          (SEQ
                           (EXIT (LETT #2# (CONS (CONS |v| |set|) #2#) . #3#)))
                          (LETT #1# (CDR #1#) . #3#) (GO G190) G191
                          (EXIT (NREVERSE0 #2#))))
                    . #3#)
              (EXIT (SPADCALL |l1| |ll| (QREFELT $ 53)))))))))) 

(DEFUN |IDEAL;monomDim| (|listm| |lv| $)
  (PROG (#1=#:G1886 |ldif| #2=#:G1889 |mvset| #3=#:G1888 |subs| |lsubset|
         |monvar| #4=#:G1887 |f|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ (LETT |monvar| NIL . #5=(|IDEAL;monomDim|))
            (SEQ (LETT |f| NIL . #5#)
                 (LETT #4# (SPADCALL |listm| (QREFELT $ 55)) . #5#) G190
                 (COND
                  ((OR (ATOM #4#) (PROGN (LETT |f| (CAR #4#) . #5#) NIL))
                   #6=(GO G191)))
                 (SEQ (LETT |mvset| (SPADCALL |f| (QREFELT $ 35)) . #5#)
                      (EXIT
                       (COND
                        ((< 1 (LENGTH |mvset|))
                         (LETT |monvar| (CONS |mvset| |monvar|) . #5#))
                        ('T
                         (LETT |lv|
                               (SPADCALL |lv|
                                         (SPADCALL
                                          (SPADCALL |mvset| 1 (QREFELT $ 51))
                                          |lv| (QREFELT $ 61))
                                         (QREFELT $ 62))
                               . #5#)))))
                 (LETT #4# (CDR #4#) . #5#) #7=(GO G190) G191 (EXIT NIL))
            (EXIT
             (COND ((NULL |lv|) 0)
                   ('T
                    (SEQ
                     (LETT |lsubset|
                           (SPADCALL (CONS #'|IDEAL;monomDim!0| $)
                                     (|IDEAL;subset| |lv| $) (QREFELT $ 66))
                           . #5#)
                     (SEQ (LETT |subs| NIL . #5#) (LETT #3# |lsubset| . #5#)
                          G190
                          (COND
                           ((OR (ATOM #3#)
                                (PROGN (LETT |subs| (CAR #3#) . #5#) NIL))
                            #6#))
                          (SEQ (LETT |ldif| |lv| . #5#)
                               (SEQ (LETT |mvset| NIL . #5#)
                                    (LETT #2# |monvar| . #5#) G190
                                    (COND
                                     ((OR (ATOM #2#)
                                          (PROGN
                                           (LETT |mvset| (CAR #2#) . #5#)
                                           NIL)
                                          (NULL
                                           (COND
                                            ((SPADCALL |ldif| NIL
                                                       (QREFELT $ 36))
                                             'NIL)
                                            ('T 'T))))
                                      #6#))
                                    (SEQ
                                     (EXIT
                                      (LETT |ldif|
                                            (SPADCALL |mvset| |subs|
                                                      (QREFELT $ 67))
                                            . #5#)))
                                    (LETT #2# (CDR #2#) . #5#) #7# G191
                                    (EXIT NIL))
                               (EXIT
                                (COND
                                 ((NULL (NULL |ldif|))
                                  (PROGN
                                   (LETT #1# (LENGTH |subs|) . #5#)
                                   (GO #1#))))))
                          (LETT #3# (CDR #3#) . #5#) #7# G191 (EXIT NIL))
                     (EXIT 0)))))))
      #1# (EXIT #1#))))) 

(DEFUN |IDEAL;monomDim!0| (|z1| |z2| $)
  (SPADCALL (SPADCALL |z2| (QREFELT $ 63)) (SPADCALL |z1| (QREFELT $ 63))
            (QREFELT $ 64))) 

(DEFUN |IDEAL;=;2$B;10| (I J $)
  (COND ((SPADCALL I J (QREFELT $ 68)) (SPADCALL J I (QREFELT $ 68)))
        ('T 'NIL))) 

(DEFUN |IDEAL;element?;DPoly$B;11| (|f| I $)
  (PROG (|Id|)
    (RETURN
     (SEQ
      (LETT |Id| (QCAR (SPADCALL I (QREFELT $ 70)))
            |IDEAL;element?;DPoly$B;11|)
      (EXIT
       (COND ((NULL |Id|) (SPADCALL |f| (|spadConstant| $ 13) (QREFELT $ 15)))
             ('T
              (SPADCALL (SPADCALL |f| |Id| (QREFELT $ 72))
                        (|spadConstant| $ 13) (QREFELT $ 15))))))))) 

(DEFUN |IDEAL;in?;2$B;12| (I J $)
  (PROG (#1=#:G1896 #2=#:G1895 #3=#:G1897 #4=#:G1900 |f|)
    (RETURN
     (SEQ (LETT J (SPADCALL J (QREFELT $ 70)) . #5=(|IDEAL;in?;2$B;12|))
          (EXIT
           (COND ((NULL (QCAR I)) 'T)
                 (#6='T
                  (PROGN
                   (LETT #1# NIL . #5#)
                   (SEQ (LETT |f| NIL . #5#) (LETT #4# (QCAR I) . #5#) G190
                        (COND
                         ((OR (ATOM #4#)
                              (PROGN (LETT |f| (CAR #4#) . #5#) NIL))
                          (GO G191)))
                        (SEQ
                         (EXIT
                          (PROGN
                           (LETT #3# (SPADCALL |f| J (QREFELT $ 73)) . #5#)
                           (COND
                            (#1# (LETT #2# (COND (#2# #3#) ('T 'NIL)) . #5#))
                            ('T
                             (PROGN
                              (LETT #2# #3# . #5#)
                              (LETT #1# 'T . #5#)))))))
                        (LETT #4# (CDR #4#) . #5#) (GO G190) G191 (EXIT NIL))
                   (COND (#1# #2#) (#6# 'T)))))))))) 

(DEFUN |IDEAL;groebner;2$;13| (I $)
  (PROG (#1=#:G1902 #2=#:G1901 #3=#:G1903 #4=#:G1908 |f|)
    (RETURN
     (SEQ
      (COND
       ((QCDR I)
        (COND
         ((PROGN
           (LETT #1# NIL . #5=(|IDEAL;groebner;2$;13|))
           (SEQ (LETT |f| NIL . #5#) (LETT #4# (QCAR I) . #5#) G190
                (COND
                 ((OR (ATOM #4#) (PROGN (LETT |f| (CAR #4#) . #5#) NIL))
                  (GO G191)))
                (SEQ
                 (EXIT
                  (PROGN
                   (LETT #3#
                         (COND ((SPADCALL |f| (QREFELT $ 74)) 'NIL) ('T 'T))
                         . #5#)
                   (COND (#1# (LETT #2# (COND (#2# 'T) ('T #3#)) . #5#))
                         ('T
                          (PROGN (LETT #2# #3# . #5#) (LETT #1# 'T . #5#)))))))
                (LETT #4# (CDR #4#) . #5#) (GO G190) G191 (EXIT NIL))
           (COND (#1# #2#) (#6='T 'NIL)))
          I)
         (#6# (CONS NIL 'T))))
       (#6# (CONS (SPADCALL (QCAR I) (QREFELT $ 75)) 'T))))))) 

(DEFUN |IDEAL;intersect;3$;14| (I J $)
  (PROG (#1=#:G1919 |f| #2=#:G1918 #3=#:G1917 #4=#:G1916 |tp1| |tp| |Jd| |Id|)
    (RETURN
     (SEQ
      (COND ((NULL (LETT |Id| (QCAR I) . #5=(|IDEAL;intersect;3$;14|))) I)
            ((NULL (LETT |Jd| (QCAR J) . #5#)) J)
            ('T
             (SEQ
              (LETT |tp|
                    (SPADCALL (|spadConstant| $ 48)
                              (SPADCALL 1 (|spadConstant| $ 19) (QREFELT $ 22))
                              (QREFELT $ 23))
                    . #5#)
              (LETT |tp1| (SPADCALL |tp| (|spadConstant| $ 57) (QREFELT $ 76))
                    . #5#)
              (EXIT
               (|IDEAL;contractGrob|
                (SPADCALL
                 (PROGN
                  (LETT #4# NIL . #5#)
                  (SEQ (LETT |f| NIL . #5#) (LETT #3# |Id| . #5#) G190
                       (COND
                        ((OR (ATOM #3#) (PROGN (LETT |f| (CAR #3#) . #5#) NIL))
                         #6=(GO G191)))
                       (SEQ
                        (EXIT
                         (LETT #4#
                               (CONS
                                (SPADCALL |tp| (|IDEAL;npoly| |f| $)
                                          (QREFELT $ 77))
                                #4#)
                               . #5#)))
                       (LETT #3# (CDR #3#) . #5#) #7=(GO G190) G191
                       (EXIT (NREVERSE0 #4#))))
                 (PROGN
                  (LETT #2# NIL . #5#)
                  (SEQ (LETT |f| NIL . #5#) (LETT #1# |Jd| . #5#) G190
                       (COND
                        ((OR (ATOM #1#) (PROGN (LETT |f| (CAR #1#) . #5#) NIL))
                         #6#))
                       (SEQ
                        (EXIT
                         (LETT #2#
                               (CONS
                                (SPADCALL |tp1| (|IDEAL;npoly| |f| $)
                                          (QREFELT $ 77))
                                #2#)
                               . #5#)))
                       (LETT #1# (CDR #1#) . #5#) #7# G191
                       (EXIT (NREVERSE0 #2#))))
                 (QREFELT $ 78))
                $))))))))) 

(DEFUN |IDEAL;intersect;L$;15| (|lid| $)
  (PROG (#1=#:G1921 #2=#:G1920 #3=#:G1922 #4=#:G1924 |l|)
    (RETURN
     (SEQ
      (PROGN
       (LETT #1# NIL . #5=(|IDEAL;intersect;L$;15|))
       (SEQ (LETT |l| NIL . #5#) (LETT #4# |lid| . #5#) G190
            (COND
             ((OR (ATOM #4#) (PROGN (LETT |l| (CAR #4#) . #5#) NIL))
              (GO G191)))
            (SEQ
             (EXIT
              (PROGN
               (LETT #3# |l| . #5#)
               (COND (#1# (LETT #2# (SPADCALL #2# #3# (QREFELT $ 79)) . #5#))
                     ('T (PROGN (LETT #2# #3# . #5#) (LETT #1# 'T . #5#)))))))
            (LETT #4# (CDR #4#) . #5#) (GO G190) G191 (EXIT NIL))
       (COND (#1# #2#) ('T (|IdentityError| '|intersect|)))))))) 

(DEFUN |IDEAL;quotient;$DPoly$;16| (I |f| $)
  (PROG (#1=#:G1825 #2=#:G1930 |g| #3=#:G1929)
    (RETURN
     (SEQ
      (CONS
       (SPADCALL
        (PROGN
         (LETT #3# NIL . #4=(|IDEAL;quotient;$DPoly$;16|))
         (SEQ (LETT |g| NIL . #4#)
              (LETT #2#
                    (QCAR
                     (SPADCALL I (SPADCALL (LIST |f|) (QREFELT $ 82))
                               (QREFELT $ 79)))
                    . #4#)
              G190
              (COND
               ((OR (ATOM #2#) (PROGN (LETT |g| (CAR #2#) . #4#) NIL))
                (GO G191)))
              (SEQ
               (EXIT
                (LETT #3#
                      (CONS
                       (PROG2
                           (LETT #1# (SPADCALL |g| |f| (QREFELT $ 42)) . #4#)
                           (QCDR #1#)
                         (|check-union| (QEQCAR #1# 0) (QREFELT $ 9) #1#))
                       #3#)
                      . #4#)))
              (LETT #2# (CDR #2#) . #4#) (GO G190) G191
              (EXIT (NREVERSE0 #3#))))
        (QREFELT $ 84))
       'T))))) 

(DEFUN |IDEAL;quotient;3$;17| (I J $)
  (PROG (#1=#:G1935 #2=#:G1934 #3=#:G1936 #4=#:G1939 |f| |Jdl|)
    (RETURN
     (SEQ (LETT |Jdl| (QCAR J) . #5=(|IDEAL;quotient;3$;17|))
          (EXIT
           (COND
            ((NULL |Jdl|)
             (SPADCALL (LIST (|spadConstant| $ 49)) (QREFELT $ 86)))
            (#6='T
             (CONS
              (QCAR
               (PROGN
                (LETT #1# NIL . #5#)
                (SEQ (LETT |f| NIL . #5#) (LETT #4# |Jdl| . #5#) G190
                     (COND
                      ((OR (ATOM #4#) (PROGN (LETT |f| (CAR #4#) . #5#) NIL))
                       (GO G191)))
                     (SEQ
                      (EXIT
                       (PROGN
                        (LETT #3# (SPADCALL I |f| (QREFELT $ 85)) . #5#)
                        (COND
                         (#1#
                          (LETT #2# (SPADCALL #2# #3# (QREFELT $ 79)) . #5#))
                         ('T
                          (PROGN (LETT #2# #3# . #5#) (LETT #1# 'T . #5#)))))))
                     (LETT #4# (CDR #4#) . #5#) (GO G190) G191 (EXIT NIL))
                (COND (#1# #2#) (#6# (|IdentityError| '|intersect|)))))
              'T)))))))) 

(DEFUN |IDEAL;+;3$;18| (I J $)
  (CONS (SPADCALL (SPADCALL (QCAR I) (QCAR J) (QREFELT $ 88)) (QREFELT $ 75))
        'T)) 

(DEFUN |IDEAL;*;3$;19| (I J $)
  (PROG (#1=#:G1942 #2=#:G1941 #3=#:G1943 #4=#:G1948 |f| #5=#:G1947 #6=#:G1946
         |g|)
    (RETURN
     (SEQ
      (CONS
       (SPADCALL
        (PROGN
         (LETT #1# NIL . #7=(|IDEAL;*;3$;19|))
         (SEQ (LETT |g| NIL . #7#) (LETT #6# (QCAR J) . #7#) G190
              (COND
               ((OR (ATOM #6#) (PROGN (LETT |g| (CAR #6#) . #7#) NIL))
                #8=(GO G191)))
              (SEQ
               (EXIT
                (PROGN
                 (LETT #3#
                       (PROGN
                        (LETT #5# NIL . #7#)
                        (SEQ (LETT |f| NIL . #7#) (LETT #4# (QCAR I) . #7#)
                             G190
                             (COND
                              ((OR (ATOM #4#)
                                   (PROGN (LETT |f| (CAR #4#) . #7#) NIL))
                               #8#))
                             (SEQ
                              (EXIT
                               (LETT #5#
                                     (CONS (SPADCALL |f| |g| (QREFELT $ 90))
                                           #5#)
                                     . #7#)))
                             (LETT #4# (CDR #4#) . #7#) #9=(GO G190) G191
                             (EXIT (NREVERSE0 #5#))))
                       . #7#)
                 (COND (#1# (LETT #2# (APPEND #2# #3#) . #7#))
                       ('T
                        (PROGN (LETT #2# #3# . #7#) (LETT #1# 'T . #7#)))))))
              (LETT #6# (CDR #6#) . #7#) #9# G191 (EXIT NIL))
         (COND (#1# #2#) ('T NIL)))
        (QREFELT $ 75))
       'T))))) 

(DEFUN |IDEAL;^;$Nni$;20| (I |n| $)
  (PROG (#1=#:G1949)
    (RETURN
     (COND ((EQL |n| 0) (CONS (LIST (|spadConstant| $ 49)) 'T))
           ('T
            (SPADCALL I
                      (SPADCALL I
                                (PROG1 (LETT #1# (- |n| 1) |IDEAL;^;$Nni$;20|)
                                  (|check-subtype| (>= #1# 0)
                                                   '(|NonNegativeInteger|)
                                                   #1#))
                                (QREFELT $ 92))
                      (QREFELT $ 91))))))) 

(DEFUN |IDEAL;saturate;$DPoly$;21| (I |f| $)
  (PROG (#1=#:G1955 |g| #2=#:G1954 |tp|)
    (RETURN
     (SEQ
      (COND
       ((SPADCALL |f| (|spadConstant| $ 13) (QREFELT $ 15))
        (|error| "f is zero"))
       ('T
        (SEQ
         (LETT |tp|
               (SPADCALL
                (SPADCALL
                 (SPADCALL (|spadConstant| $ 48)
                           (SPADCALL 1 (|spadConstant| $ 19) (QREFELT $ 22))
                           (QREFELT $ 23))
                 (|IDEAL;npoly| |f| $) (QREFELT $ 77))
                (|spadConstant| $ 57) (QREFELT $ 76))
               . #3=(|IDEAL;saturate;$DPoly$;21|))
         (EXIT
          (|IDEAL;contractGrob|
           (CONS |tp|
                 (PROGN
                  (LETT #2# NIL . #3#)
                  (SEQ (LETT |g| NIL . #3#) (LETT #1# (QCAR I) . #3#) G190
                       (COND
                        ((OR (ATOM #1#) (PROGN (LETT |g| (CAR #1#) . #3#) NIL))
                         (GO G191)))
                       (SEQ
                        (EXIT
                         (LETT #2# (CONS (|IDEAL;npoly| |g| $) #2#) . #3#)))
                       (LETT #1# (CDR #1#) . #3#) (GO G190) G191
                       (EXIT (NREVERSE0 #2#)))))
           $))))))))) 

(DEFUN |IDEAL;saturate;$DPolyL$;22| (I |f| |lvar| $)
  (PROG (#1=#:G1981 |g| #2=#:G1980 |fullPol| #3=#:G1979 |vv| #4=#:G1978 |s|
         #5=#:G1964 #6=#:G1963 #7=#:G1965 #8=#:G1977 |ltg| |ltJ| #9=#:G1976
         #10=#:G1975 J #11=#:G1974 #12=#:G1973 |subVars| #13=#:G1972
         #14=#:G1971 |newVars| |fullVars| #15=#:G1957 #16=#:G1956 #17=#:G1958
         #18=#:G1970 |Id|)
    (RETURN
     (SEQ (LETT |Id| (QCAR I) . #19=(|IDEAL;saturate;$DPolyL$;22|))
          (LETT |fullVars|
                (PROGN
                 (LETT #15# NIL . #19#)
                 (SEQ (LETT |g| NIL . #19#) (LETT #18# |Id| . #19#) G190
                      (COND
                       ((OR (ATOM #18#)
                            (PROGN (LETT |g| (CAR #18#) . #19#) NIL))
                        #20=(GO G191)))
                      (SEQ
                       (EXIT
                        (PROGN
                         (LETT #17# (SPADCALL |g| (QREFELT $ 35)) . #19#)
                         (COND
                          (#15#
                           (LETT #16# (SPADCALL #16# #17# (QREFELT $ 94))
                                 . #19#))
                          ('T
                           (PROGN
                            (LETT #16# #17# . #19#)
                            (LETT #15# 'T . #19#)))))))
                      (LETT #18# (CDR #18#) . #19#) #21=(GO G190) G191
                      (EXIT NIL))
                 (COND (#15# #16#) (#22='T (|IdentityError| '|setUnion|))))
                . #19#)
          (LETT |newVars| (|IDEAL;makeleast| |fullVars| |lvar| $) . #19#)
          (LETT |subVars|
                (PROGN
                 (LETT #14# NIL . #19#)
                 (SEQ (LETT |vv| NIL . #19#) (LETT #13# |newVars| . #19#) G190
                      (COND
                       ((OR (ATOM #13#)
                            (PROGN (LETT |vv| (CAR #13#) . #19#) NIL))
                        #20#))
                      (SEQ
                       (EXIT
                        (LETT #14#
                              (CONS
                               (SPADCALL (|spadConstant| $ 49) |vv| 1
                                         (QREFELT $ 95))
                               #14#)
                              . #19#)))
                      (LETT #13# (CDR #13#) . #19#) #21# G191
                      (EXIT (NREVERSE0 #14#))))
                . #19#)
          (LETT J
                (SPADCALL
                 (PROGN
                  (LETT #12# NIL . #19#)
                  (SEQ (LETT |g| NIL . #19#) (LETT #11# |Id| . #19#) G190
                       (COND
                        ((OR (ATOM #11#)
                             (PROGN (LETT |g| (CAR #11#) . #19#) NIL))
                         #20#))
                       (SEQ
                        (EXIT
                         (LETT #12#
                               (CONS
                                (SPADCALL |g| |fullVars| |subVars|
                                          (QREFELT $ 96))
                                #12#)
                               . #19#)))
                       (LETT #11# (CDR #11#) . #19#) #21# G191
                       (EXIT (NREVERSE0 #12#))))
                 (QREFELT $ 75))
                . #19#)
          (LETT |ltJ|
                (PROGN
                 (LETT #10# NIL . #19#)
                 (SEQ (LETT |g| NIL . #19#) (LETT #9# J . #19#) G190
                      (COND
                       ((OR (ATOM #9#) (PROGN (LETT |g| (CAR #9#) . #19#) NIL))
                        #20#))
                      (SEQ
                       (EXIT
                        (LETT #10# (CONS (|IDEAL;leadterm| |g| |lvar| $) #10#)
                              . #19#)))
                      (LETT #9# (CDR #9#) . #19#) #21# G191
                      (EXIT (NREVERSE0 #10#))))
                . #19#)
          (LETT |s|
                (PROGN
                 (LETT #5# NIL . #19#)
                 (SEQ (LETT |ltg| NIL . #19#) (LETT #8# |ltJ| . #19#) G190
                      (COND
                       ((OR (ATOM #8#)
                            (PROGN (LETT |ltg| (CAR #8#) . #19#) NIL))
                        #20#))
                      (SEQ
                       (EXIT
                        (PROGN
                         (LETT #7# (|IDEAL;choosel| |ltg| |f| $) . #19#)
                         (COND
                          (#5#
                           (LETT #6# (SPADCALL #6# #7# (QREFELT $ 90)) . #19#))
                          ('T
                           (PROGN
                            (LETT #6# #7# . #19#)
                            (LETT #5# 'T . #19#)))))))
                      (LETT #8# (CDR #8#) . #19#) #21# G191 (EXIT NIL))
                 (COND (#5# #6#) (#22# (|spadConstant| $ 49))))
                . #19#)
          (LETT |fullPol|
                (PROGN
                 (LETT #4# NIL . #19#)
                 (SEQ (LETT |vv| NIL . #19#) (LETT #3# |fullVars| . #19#) G190
                      (COND
                       ((OR (ATOM #3#)
                            (PROGN (LETT |vv| (CAR #3#) . #19#) NIL))
                        #20#))
                      (SEQ
                       (EXIT
                        (LETT #4#
                              (CONS
                               (SPADCALL (|spadConstant| $ 49) |vv| 1
                                         (QREFELT $ 95))
                               #4#)
                              . #19#)))
                      (LETT #3# (CDR #3#) . #19#) #21# G191
                      (EXIT (NREVERSE0 #4#))))
                . #19#)
          (EXIT
           (CONS
            (PROGN
             (LETT #2# NIL . #19#)
             (SEQ (LETT |g| NIL . #19#)
                  (LETT #1#
                        (QCAR
                         (SPADCALL (SPADCALL J (QREFELT $ 82)) |s|
                                   (QREFELT $ 93)))
                        . #19#)
                  G190
                  (COND
                   ((OR (ATOM #1#) (PROGN (LETT |g| (CAR #1#) . #19#) NIL))
                    #20#))
                  (SEQ
                   (EXIT
                    (LETT #2#
                          (CONS
                           (SPADCALL |g| |newVars| |fullPol| (QREFELT $ 96))
                           #2#)
                          . #19#)))
                  (LETT #1# (CDR #1#) . #19#) #21# G191
                  (EXIT (NREVERSE0 #2#))))
            'T)))))) 

(DEFUN |IDEAL;zeroDim?;$LB;23| (I |lvar| $)
  (PROG (|x| #1=#:G1987 #2=#:G1996 |f| |n| J)
    (RETURN
     (SEQ
      (LETT J (QCAR (SPADCALL I (QREFELT $ 70)))
            . #3=(|IDEAL;zeroDim?;$LB;23|))
      (EXIT
       (COND
        ((OR (NULL J) (SPADCALL J (LIST (|spadConstant| $ 49)) (QREFELT $ 98)))
         'NIL)
        ('T
         (SEQ (LETT |n| (LENGTH |lvar|) . #3#)
              (EXIT
               (COND ((< (LENGTH J) |n|) 'NIL)
                     ('T
                      (SEQ
                       (SEQ (LETT |f| NIL . #3#) (LETT #2# J . #3#) G190
                            (COND
                             ((OR (ATOM #2#)
                                  (PROGN (LETT |f| (CAR #2#) . #3#) NIL)
                                  (NULL (COND ((NULL |lvar|) 'NIL) ('T 'T))))
                              (GO G191)))
                            (SEQ
                             (LETT |x|
                                   (PROG2
                                       (LETT #1# (SPADCALL |f| (QREFELT $ 100))
                                             . #3#)
                                       (QCDR #1#)
                                     (|check-union| (QEQCAR #1# 0)
                                                    (QREFELT $ 8) #1#))
                                   . #3#)
                             (EXIT
                              (COND
                               ((|IDEAL;isMonic?| |f| |x| $)
                                (LETT |lvar|
                                      (SPADCALL |lvar|
                                                (SPADCALL |x| |lvar|
                                                          (QREFELT $ 61))
                                                (QREFELT $ 62))
                                      . #3#)))))
                            (LETT #2# (CDR #2#) . #3#) (GO G190) G191
                            (EXIT NIL))
                       (EXIT (NULL |lvar|)))))))))))))) 

(DEFUN |IDEAL;zeroDim?;$B;24| (I $)
  (PROG (#1=#:G1998 #2=#:G1997 #3=#:G1999 #4=#:G2002 |g|)
    (RETURN
     (SEQ
      (SPADCALL I
                (PROGN
                 (LETT #1# NIL . #5=(|IDEAL;zeroDim?;$B;24|))
                 (SEQ (LETT |g| NIL . #5#) (LETT #4# (QCAR I) . #5#) G190
                      (COND
                       ((OR (ATOM #4#) (PROGN (LETT |g| (CAR #4#) . #5#) NIL))
                        (GO G191)))
                      (SEQ
                       (EXIT
                        (PROGN
                         (LETT #3# (SPADCALL |g| (QREFELT $ 35)) . #5#)
                         (COND
                          (#1#
                           (LETT #2# (SPADCALL #2# #3# (QREFELT $ 94)) . #5#))
                          ('T
                           (PROGN
                            (LETT #2# #3# . #5#)
                            (LETT #1# 'T . #5#)))))))
                      (LETT #4# (CDR #4#) . #5#) (GO G190) G191 (EXIT NIL))
                 (COND (#1# #2#) ('T (|IdentityError| '|setUnion|))))
                (QREFELT $ 101)))))) 

(DEFUN |IDEAL;inRadical?;DPoly$B;25| (|f| I $)
  (PROG (#1=#:G2064 |g| #2=#:G2063 |Id| |tp|)
    (RETURN
     (SEQ
      (COND ((SPADCALL |f| (|spadConstant| $ 13) (QREFELT $ 15)) 'T)
            ('T
             (SEQ
              (LETT |tp|
                    (SPADCALL
                     (SPADCALL
                      (SPADCALL (|spadConstant| $ 48)
                                (SPADCALL 1 (|spadConstant| $ 19)
                                          (QREFELT $ 22))
                                (QREFELT $ 23))
                      (|IDEAL;npoly| |f| $) (QREFELT $ 77))
                     (|spadConstant| $ 57) (QREFELT $ 76))
                    . #3=(|IDEAL;inRadical?;DPoly$B;25|))
              (LETT |Id| (QCAR I) . #3#)
              (EXIT
               (SPADCALL
                (SPADCALL (|spadConstant| $ 57)
                          (SPADCALL
                           (CONS |tp|
                                 (PROGN
                                  (LETT #2# NIL . #3#)
                                  (SEQ (LETT |g| NIL . #3#)
                                       (LETT #1# |Id| . #3#) G190
                                       (COND
                                        ((OR (ATOM #1#)
                                             (PROGN
                                              (LETT |g| (CAR #1#) . #3#)
                                              NIL))
                                         (GO G191)))
                                       (SEQ
                                        (EXIT
                                         (LETT #2#
                                               (CONS (|IDEAL;npoly| |g| $) #2#)
                                               . #3#)))
                                       (LETT #1# (CDR #1#) . #3#) (GO G190)
                                       G191 (EXIT (NREVERSE0 #2#)))))
                           (QREFELT $ 45))
                          (QREFELT $ 103))
                (|spadConstant| $ 16) (QREFELT $ 26)))))))))) 

(DEFUN |IDEAL;dimension;$LI;26| (I |lvar| $)
  (PROG (|n1| |leadid| |ed| |truelist| #1=#:G2070 #2=#:G2069 #3=#:G2071
         #4=#:G2079 |vv| #5=#:G2066 #6=#:G2065 #7=#:G2067 #8=#:G2078 |f|)
    (RETURN
     (SEQ (LETT I (SPADCALL I (QREFELT $ 70)) . #9=(|IDEAL;dimension;$LI;26|))
          (EXIT
           (COND ((NULL (QCAR I)) (LENGTH |lvar|))
                 ((SPADCALL (|spadConstant| $ 49) I (QREFELT $ 73)) -1)
                 (#10='T
                  (SEQ
                   (LETT |truelist|
                         (PROGN
                          (LETT #5# NIL . #9#)
                          (SEQ (LETT |f| NIL . #9#) (LETT #8# (QCAR I) . #9#)
                               G190
                               (COND
                                ((OR (ATOM #8#)
                                     (PROGN (LETT |f| (CAR #8#) . #9#) NIL))
                                 #11=(GO G191)))
                               (SEQ
                                (EXIT
                                 (PROGN
                                  (LETT #7# (SPADCALL |f| (QREFELT $ 35))
                                        . #9#)
                                  (COND
                                   (#5#
                                    (LETT #6# (SPADCALL #6# #7# (QREFELT $ 94))
                                          . #9#))
                                   ('T
                                    (PROGN
                                     (LETT #6# #7# . #9#)
                                     (LETT #5# 'T . #9#)))))))
                               (LETT #8# (CDR #8#) . #9#) #12=(GO G190) G191
                               (EXIT NIL))
                          (COND (#5# #6#)
                                (#10# (|IdentityError| '|setUnion|))))
                         . #9#)
                   (EXIT
                    (COND
                     ((PROGN
                       (LETT #1# NIL . #9#)
                       (SEQ (LETT |vv| NIL . #9#) (LETT #4# |truelist| . #9#)
                            G190
                            (COND
                             ((OR (ATOM #4#)
                                  (PROGN (LETT |vv| (CAR #4#) . #9#) NIL))
                              #11#))
                            (SEQ
                             (EXIT
                              (PROGN
                               (LETT #3#
                                     (COND
                                      ((SPADCALL |vv| |lvar| (QREFELT $ 46))
                                       'NIL)
                                      ('T 'T))
                                     . #9#)
                               (COND
                                (#1# (LETT #2# (COND (#2# 'T) ('T #3#)) . #9#))
                                ('T
                                 (PROGN
                                  (LETT #2# #3# . #9#)
                                  (LETT #1# 'T . #9#)))))))
                            (LETT #4# (CDR #4#) . #9#) #12# G191 (EXIT NIL))
                       (COND (#1# #2#) (#10# 'NIL)))
                      (|error| "wrong variables"))
                     (#10#
                      (SEQ
                       (LETT |truelist|
                             (SPADCALL |lvar|
                                       (SPADCALL |lvar| |truelist|
                                                 (QREFELT $ 67))
                                       (QREFELT $ 67))
                             . #9#)
                       (LETT |ed| (- (LENGTH |lvar|) (LENGTH |truelist|))
                             . #9#)
                       (LETT |leadid| (SPADCALL I (QREFELT $ 105)) . #9#)
                       (LETT |n1| (|IDEAL;monomDim| |leadid| |truelist| $)
                             . #9#)
                       (EXIT (+ |ed| |n1|)))))))))))))) 

(DEFUN |IDEAL;dimension;$I;27| (I $)
  (PROG (#1=#:G2081 #2=#:G2080 #3=#:G2082 #4=#:G2085 |g|)
    (RETURN
     (SEQ
      (SPADCALL I
                (PROGN
                 (LETT #1# NIL . #5=(|IDEAL;dimension;$I;27|))
                 (SEQ (LETT |g| NIL . #5#) (LETT #4# (QCAR I) . #5#) G190
                      (COND
                       ((OR (ATOM #4#) (PROGN (LETT |g| (CAR #4#) . #5#) NIL))
                        (GO G191)))
                      (SEQ
                       (EXIT
                        (PROGN
                         (LETT #3# (SPADCALL |g| (QREFELT $ 35)) . #5#)
                         (COND
                          (#1#
                           (LETT #2# (SPADCALL #2# #3# (QREFELT $ 94)) . #5#))
                          ('T
                           (PROGN
                            (LETT #2# #3# . #5#)
                            (LETT #1# 'T . #5#)))))))
                      (LETT #4# (CDR #4#) . #5#) (GO G190) G191 (EXIT NIL))
                 (COND (#1# #2#) ('T (|IdentityError| '|setUnion|))))
                (QREFELT $ 106)))))) 

(DEFUN |IDEAL;leadingIdeal;2$;28| (I $)
  (PROG (#1=#:G2090 |f| #2=#:G2089 |Idl|)
    (RETURN
     (SEQ
      (LETT |Idl| (QCAR (SPADCALL I (QREFELT $ 70)))
            . #3=(|IDEAL;leadingIdeal;2$;28|))
      (EXIT
       (CONS
        (PROGN
         (LETT #2# NIL . #3#)
         (SEQ (LETT |f| NIL . #3#) (LETT #1# |Idl| . #3#) G190
              (COND
               ((OR (ATOM #1#) (PROGN (LETT |f| (CAR #1#) . #3#) NIL))
                (GO G191)))
              (SEQ
               (EXIT
                (LETT #2#
                      (CONS
                       (SPADCALL |f| (SPADCALL |f| (QREFELT $ 24))
                                 (QREFELT $ 108))
                       #2#)
                      . #3#)))
              (LETT #1# (CDR #1#) . #3#) (GO G190) G191
              (EXIT (NREVERSE0 #2#))))
        'T)))))) 

(DEFUN |IDEAL;monompol| (|df| |lcf| |lv| $)
  (PROG (|g| #1=#:G2094 |dd| #2=#:G2095 |v|)
    (RETURN
     (SEQ (LETT |g| (SPADCALL |lcf| (QREFELT $ 110)) . #3=(|IDEAL;monompol|))
          (SEQ (LETT |v| NIL . #3#) (LETT #2# |lv| . #3#) (LETT |dd| NIL . #3#)
               (LETT #1# |df| . #3#) G190
               (COND
                ((OR (ATOM #1#) (PROGN (LETT |dd| (CAR #1#) . #3#) NIL)
                     (ATOM #2#) (PROGN (LETT |v| (CAR #2#) . #3#) NIL))
                 (GO G191)))
               (SEQ
                (EXIT
                 (LETT |g|
                       (SPADCALL |g| (SPADCALL |v| (QREFELT $ 112)) |dd|
                                 (QREFELT $ 113))
                       . #3#)))
               (LETT #1# (PROG1 (CDR #1#) (LETT #2# (CDR #2#) . #3#)) . #3#)
               (GO G190) G191 (EXIT NIL))
          (EXIT |g|))))) 

(DEFUN |IDEAL;relationsIdeal;LSt;30| (|listf| $)
  (PROG (|solsn| |g| #1=#:G2122 #2=#:G2121 #3=#:G2123 #4=#:G2144 |p| |j| |vdq|
         |q| |lcq| |dq| #5=#:G2143 |lf| #6=#:G2120 |n| |leq| #7=#:G2141
         #8=#:G2142 |pol| #9=#:G2140 |npol| #10=#:G2139 |v| #11=#:G2138 |lp|
         |f| |lcf| |df| |vec2| #12=#:G2137 |i| |gp| |nPoly| |nExponent| |DirP|
         |lv1| #13=#:G2110 #14=#:G2136 |vv| #15=#:G2135 |VarSet1| |nvar|
         #16=#:G2134 |vl| #17=#:G2133 #18=#:G2132 |lvint| #19=#:G2097
         #20=#:G2096 #21=#:G2098 #22=#:G2131 |nf|)
    (RETURN
     (SEQ
      (COND ((NULL |listf|) (SPADCALL NIL NIL (QREFELT $ 117)))
            (#23='T
             (SEQ
              (LETT |nf| (LENGTH |listf|)
                    . #24=(|IDEAL;relationsIdeal;LSt;30|))
              (LETT |lvint|
                    (PROGN
                     (LETT #19# NIL . #24#)
                     (SEQ (LETT |g| NIL . #24#) (LETT #22# |listf| . #24#) G190
                          (COND
                           ((OR (ATOM #22#)
                                (PROGN (LETT |g| (CAR #22#) . #24#) NIL))
                            #25=(GO G191)))
                          (SEQ
                           (EXIT
                            (PROGN
                             (LETT #21# (SPADCALL |g| (QREFELT $ 35)) . #24#)
                             (COND
                              (#19#
                               (LETT #20# (SPADCALL #20# #21# (QREFELT $ 94))
                                     . #24#))
                              ('T
                               (PROGN
                                (LETT #20# #21# . #24#)
                                (LETT #19# 'T . #24#)))))))
                          (LETT #22# (CDR #22#) . #24#) #26=(GO G190) G191
                          (EXIT NIL))
                     (COND (#19# #20#) (#23# (|IdentityError| '|setUnion|))))
                    . #24#)
              (LETT |vl|
                    (PROGN
                     (LETT #18# NIL . #24#)
                     (SEQ (LETT |vv| NIL . #24#) (LETT #17# |lvint| . #24#)
                          G190
                          (COND
                           ((OR (ATOM #17#)
                                (PROGN (LETT |vv| (CAR #17#) . #24#) NIL))
                            #25#))
                          (SEQ
                           (EXIT
                            (LETT #18#
                                  (CONS (SPADCALL |vv| (QREFELT $ 112)) #18#)
                                  . #24#)))
                          (LETT #17# (CDR #17#) . #24#) #26# G191
                          (EXIT (NREVERSE0 #18#))))
                    . #24#)
              (LETT |nvar|
                    (PROGN
                     (LETT #16# NIL . #24#)
                     (SEQ (LETT |i| 1 . #24#) G190
                          (COND ((QSGREATERP |i| |nf|) #25#))
                          (SEQ
                           (EXIT
                            (LETT #16# (CONS (SPADCALL (QREFELT $ 118)) #16#)
                                  . #24#)))
                          (LETT |i| (QSADD1 |i|) . #24#) #26# G191
                          (EXIT (NREVERSE0 #16#))))
                    . #24#)
              (LETT |VarSet1|
                    (|OrderedVariableList|
                     (SPADCALL |vl| |nvar| (QREFELT $ 120)))
                    . #24#)
              (LETT |lv1|
                    (PROGN
                     (LETT #15# NIL . #24#)
                     (SEQ (LETT |vv| NIL . #24#) (LETT #14# |nvar| . #24#) G190
                          (COND
                           ((OR (ATOM #14#)
                                (PROGN (LETT |vv| (CAR #14#) . #24#) NIL))
                            #25#))
                          (SEQ
                           (EXIT
                            (LETT #15#
                                  (CONS
                                   (PROG2
                                       (LETT #13#
                                             (SPADCALL |vv|
                                                       (|compiledLookupCheck|
                                                        '|variable|
                                                        (LIST
                                                         (LIST '|Union| '$
                                                               '"failed")
                                                         (LIST '|Symbol|))
                                                        |VarSet1|))
                                             . #24#)
                                       (QCDR #13#)
                                     (|check-union| (QEQCAR #13# 0) |VarSet1|
                                                    #13#))
                                   #15#)
                                  . #24#)))
                          (LETT #14# (CDR #14#) . #24#) #26# G191
                          (EXIT (NREVERSE0 #15#))))
                    . #24#)
              (LETT |DirP| (|DirectProduct| |nf| (|NonNegativeInteger|))
                    . #24#)
              (LETT |nExponent| (|Product| (QREFELT $ 7) |DirP|) . #24#)
              (LETT |nPoly| (|PolynomialRing| (QREFELT $ 6) |nExponent|)
                    . #24#)
              (LETT |gp|
                    (|GroebnerPackage| (QREFELT $ 6) |nExponent| |VarSet1|
                                       |nPoly|)
                    . #24#)
              (LETT |lf| NIL . #24#) (LETT |lp| NIL . #24#)
              (SEQ (LETT |i| 1 . #24#) (LETT |f| NIL . #24#)
                   (LETT #12# |listf| . #24#) G190
                   (COND
                    ((OR (ATOM #12#) (PROGN (LETT |f| (CAR #12#) . #24#) NIL))
                     #25#))
                   (SEQ (LETT |vec2| (SPADCALL |nf| 0 (QREFELT $ 122)) . #24#)
                        (SPADCALL |vec2| |i| 1 (QREFELT $ 123))
                        (LETT |g|
                              (SPADCALL
                               (|compiledLookupCheck| '|Zero| (LIST '$)
                                                      |nPoly|))
                              . #24#)
                        (LETT |pol| (|spadConstant| $ 124) . #24#)
                        (SEQ G190
                             (COND
                              ((NULL
                                (COND
                                 ((SPADCALL |f| (|spadConstant| $ 13)
                                            (QREFELT $ 15))
                                  'NIL)
                                 ('T 'T)))
                               #25#))
                             (SEQ
                              (LETT |df|
                                    (SPADCALL
                                     (SPADCALL |f|
                                               (SPADCALL |f| (QREFELT $ 24))
                                               (QREFELT $ 108))
                                     |lvint| (QREFELT $ 126))
                                    . #24#)
                              (LETT |lcf| (SPADCALL |f| (QREFELT $ 17)) . #24#)
                              (LETT |pol|
                                    (SPADCALL |pol|
                                              (|IDEAL;monompol| |df| |lcf|
                                               |lvint| $)
                                              (QREFELT $ 127))
                                    . #24#)
                              (LETT |g|
                                    (SPADCALL |g|
                                              (SPADCALL |lcf|
                                                        (SPADCALL
                                                         (SPADCALL |f|
                                                                   (QREFELT $
                                                                            20))
                                                         (SPADCALL
                                                          (|compiledLookupCheck|
                                                           '|Zero| (LIST '$)
                                                           |DirP|))
                                                         (|compiledLookupCheck|
                                                          '|makeprod|
                                                          (LIST '$
                                                                (|devaluate|
                                                                 (ELT $ 7))
                                                                (|devaluate|
                                                                 |DirP|))
                                                          |nExponent|))
                                                        (|compiledLookupCheck|
                                                         '|monomial|
                                                         (LIST '$
                                                               (|devaluate|
                                                                (ELT $ 6))
                                                               (|devaluate|
                                                                |nExponent|))
                                                         |nPoly|))
                                              (|compiledLookupCheck| '+
                                                                     (LIST '$
                                                                           '$
                                                                           '$)
                                                                     |nPoly|))
                                    . #24#)
                              (EXIT
                               (LETT |f| (SPADCALL |f| (QREFELT $ 24))
                                     . #24#)))
                             NIL #26# G191 (EXIT NIL))
                        (LETT |lp| (CONS |pol| |lp|) . #24#)
                        (EXIT
                         (LETT |lf|
                               (CONS
                                (SPADCALL
                                 (SPADCALL (|spadConstant| $ 48)
                                           (SPADCALL (|spadConstant| $ 19)
                                                     (SPADCALL |vec2|
                                                               (|compiledLookupCheck|
                                                                '|directProduct|
                                                                (LIST '$
                                                                      (LIST
                                                                       '|Vector|
                                                                       (LIST
                                                                        '|NonNegativeInteger|)))
                                                                |DirP|))
                                                     (|compiledLookupCheck|
                                                      '|makeprod|
                                                      (LIST '$
                                                            (|devaluate|
                                                             (ELT $ 7))
                                                            (|devaluate|
                                                             |DirP|))
                                                      |nExponent|))
                                           (|compiledLookupCheck| '|monomial|
                                                                  (LIST '$
                                                                        (|devaluate|
                                                                         (ELT $
                                                                              6))
                                                                        (|devaluate|
                                                                         |nExponent|))
                                                                  |nPoly|))
                                 |g|
                                 (|compiledLookupCheck| '- (LIST '$ '$ '$)
                                                        |nPoly|))
                                |lf|)
                               . #24#)))
                   (LETT #12# (PROG1 (CDR #12#) (LETT |i| (QSADD1 |i|) . #24#))
                         . #24#)
                   #26# G191 (EXIT NIL))
              (LETT |npol|
                    (PROGN
                     (LETT #11# NIL . #24#)
                     (SEQ (LETT |v| NIL . #24#) (LETT #10# |nvar| . #24#) G190
                          (COND
                           ((OR (ATOM #10#)
                                (PROGN (LETT |v| (CAR #10#) . #24#) NIL))
                            #25#))
                          (SEQ
                           (EXIT
                            (LETT #11#
                                  (CONS (SPADCALL |v| (QREFELT $ 128)) #11#)
                                  . #24#)))
                          (LETT #10# (CDR #10#) . #24#) #26# G191
                          (EXIT (NREVERSE0 #11#))))
                    . #24#)
              (LETT |leq|
                    (PROGN
                     (LETT #9# NIL . #24#)
                     (SEQ (LETT |pol| NIL . #24#)
                          (LETT #8# (REVERSE |lp|) . #24#)
                          (LETT |p| NIL . #24#) (LETT #7# |npol| . #24#) G190
                          (COND
                           ((OR (ATOM #7#)
                                (PROGN (LETT |p| (CAR #7#) . #24#) NIL)
                                (ATOM #8#)
                                (PROGN (LETT |pol| (CAR #8#) . #24#) NIL))
                            #25#))
                          (SEQ
                           (EXIT
                            (LETT #9#
                                  (CONS (SPADCALL |p| |pol| (QREFELT $ 130))
                                        #9#)
                                  . #24#)))
                          (LETT #7#
                                (PROG1 (CDR #7#) (LETT #8# (CDR #8#) . #24#))
                                . #24#)
                          #26# G191 (EXIT (NREVERSE0 #9#))))
                    . #24#)
              (LETT |lf|
                    (SPADCALL |lf|
                              (|compiledLookupCheck| '|groebner|
                                                     (LIST
                                                      (LIST '|List|
                                                            (|devaluate|
                                                             |nPoly|))
                                                      (LIST '|List|
                                                            (|devaluate|
                                                             |nPoly|)))
                                                     |gp|))
                    . #24#)
              (SEQ
               (EXIT
                (SEQ G190
                     (COND
                      ((NULL
                        (COND
                         ((SPADCALL |lf| NIL
                                    (|compiledLookupCheck| '=
                                                           (LIST
                                                            (LIST '|Boolean|)
                                                            '$ '$)
                                                           (|List| |nPoly|)))
                          'NIL)
                         ('T 'T)))
                       #25#))
                     (SEQ (LETT |q| (|SPADfirst| |lf|) . #24#)
                          (LETT |dq|
                                (SPADCALL |q|
                                          (|compiledLookupCheck| '|degree|
                                                                 (LIST
                                                                  (|devaluate|
                                                                   |nExponent|)
                                                                  '$)
                                                                 |nPoly|))
                                . #24#)
                          (LETT |n|
                                (SPADCALL |dq|
                                          (|compiledLookupCheck| '|selectfirst|
                                                                 (LIST
                                                                  (|devaluate|
                                                                   (ELT $ 7))
                                                                  '$)
                                                                 |nExponent|))
                                . #24#)
                          (COND
                           ((SPADCALL |n| (|spadConstant| $ 19)
                                      (QREFELT $ 131))
                            (PROGN (LETT #6# "done" . #24#) (GO #6#))))
                          (EXIT (LETT |lf| (CDR |lf|) . #24#)))
                     NIL #26# G191 (EXIT NIL)))
               #6# (EXIT #6#))
              (LETT |solsn| NIL . #24#)
              (SEQ (LETT |q| NIL . #24#) (LETT #5# |lf| . #24#) G190
                   (COND
                    ((OR (ATOM #5#) (PROGN (LETT |q| (CAR #5#) . #24#) NIL))
                     #25#))
                   (SEQ (LETT |g| (|spadConstant| $ 124) . #24#)
                        (SEQ G190
                             (COND
                              ((NULL
                                (COND
                                 ((SPADCALL |q|
                                            (SPADCALL
                                             (|compiledLookupCheck| '|Zero|
                                                                    (LIST '$)
                                                                    |nPoly|))
                                            (|compiledLookupCheck| '=
                                                                   (LIST
                                                                    (LIST
                                                                     '|Boolean|)
                                                                    '$ '$)
                                                                   |nPoly|))
                                  'NIL)
                                 ('T 'T)))
                               #25#))
                             (SEQ
                              (LETT |dq|
                                    (SPADCALL |q|
                                              (|compiledLookupCheck| '|degree|
                                                                     (LIST
                                                                      (|devaluate|
                                                                       |nExponent|)
                                                                      '$)
                                                                     |nPoly|))
                                    . #24#)
                              (LETT |lcq|
                                    (SPADCALL |q|
                                              (|compiledLookupCheck|
                                               '|leadingCoefficient|
                                               (LIST (|devaluate| (ELT $ 6))
                                                     '$)
                                               |nPoly|))
                                    . #24#)
                              (LETT |q|
                                    (SPADCALL |q|
                                              (|compiledLookupCheck|
                                               '|reductum| (LIST '$ '$)
                                               |nPoly|))
                                    . #24#)
                              (LETT |vdq|
                                    (SPADCALL |dq|
                                              (|compiledLookupCheck|
                                               '|selectsecond|
                                               (LIST (|devaluate| |DirP|) '$)
                                               |nExponent|))
                                    . #24#)
                              (EXIT
                               (LETT |g|
                                     (SPADCALL |g|
                                               (SPADCALL |lcq|
                                                         (PROGN
                                                          (LETT #1# NIL . #24#)
                                                          (SEQ
                                                           (LETT |j| 1 . #24#)
                                                           (LETT |p| NIL
                                                                 . #24#)
                                                           (LETT #4# |npol|
                                                                 . #24#)
                                                           G190
                                                           (COND
                                                            ((OR (ATOM #4#)
                                                                 (PROGN
                                                                  (LETT |p|
                                                                        (CAR
                                                                         #4#)
                                                                        . #24#)
                                                                  NIL))
                                                             #25#))
                                                           (SEQ
                                                            (EXIT
                                                             (PROGN
                                                              (LETT #3#
                                                                    (SPADCALL
                                                                     |p|
                                                                     (SPADCALL
                                                                      |vdq| |j|
                                                                      (QREFELT
                                                                       $ 132))
                                                                     (QREFELT $
                                                                              133))
                                                                    . #24#)
                                                              (COND
                                                               (#1#
                                                                (LETT #2#
                                                                      (SPADCALL
                                                                       #2# #3#
                                                                       (QREFELT
                                                                        $ 134))
                                                                      . #24#))
                                                               ('T
                                                                (PROGN
                                                                 (LETT #2# #3#
                                                                       . #24#)
                                                                 (LETT #1# 'T
                                                                       . #24#)))))))
                                                           (LETT #4#
                                                                 (PROG1
                                                                     (CDR #4#)
                                                                   (LETT |j|
                                                                         (QSADD1
                                                                          |j|)
                                                                         . #24#))
                                                                 . #24#)
                                                           #26# G191
                                                           (EXIT NIL))
                                                          (COND (#1# #2#)
                                                                ('T
                                                                 (|spadConstant|
                                                                  $ 135))))
                                                         (QREFELT $ 136))
                                               (QREFELT $ 127))
                                     . #24#)))
                             NIL #26# G191 (EXIT NIL))
                        (EXIT (LETT |solsn| (CONS |g| |solsn|) . #24#)))
                   (LETT #5# (CDR #5#) . #24#) #26# G191 (EXIT NIL))
              (EXIT (SPADCALL |solsn| |leq| (QREFELT $ 117)))))))))) 

(DEFUN |IDEAL;coerce;L$;31| (|Id| $) (CONS |Id| 'NIL)) 

(DEFUN |IDEAL;coerce;$Of;32| (I $)
  (PROG (|Idl|)
    (RETURN
     (SEQ (LETT |Idl| (QCAR I) |IDEAL;coerce;$Of;32|)
          (EXIT
           (COND
            ((NULL |Idl|)
             (SPADCALL (LIST (|spadConstant| $ 13)) (QREFELT $ 139)))
            ('T (SPADCALL |Idl| (QREFELT $ 139))))))))) 

(DEFUN |IDEAL;ideal;L$;33| (|Id| $)
  (PROG (#1=#:G2151 |f| #2=#:G2150)
    (RETURN
     (SEQ
      (CONS
       (PROGN
        (LETT #2# NIL . #3=(|IDEAL;ideal;L$;33|))
        (SEQ (LETT |f| NIL . #3#) (LETT #1# |Id| . #3#) G190
             (COND
              ((OR (ATOM #1#) (PROGN (LETT |f| (CAR #1#) . #3#) NIL))
               (GO G191)))
             (SEQ
              (EXIT
               (COND
                ((COND
                  ((SPADCALL |f| (|spadConstant| $ 13) (QREFELT $ 15)) 'NIL)
                  ('T 'T))
                 (LETT #2# (CONS |f| #2#) . #3#)))))
             (LETT #1# (CDR #1#) . #3#) (GO G190) G191 (EXIT (NREVERSE0 #2#))))
       'NIL))))) 

(DEFUN |IDEAL;groebnerIdeal;L$;34| (|Id| $) (CONS |Id| 'T)) 

(PUT '|IDEAL;generators;$L;35| '|SPADreplace| 'QCAR) 

(DEFUN |IDEAL;generators;$L;35| (I $) (QCAR I)) 

(PUT '|IDEAL;groebner?;$B;36| '|SPADreplace| 'QCDR) 

(DEFUN |IDEAL;groebner?;$B;36| (I $) (QCDR I)) 

(DEFUN |IDEAL;one?;$B;37| (I $)
  (SPADCALL (|spadConstant| $ 49) I (QREFELT $ 73))) 

(DEFUN |IDEAL;zero?;$B;38| (I $) (NULL (QCAR (SPADCALL I (QREFELT $ 70))))) 

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

(DEFUN |PolynomialIdeals;| (|#1| |#2| |#3| |#4|)
  (PROG (|pv$| $ |dv$| DV$4 DV$3 DV$2 DV$1)
    (RETURN
     (PROGN
      (LETT DV$1 (|devaluate| |#1|) . #1=(|PolynomialIdeals|))
      (LETT DV$2 (|devaluate| |#2|) . #1#)
      (LETT DV$3 (|devaluate| |#3|) . #1#)
      (LETT DV$4 (|devaluate| |#4|) . #1#)
      (LETT |dv$| (LIST '|PolynomialIdeals| DV$1 DV$2 DV$3 DV$4) . #1#)
      (LETT $ (GETREFV 148) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3
                (LETT |pv$|
                      (|buildPredVector| 0 0
                                         (LIST
                                          (|HasCategory| |#3|
                                                         '(|ConvertibleTo|
                                                           (|Symbol|)))))
                      . #1#))
      (|haddProp| |$ConstructorCache| '|PolynomialIdeals|
                  (LIST DV$1 DV$2 DV$3 DV$4) (CONS 1 $))
      (|stuffDomainSlots| $)
      (QSETREFV $ 6 |#1|)
      (QSETREFV $ 7 |#2|)
      (QSETREFV $ 8 |#3|)
      (QSETREFV $ 9 |#4|)
      (QSETREFV $ 10
                (|Record| (|:| |idl| (|List| |#4|)) (|:| |isGr| (|Boolean|))))
      (QSETREFV $ 11 (|Product| (|NonNegativeInteger|) |#2|))
      (QSETREFV $ 12 (|PolynomialRing| |#1| (QREFELT $ 11)))
      (COND
       ((|testBitVector| |pv$| 1)
        (PROGN
         (QSETREFV $ 137
                   (CONS (|dispatchFunction| |IDEAL;relationsIdeal;LSt;30|)
                         $)))))
      $)))) 

(MAKEPROP '|PolynomialIdeals| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
              (|local| |#3|) (|local| |#4|) '|Rep| '|newExpon| '|newPoly|
              (0 . |Zero|) (|Boolean|) (4 . =) (10 . |Zero|)
              (14 . |leadingCoefficient|) (19 . |Zero|) (23 . |Zero|)
              (27 . |degree|) (|NonNegativeInteger|) (32 . |makeprod|)
              (38 . |monomial|) (44 . |reductum|) (49 . +) (55 . =)
              (61 . |degree|) (66 . |selectfirst|) (71 . |reductum|)
              (76 . |leadingCoefficient|) (81 . |selectsecond|)
              (86 . |monomial|) (92 . +) (|List| 8) (98 . |variables|)
              (103 . =) (|SparseUnivariatePolynomial| $) (109 . |univariate|)
              (|SparseUnivariatePolynomial| 9) (115 . |leadingCoefficient|)
              (|Union| $ '"failed") (120 . |exquo|) (|List| 12)
              (|GroebnerPackage| 6 11 8 12) (126 . |groebner|)
              (131 . |member?|) (137 . |ground?|) (142 . |One|) (146 . |One|)
              (|Integer|) (150 . |elt|) (|List| 34) (156 . |concat|) (|List| 9)
              |IDEAL;generators;$L;35| (162 . |One|) (166 . |One|)
              (|Product| 21 7) (170 . |One|) (174 . |One|) (178 . |position|)
              (184 . |delete|) (190 . |#|) (195 . <) (|Mapping| 14 34 34)
              (201 . |sort|) (207 . |setDifference|) |IDEAL;in?;2$B;12|
              |IDEAL;=;2$B;10| |IDEAL;groebner;2$;13|
              (|GroebnerPackage| 6 7 8 9) (213 . |normalForm|)
              |IDEAL;element?;DPoly$B;11| (219 . |zero?|) (224 . |groebner|)
              (229 . -) (235 . *) (241 . |concat|) |IDEAL;intersect;3$;14|
              (|List| $) |IDEAL;intersect;L$;15| |IDEAL;coerce;L$;31|
              (|GroebnerInternalPackage| 6 7 8 9) (247 . |minGbasis|)
              |IDEAL;quotient;$DPoly$;16| |IDEAL;ideal;L$;33|
              |IDEAL;quotient;3$;17| (252 . |concat|) |IDEAL;+;3$;18| (258 . *)
              |IDEAL;*;3$;19| |IDEAL;^;$Nni$;20| |IDEAL;saturate;$DPoly$;21|
              (264 . |setUnion|) (270 . |monomial|) (277 . |eval|)
              |IDEAL;saturate;$DPolyL$;22| (284 . =) (|Union| 8 '"failed")
              (290 . |mainVariable|) |IDEAL;zeroDim?;$LB;23|
              |IDEAL;zeroDim?;$B;24| (295 . |normalForm|)
              |IDEAL;inRadical?;DPoly$B;25| |IDEAL;leadingIdeal;2$;28|
              |IDEAL;dimension;$LI;26| |IDEAL;dimension;$I;27| (301 . -)
              (|Polynomial| 6) (307 . |coerce|) (|Symbol|) (312 . |convert|)
              (317 . |monomial|) (|List| 109) (|List| 129) (|SuchThat| 114 115)
              (324 . |construct|) (330 . |new|) (|List| 111) (334 . |concat|)
              (|Vector| 21) (340 . |new|) (346 . |setelt|) (353 . |Zero|)
              (|List| 21) (357 . |degree|) (363 . +) (369 . |coerce|)
              (|Equation| 109) (374 . =) (380 . =) (386 . |elt|) (392 . ^)
              (398 . *) (404 . |One|) (408 . *) (414 . |relationsIdeal|)
              (|OutputForm|) (419 . |coerce|) |IDEAL;coerce;$Of;32|
              |IDEAL;groebnerIdeal;L$;34| |IDEAL;groebner?;$B;36|
              |IDEAL;one?;$B;37| |IDEAL;zero?;$B;38|
              (|Record| (|:| |mval| (|Matrix| 6)) (|:| |invmval| (|Matrix| 6))
                        (|:| |genIdeal| $))
              (|SingleInteger|) (|String|))
           '#(~= 424 |zeroDim?| 430 |zero?| 441 |saturate| 446 |relationsIdeal|
              459 |quotient| 464 |one?| 476 |leadingIdeal| 481 |latex| 486
              |intersect| 491 |inRadical?| 502 |in?| 508 |ideal| 514 |hash| 519
              |groebnerIdeal| 524 |groebner?| 529 |groebner| 534 |generators|
              539 |generalPosition| 544 |element?| 550 |dimension| 556 |coerce|
              567 |backOldPos| 577 ^ 582 = 588 + 594 * 600)
           'NIL
           (CONS (|makeByteWordVec2| 1 '(0 0 0))
                 (CONS '#(|SetCategory&| |BasicType&| NIL)
                       (CONS
                        '#((|SetCategory|) (|BasicType|) (|CoercibleTo| 138))
                        (|makeByteWordVec2| 147
                                            '(0 9 0 13 2 9 14 0 0 15 0 12 0 16
                                              1 9 6 0 17 0 6 0 18 0 7 0 19 1 9
                                              7 0 20 2 11 0 21 7 22 2 12 0 6 11
                                              23 1 9 0 0 24 2 12 0 0 0 25 2 12
                                              14 0 0 26 1 12 11 0 27 1 11 21 0
                                              28 1 12 0 0 29 1 12 6 0 30 1 11 7
                                              0 31 2 9 0 6 7 32 2 9 0 0 0 33 1
                                              9 34 0 35 2 34 14 0 0 36 2 9 37 0
                                              8 38 1 39 9 0 40 2 9 41 0 0 42 1
                                              44 43 43 45 2 34 14 8 0 46 1 9 14
                                              0 47 0 6 0 48 0 9 0 49 2 34 8 0
                                              50 51 2 52 0 0 0 53 0 11 0 56 0
                                              12 0 57 0 58 0 59 0 21 0 60 2 34
                                              50 8 0 61 2 34 0 0 50 62 1 34 21
                                              0 63 2 21 14 0 0 64 2 52 0 65 0
                                              66 2 34 0 0 0 67 2 71 9 9 54 72 1
                                              9 14 0 74 1 71 54 54 75 2 12 0 0
                                              0 76 2 12 0 0 0 77 2 43 0 0 0 78
                                              1 83 54 54 84 2 54 0 0 0 88 2 9 0
                                              0 0 90 2 34 0 0 0 94 3 9 0 0 8 21
                                              95 3 9 0 0 34 80 96 2 54 14 0 0
                                              98 1 9 99 0 100 2 44 12 12 43 103
                                              2 9 0 0 0 108 1 109 0 6 110 1 8
                                              111 0 112 3 109 0 0 111 21 113 2
                                              116 0 114 115 117 0 111 0 118 2
                                              119 0 0 0 120 2 121 0 21 21 122 3
                                              121 21 0 50 21 123 0 109 0 124 2
                                              9 125 0 34 126 2 109 0 0 0 127 1
                                              109 0 111 128 2 129 0 109 109 130
                                              2 7 14 0 0 131 2 121 21 0 50 132
                                              2 109 0 0 21 133 2 109 0 0 0 134
                                              0 109 0 135 2 109 0 6 0 136 1 0
                                              116 54 137 1 54 138 0 139 2 0 14
                                              0 0 1 2 0 14 0 34 101 1 0 14 0
                                              102 1 0 14 0 144 3 0 0 0 9 34 97
                                              2 0 0 0 9 93 1 1 116 54 137 2 0 0
                                              0 0 87 2 0 0 0 9 85 1 0 14 0 143
                                              1 0 0 0 105 1 0 147 0 1 2 0 0 0 0
                                              79 1 0 0 80 81 2 0 14 9 0 104 2 0
                                              14 0 0 68 1 0 0 54 86 1 0 146 0 1
                                              1 0 0 54 141 1 0 14 0 142 1 0 0 0
                                              70 1 0 54 0 55 2 0 145 0 34 1 2 0
                                              14 9 0 73 1 0 50 0 107 2 0 50 0
                                              34 106 1 0 0 54 82 1 0 138 0 140
                                              1 0 0 145 1 2 0 0 0 21 92 2 0 14
                                              0 0 69 2 0 0 0 0 89 2 0 0 0 0
                                              91)))))
           '|lookupComplete|)) 
