
(/VERSIONCHECK 2) 

(DEFUN |GB;monicize| (|p| $)
  (PROG (|lc|)
    (RETURN
      (SEQ (LETT |lc| (SPADCALL |p| (QREFELT $ 10)) |GB;monicize|)
           (EXIT (COND
                   ((SPADCALL |lc| (|spadConstant| $ 11)
                        (QREFELT $ 14))
                    |p|)
                   ('T
                    (SPADCALL (SPADCALL |lc| (QREFELT $ 15)) |p|
                        (QREFELT $ 16))))))))) 

(DEFUN |GB;normalForm;DpolLDpol;2| (|p| |l| $)
  (SPADCALL |p|
      (SPADCALL (CONS (|function| |GB;monicize|) $) |l| (QREFELT $ 19))
      (QREFELT $ 21))) 

(DEFUN |GB;groebner;2L;3| (|Pol| $)
  (PROG (#0=#:G1824 |x| #1=#:G1825)
    (RETURN
      (SEQ (COND
             ((SPADCALL |Pol| NIL (QREFELT $ 23)) |Pol|)
             (#2='T
              (SEQ (LETT |Pol|
                         (PROGN
                           (LETT #0# NIL . #3=(|GB;groebner;2L;3|))
                           (SEQ (LETT |x| NIL . #3#)
                                (LETT #1# |Pol| . #3#) G190
                                (COND
                                  ((OR (ATOM #1#)
                                    (PROGN
                                      (LETT |x| (CAR #1#) . #3#)
                                      NIL))
                                   (GO G191)))
                                (SEQ (EXIT
                                      (COND
                                        ((COND
                                           ((SPADCALL |x|
                                             (|spadConstant| $ 26)
                                             (QREFELT $ 27))
                                            'NIL)
                                           (#2# 'T))
                                         (LETT #0#
                                          (CONS |x| #0#) . #3#)))))
                                (LETT #1# (CDR #1#) . #3#) (GO G190)
                                G191 (EXIT (NREVERSE0 #0#)))) . #3#)
                   (EXIT (COND
                           ((SPADCALL |Pol| NIL (QREFELT $ 23))
                            (LIST (|spadConstant| $ 26)))
                           (#2#
                            (SPADCALL
                                (SPADCALL
                                    (CONS #'|GB;groebner;2L;3!0| $)
                                    (SPADCALL |Pol| 0 0 (QREFELT $ 31))
                                    (QREFELT $ 33))
                                (QREFELT $ 34)))))))))))) 

(DEFUN |GB;groebner;2L;3!0| (|#1| |#2| $)
  (SPADCALL (SPADCALL |#2| (QREFELT $ 28))
      (SPADCALL |#1| (QREFELT $ 28)) (QREFELT $ 29))) 

(DEFUN |GB;groebner;LSL;4| (|Pol| |xx1| $)
  (PROG (#0=#:G1830 |x| #1=#:G1831)
    (RETURN
      (SEQ (COND
             ((SPADCALL |Pol| NIL (QREFELT $ 23)) |Pol|)
             (#2='T
              (SEQ (LETT |Pol|
                         (PROGN
                           (LETT #0# NIL . #3=(|GB;groebner;LSL;4|))
                           (SEQ (LETT |x| NIL . #3#)
                                (LETT #1# |Pol| . #3#) G190
                                (COND
                                  ((OR (ATOM #1#)
                                    (PROGN
                                      (LETT |x| (CAR #1#) . #3#)
                                      NIL))
                                   (GO G191)))
                                (SEQ (EXIT
                                      (COND
                                        ((COND
                                           ((SPADCALL |x|
                                             (|spadConstant| $ 26)
                                             (QREFELT $ 27))
                                            'NIL)
                                           (#2# 'T))
                                         (LETT #0#
                                          (CONS |x| #0#) . #3#)))))
                                (LETT #1# (CDR #1#) . #3#) (GO G190)
                                G191 (EXIT (NREVERSE0 #0#)))) . #3#)
                   (EXIT (COND
                           ((SPADCALL |Pol| NIL (QREFELT $ 23))
                            (LIST (|spadConstant| $ 26)))
                           ((EQUAL |xx1| "redcrit")
                            (SPADCALL
                                (SPADCALL
                                    (CONS #'|GB;groebner;LSL;4!0| $)
                                    (SPADCALL |Pol| 1 0 (QREFELT $ 31))
                                    (QREFELT $ 33))
                                (QREFELT $ 34)))
                           ((EQUAL |xx1| "info")
                            (SPADCALL
                                (SPADCALL
                                    (CONS #'|GB;groebner;LSL;4!1| $)
                                    (SPADCALL |Pol| 2 1 (QREFELT $ 31))
                                    (QREFELT $ 33))
                                (QREFELT $ 34)))
                           (#2#
                            (SEQ (SPADCALL "   " (QREFELT $ 39))
                                 (SPADCALL
                                     "WARNING: options are - redcrit and/or info - "
                                     (QREFELT $ 39))
                                 (SPADCALL
                                     "         you didn't type them correct"
                                     (QREFELT $ 39))
                                 (SPADCALL "         please try again"
                                     (QREFELT $ 39))
                                 (SPADCALL "   " (QREFELT $ 39))
                                 (EXIT NIL)))))))))))) 

(DEFUN |GB;groebner;LSL;4!1| (|#1| |#2| $)
  (SPADCALL (SPADCALL |#2| (QREFELT $ 28))
      (SPADCALL |#1| (QREFELT $ 28)) (QREFELT $ 29))) 

(DEFUN |GB;groebner;LSL;4!0| (|#1| |#2| $)
  (SPADCALL (SPADCALL |#2| (QREFELT $ 28))
      (SPADCALL |#1| (QREFELT $ 28)) (QREFELT $ 29))) 

(DEFUN |GB;groebner;L2SL;5| (|Pol| |xx1| |xx2| $)
  (PROG (#0=#:G1836 |x| #1=#:G1837)
    (RETURN
      (SEQ (COND
             ((SPADCALL |Pol| NIL (QREFELT $ 23)) |Pol|)
             (#2='T
              (SEQ (LETT |Pol|
                         (PROGN
                           (LETT #0# NIL . #3=(|GB;groebner;L2SL;5|))
                           (SEQ (LETT |x| NIL . #3#)
                                (LETT #1# |Pol| . #3#) G190
                                (COND
                                  ((OR (ATOM #1#)
                                    (PROGN
                                      (LETT |x| (CAR #1#) . #3#)
                                      NIL))
                                   (GO G191)))
                                (SEQ (EXIT
                                      (COND
                                        ((COND
                                           ((SPADCALL |x|
                                             (|spadConstant| $ 26)
                                             (QREFELT $ 27))
                                            'NIL)
                                           (#2# 'T))
                                         (LETT #0#
                                          (CONS |x| #0#) . #3#)))))
                                (LETT #1# (CDR #1#) . #3#) (GO G190)
                                G191 (EXIT (NREVERSE0 #0#)))) . #3#)
                   (EXIT (COND
                           ((SPADCALL |Pol| NIL (QREFELT $ 23))
                            (LIST (|spadConstant| $ 26)))
                           (#2#
                            (SEQ (COND
                                   ((EQUAL |xx1| "redcrit")
                                    (COND
                                      ((EQUAL |xx2| "info")
                                       (EXIT
                                        (SPADCALL
                                         (SPADCALL
                                          (CONS
                                           #'|GB;groebner;L2SL;5!0| $)
                                          (SPADCALL |Pol| 1 1
                                           (QREFELT $ 31))
                                          (QREFELT $ 33))
                                         (QREFELT $ 34))))
                                      ((EQUAL |xx1| "info")
                                       (COND
                                         ((EQUAL |xx2| "redcrit")
                                          (EXIT
                                           (SPADCALL
                                            (SPADCALL
                                             (CONS
                                              #'|GB;groebner;L2SL;5!1|
                                              $)
                                             (SPADCALL |Pol| 1 1
                                              (QREFELT $ 31))
                                             (QREFELT $ 33))
                                            (QREFELT $ 34))))))))
                                   ((EQUAL |xx1| "info")
                                    (COND
                                      ((EQUAL |xx2| "redcrit")
                                       (EXIT
                                        (SPADCALL
                                         (SPADCALL
                                          (CONS
                                           #'|GB;groebner;L2SL;5!2| $)
                                          (SPADCALL |Pol| 1 1
                                           (QREFELT $ 31))
                                          (QREFELT $ 33))
                                         (QREFELT $ 34)))))))
                                 (COND
                                   ((EQUAL |xx1| "redcrit")
                                    (COND
                                      ((EQUAL |xx2| "redcrit")
                                       (EXIT
                                        (SPADCALL
                                         (SPADCALL
                                          (CONS
                                           #'|GB;groebner;L2SL;5!3| $)
                                          (SPADCALL |Pol| 1 0
                                           (QREFELT $ 31))
                                          (QREFELT $ 33))
                                         (QREFELT $ 34)))))))
                                 (COND
                                   ((EQUAL |xx1| "info")
                                    (COND
                                      ((EQUAL |xx2| "info")
                                       (EXIT
                                        (SPADCALL
                                         (SPADCALL
                                          (CONS
                                           #'|GB;groebner;L2SL;5!4| $)
                                          (SPADCALL |Pol| 2 1
                                           (QREFELT $ 31))
                                          (QREFELT $ 33))
                                         (QREFELT $ 34)))))))
                                 (SPADCALL "   " (QREFELT $ 39))
                                 (SPADCALL
                                     "WARNING:  options are - redcrit and/or info - "
                                     (QREFELT $ 39))
                                 (SPADCALL
                                     "          you didn't type them correctly"
                                     (QREFELT $ 39))
                                 (SPADCALL
                                     "          please try again "
                                     (QREFELT $ 39))
                                 (SPADCALL "   " (QREFELT $ 39))
                                 (EXIT NIL)))))))))))) 

(DEFUN |GB;groebner;L2SL;5!4| (|#1| |#2| $)
  (SPADCALL (SPADCALL |#2| (QREFELT $ 28))
      (SPADCALL |#1| (QREFELT $ 28)) (QREFELT $ 29))) 

(DEFUN |GB;groebner;L2SL;5!3| (|#1| |#2| $)
  (SPADCALL (SPADCALL |#2| (QREFELT $ 28))
      (SPADCALL |#1| (QREFELT $ 28)) (QREFELT $ 29))) 

(DEFUN |GB;groebner;L2SL;5!2| (|#1| |#2| $)
  (SPADCALL (SPADCALL |#2| (QREFELT $ 28))
      (SPADCALL |#1| (QREFELT $ 28)) (QREFELT $ 29))) 

(DEFUN |GB;groebner;L2SL;5!1| (|#1| |#2| $)
  (SPADCALL (SPADCALL |#2| (QREFELT $ 28))
      (SPADCALL |#1| (QREFELT $ 28)) (QREFELT $ 29))) 

(DEFUN |GB;groebner;L2SL;5!0| (|#1| |#2| $)
  (SPADCALL (SPADCALL |#2| (QREFELT $ 28))
      (SPADCALL |#1| (QREFELT $ 28)) (QREFELT $ 29))) 

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

(DEFUN |GroebnerPackage;| (|#1| |#2| |#3| |#4|)
  (PROG (DV$1 DV$2 DV$3 DV$4 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|) . #0=(|GroebnerPackage|))
        (LETT DV$2 (|devaluate| |#2|) . #0#)
        (LETT DV$3 (|devaluate| |#3|) . #0#)
        (LETT DV$4 (|devaluate| |#4|) . #0#)
        (LETT |dv$|
              (LIST '|GroebnerPackage| DV$1 DV$2 DV$3 DV$4) . #0#)
        (LETT $ (GETREFV 42) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3
            (LETT |pv$|
                  (|buildPredVector| 0 0
                      (LIST (|HasCategory| |#1| '(|Field|)))) . #0#))
        (|haddProp| |$ConstructorCache| '|GroebnerPackage|
            (LIST DV$1 DV$2 DV$3 DV$4) (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (QSETREFV $ 7 |#2|)
        (QSETREFV $ 8 |#3|)
        (QSETREFV $ 9 |#4|)
        (COND
          ((|testBitVector| |pv$| 1)
           (PROGN
             (QSETREFV $ 22
                 (CONS (|dispatchFunction| |GB;normalForm;DpolLDpol;2|)
                       $)))))
        $)))) 

(MAKEPROP '|GroebnerPackage| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
             (|local| |#3|) (|local| |#4|) (0 . |leadingCoefficient|)
             (5 . |One|) (9 . |One|) (|Boolean|) (13 . =) (19 . |inv|)
             (24 . *) (|Mapping| 9 9) (|List| 9) (30 . |map|)
             (|GroebnerInternalPackage| 6 7 8 9) (36 . |redPol|)
             (42 . |normalForm|) (48 . =) (54 . |Zero|) (58 . |Zero|)
             (62 . |Zero|) (66 . =) (72 . |degree|) (77 . <)
             (|Integer|) (83 . |gbasis|) (|Mapping| 13 9 9)
             (90 . |sort|) (96 . |minGbasis|) |GB;groebner;2L;3|
             (|Void|) (|String|) (|OutputForm|) (101 . |messagePrint|)
             |GB;groebner;LSL;4| |GB;groebner;L2SL;5|)
          '#(|normalForm| 106 |groebner| 112) 'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 41
                                '(1 9 6 0 10 0 6 0 11 0 9 0 12 2 6 13 0
                                  0 14 1 6 0 0 15 2 9 0 6 0 16 2 18 0
                                  17 0 19 2 20 9 9 18 21 2 0 9 9 18 22
                                  2 18 13 0 0 23 0 6 0 24 0 7 0 25 0 9
                                  0 26 2 9 13 0 0 27 1 9 7 0 28 2 7 13
                                  0 0 29 3 20 18 18 30 30 31 2 18 0 32
                                  0 33 1 20 18 18 34 1 38 36 37 39 2 1
                                  9 9 18 22 2 0 18 18 37 40 1 0 18 18
                                  35 3 0 18 18 37 37 41)))))
          '|lookupComplete|)) 
