
(/VERSIONCHECK 2) 

(DEFUN |FRIDEAL;One;$;1| ($)
  (CONS (VECTOR (|spadConstant| $ 15)) (|spadConstant| $ 12))) 

(PUT '|FRIDEAL;numer;$V;2| '|SPADreplace| 'QCAR) 

(DEFUN |FRIDEAL;numer;$V;2| (|i| $) (QCAR |i|)) 

(PUT '|FRIDEAL;denom;$R;3| '|SPADreplace| 'QCDR) 

(DEFUN |FRIDEAL;denom;$R;3| (|i| $) (QCDR |i|)) 

(PUT '|FRIDEAL;mkIdeal| '|SPADreplace| 'CONS) 

(DEFUN |FRIDEAL;mkIdeal| (|v| |d| $) (CONS |v| |d|)) 

(DEFUN |FRIDEAL;invrep| (|m| $)
  (SPADCALL
      (SPADCALL (SPADCALL |m| (QREFELT $ 20))
          (SPADCALL (|spadConstant| $ 15) (QREFELT $ 22))
          (QREFELT $ 23))
      (QREFELT $ 24))) 

(DEFUN |FRIDEAL;upmat| (|x| |i| $)
  (SPADCALL (CONS #'|FRIDEAL;upmat!0| (VECTOR $ |i|))
      (SPADCALL |x| (QREFELT $ 27)) (QREFELT $ 31))) 

(DEFUN |FRIDEAL;upmat!0| (|#1| $$)
  (SPADCALL |#1| (QREFELT $$ 1) (QREFELT (QREFELT $$ 0) 26))) 

(DEFUN |FRIDEAL;ret?| (|v| $)
  (SPADCALL (CONS #'|FRIDEAL;ret?!0| $) |v| (QREFELT $ 36))) 

(DEFUN |FRIDEAL;ret?!0| (|#1| $)
  (QEQCAR (SPADCALL |#1| (QREFELT $ 33)) 0)) 

(DEFUN |FRIDEAL;=;2$B;8| (|x| |y| $)
  (COND
    ((SPADCALL (SPADCALL |x| (QREFELT $ 18))
         (SPADCALL |y| (QREFELT $ 18)) (QREFELT $ 37))
     (SPADCALL (SPADCALL |x| (QREFELT $ 17))
         (SPADCALL |y| (QREFELT $ 17)) (QREFELT $ 38)))
    ('T 'NIL))) 

(DEFUN |FRIDEAL;agcd| (|l| $)
  (PROG (#0=#:G1846 |a| #1=#:G1847)
    (RETURN
      (SEQ (SPADCALL (ELT $ 41)
               (PROGN
                 (LETT #0# NIL . #2=(|FRIDEAL;agcd|))
                 (SEQ (LETT |a| NIL . #2#) (LETT #1# |l| . #2#) G190
                      (COND
                        ((OR (ATOM #1#)
                             (PROGN (LETT |a| (CAR #1#) . #2#) NIL))
                         (GO G191)))
                      (SEQ (EXIT (LETT #0#
                                       (CONS
                                        (|FRIDEAL;vgcd|
                                         (SPADCALL |a| (QREFELT $ 22))
                                         $)
                                        #0#) . #2#)))
                      (LETT #1# (CDR #1#) . #2#) (GO G190) G191
                      (EXIT (NREVERSE0 #0#))))
               (|spadConstant| $ 40) (QREFELT $ 44)))))) 

(DEFUN |FRIDEAL;norm;$F;10| (|i| $)
  (PROG (|u| #0=#:G1858 #1=#:G1856 #2=#:G1854 #3=#:G1855)
    (RETURN
      (SEQ (SPADCALL
               (PROGN
                 (LETT #3# NIL . #4=(|FRIDEAL;norm;$F;10|))
                 (SEQ (LETT |u| NIL . #4#)
                      (LETT #0#
                            (SPADCALL
                                (SPADCALL (|FRIDEAL;summat| |i| $)
                                    (QREFELT $ 45))
                                (QREFELT $ 47)) . #4#)
                      G190
                      (COND
                        ((OR (ATOM #0#)
                             (PROGN (LETT |u| (CAR #0#) . #4#) NIL))
                         (GO G191)))
                      (SEQ (EXIT (PROGN
                                   (LETT #1#
                                    (SPADCALL |u| (QREFELT $ 48)) . #4#)
                                   (COND
                                     (#3#
                                      (LETT #2#
                                       (SPADCALL #2# #1#
                                        (QREFELT $ 41)) . #4#))
                                     ('T
                                      (PROGN
                                        (LETT #2# #1# . #4#)
                                        (LETT #3# 'T . #4#)))))))
                      (LETT #0# (CDR #0#) . #4#) (GO G190) G191
                      (EXIT NIL))
                 (COND (#3# #2#) ('T (|spadConstant| $ 40))))
               (SPADCALL (SPADCALL |i| (QREFELT $ 18))
                   (SPADCALL (QREFELT $ 50)) (QREFELT $ 51))
               (QREFELT $ 52)))))) 

(DEFUN |FRIDEAL;tryRange| (|range| |nm| |nrm| |i| $)
  (PROG (|j| |a| #0=#:G1866 #1=#:G1871 #2=#:G1868)
    (RETURN
      (SEQ (EXIT (SEQ (SEQ (LETT |j| 0 . #3=(|FRIDEAL;tryRange|)) G190
                           (COND ((QSGREATERP |j| 10) (GO G191)))
                           (SEQ (EXIT (SEQ
                                       (LETT |a|
                                        (SPADCALL
                                         (SPADCALL 10 |range|
                                          (QREFELT $ 54))
                                         |nm| (QREFELT $ 55)) . #3#)
                                       (EXIT
                                        (COND
                                          ((SPADCALL
                                            (SPADCALL
                                             (PROG2
                                              (LETT #0#
                                               (SPADCALL
                                                (SPADCALL
                                                 (SPADCALL |a|
                                                  (QREFELT $ 56))
                                                 (QREFELT $ 48))
                                                |nrm| (QREFELT $ 58)) . #3#)
                                              (QCDR #0#)
                                               (|check-union|
                                                (QEQCAR #0# 0)
                                                (QREFELT $ 6) #0#))
                                             |nrm| (QREFELT $ 41))
                                            (QREFELT $ 59))
                                           (PROGN
                                             (LETT #2#
                                              (PROGN
                                                (LETT #1#
                                                 (CONS 0
                                                  (|FRIDEAL;intIdeal|
                                                   (LIST
                                                    (SPADCALL
                                                     (SPADCALL |nrm|
                                                      (QREFELT $ 60))
                                                     (QREFELT $ 61))
                                                    |a|)
                                                   (SPADCALL |i|
                                                    (QREFELT $ 18))
                                                   $)) . #3#)
                                                (GO #1#)) . #3#)
                                             (GO #2#)))))))
                                #2# (EXIT #2#))
                           (LETT |j| (QSADD1 |j|) . #3#) (GO G190) G191
                           (EXIT NIL))
                      (EXIT (CONS 1 "failed"))))
           #1# (EXIT #1#))))) 

(DEFUN |FRIDEAL;summat| (|i| $)
  (PROG (|v| |m| #0=#:G1877 |j| #1=#:G1878)
    (RETURN
      (SEQ (LETT |m|
                 (SPADCALL
                     (LETT |v| (SPADCALL |i| (QREFELT $ 17))
                           . #2=(|FRIDEAL;summat|))
                     (QREFELT $ 63)) . #2#)
           (EXIT (SPADCALL (ELT $ 65)
                     (PROGN
                       (LETT #0# NIL . #2#)
                       (SEQ (LETT |j| 0 . #2#)
                            (LETT #1# (- (QVSIZE |v|) 1) . #2#) G190
                            (COND ((QSGREATERP |j| #1#) (GO G191)))
                            (SEQ (EXIT (LETT #0#
                                        (CONS
                                         (|FRIDEAL;upmat|
                                          (SPADCALL |v| (+ |j| |m|)
                                           (QREFELT $ 64))
                                          |j| $)
                                         #0#) . #2#)))
                            (LETT |j| (QSADD1 |j|) . #2#) (GO G190)
                            G191 (EXIT (NREVERSE0 #0#))))
                     (QREFELT $ 68))))))) 

(DEFUN |FRIDEAL;inv;2$;13| (|i| $)
  (PROG (#0=#:G1887 |m| |cd| |cd2| |invd| #1=#:G1901 |p| #2=#:G1902 |d|
            #3=#:G1903 |j|)
    (RETURN
      (SEQ (LETT |m|
                 (PROG2 (LETT #0#
                              (SPADCALL
                                  (SPADCALL
                                      (CONS #'|FRIDEAL;inv;2$;13!0| $)
                                      (|FRIDEAL;summat| |i| $)
                                      (QREFELT $ 74))
                                  (QREFELT $ 75))
                              . #4=(|FRIDEAL;inv;2$;13|))
                        (QCDR #0#)
                   (|check-union| (QEQCAR #0# 0)
                       (|Matrix| (|Fraction| (QREFELT $ 8))) #0#)) . #4#)
           (LETT |cd|
                 (SPADCALL
                     (SPADCALL
                         (SPADCALL
                             (SPADCALL
                                 (SPADCALL
                                     (SPADCALL |i| (QREFELT $ 18))
                                     (QREFELT $ 60))
                                 (QREFELT $ 76))
                             (QREFELT $ 70))
                         |m| (QREFELT $ 77))
                     (QREFELT $ 80)) . #4#)
           (LETT |cd2|
                 (SPADCALL (SPADCALL (QCDR |cd|) (QREFELT $ 47))
                     (QREFELT $ 83)) . #4#)
           (LETT |invd|
                 (SPADCALL (QCDR |cd2|)
                     (SPADCALL (ELT $ 41) (QCAR |cd2|) (QREFELT $ 84))
                     (QREFELT $ 52)) . #4#)
           (LETT |d|
                 (SPADCALL (ELT $ 88)
                     (PROGN
                       (LETT #1# NIL . #4#)
                       (SEQ (LETT |p| NIL . #4#)
                            (LETT #2#
                                  (SPADCALL (QCAR |cd|) (QREFELT $ 86)) . #4#)
                            G190
                            (COND
                              ((OR (ATOM #2#)
                                   (PROGN
                                     (LETT |p| (CAR #2#) . #4#)
                                     NIL))
                               #5=(GO G191)))
                            (SEQ (EXIT (LETT #1#
                                        (CONS
                                         (SPADCALL |p| (QREFELT $ 87))
                                         #1#) . #4#)))
                            (LETT #2# (CDR #2#) . #4#) #6=(GO G190)
                            G191 (EXIT (NREVERSE0 #1#))))
                     (QREFELT $ 91)) . #4#)
           (EXIT (SPADCALL
                     (PRIMVEC2ARR
                         (PROGN
                           (LETT #3# (GETREFV (QSADD1 |d|)) . #4#)
                           (SEQ (LETT |j| 0 . #4#) G190
                                (COND ((QSGREATERP |j| |d|) #5#))
                                (SEQ (EXIT
                                      (SETELT #3# |j|
                                       (SPADCALL |invd|
                                        (|FRIDEAL;invrep|
                                         (SPADCALL
                                          (CONS #'|FRIDEAL;inv;2$;13!1|
                                           (VECTOR $ |j|))
                                          (QCAR |cd|) (QREFELT $ 95))
                                         $)
                                        (QREFELT $ 96)))))
                                (LETT |j| (QSADD1 |j|) . #4#) #6# G191
                                (EXIT NIL))
                           #3#))
                     (QREFELT $ 97))))))) 

(DEFUN |FRIDEAL;inv;2$;13!1| (|#1| $$)
  (SPADCALL |#1| (QREFELT $$ 1) (QREFELT (QREFELT $$ 0) 92))) 

(DEFUN |FRIDEAL;inv;2$;13!0| (|#1| $) (SPADCALL |#1| (QREFELT $ 70))) 

(DEFUN |FRIDEAL;ideal;V$;14| (|v| $)
  (PROG (#0=#:G1909 #1=#:G1910 |d| #2=#:G1911 |i| #3=#:G1912)
    (RETURN
      (SEQ (LETT |d|
                 (SPADCALL (ELT $ 101)
                     (PROGN
                       (LETT #0# NIL . #4=(|FRIDEAL;ideal;V$;14|))
                       (SEQ (LETT |i|
                                  (SPADCALL |v| (QREFELT $ 63)) . #4#)
                            (LETT #1# (QVSIZE |v|) . #4#) G190
                            (COND ((> |i| #1#) #5=(GO G191)))
                            (SEQ (EXIT (LETT #0#
                                        (CONS
                                         (SPADCALL
                                          (SPADCALL
                                           (SPADCALL |v| |i|
                                            (QREFELT $ 64))
                                           (QREFELT $ 22))
                                          (QREFELT $ 100))
                                         #0#) . #4#)))
                            (LETT |i| (+ |i| 1) . #4#) #6=(GO G190)
                            G191 (EXIT (NREVERSE0 #0#))))
                     (QREFELT $ 84)) . #4#)
           (EXIT (|FRIDEAL;intIdeal|
                     (PROGN
                       (LETT #2# NIL . #4#)
                       (SEQ (LETT |i|
                                  (SPADCALL |v| (QREFELT $ 63)) . #4#)
                            (LETT #3# (QVSIZE |v|) . #4#) G190
                            (COND ((> |i| #3#) #5#))
                            (SEQ (EXIT (LETT #2#
                                        (CONS
                                         (SPADCALL
                                          (SPADCALL |d| (QREFELT $ 60))
                                          (SPADCALL |v| |i|
                                           (QREFELT $ 64))
                                          (QREFELT $ 96))
                                         #2#) . #4#)))
                            (LETT |i| (+ |i| 1) . #4#) #6# G191
                            (EXIT (NREVERSE0 #2#))))
                     |d| $)))))) 

(DEFUN |FRIDEAL;intIdeal| (|l| |d| $)
  (PROG (|x| #0=#:G1925 |u| |lr| |nr| |r| |g| |b| |a| |invb| #1=#:G1926
             #2=#:G1927 |m| #3=#:G1928 |va|)
    (RETURN
      (SEQ (LETT |lr| NIL . #4=(|FRIDEAL;intIdeal|))
           (LETT |nr| NIL . #4#)
           (SEQ (LETT |x| NIL . #4#)
                (LETT #0# (SPADCALL |l| (QREFELT $ 103)) . #4#) G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |x| (CAR #0#) . #4#) NIL))
                   #5=(GO G191)))
                (SEQ (LETT |u| (SPADCALL |x| (QREFELT $ 33)) . #4#)
                     (EXIT (COND
                             ((QEQCAR |u| 0)
                              (LETT |lr|
                                    (CONS
                                     (SPADCALL (QCDR |u|)
                                      (QREFELT $ 48))
                                     |lr|) . #4#))
                             ('T (LETT |nr| (CONS |x| |nr|) . #4#)))))
                (LETT #0# (CDR #0#) . #4#) #6=(GO G190) G191
                (EXIT NIL))
           (LETT |r|
                 (SPADCALL (ELT $ 41) |lr| (|spadConstant| $ 40)
                     (QREFELT $ 44)) . #4#)
           (LETT |g| (|FRIDEAL;agcd| |nr| $) . #4#)
           (LETT |a|
                 (SPADCALL
                     (SPADCALL
                         (SPADCALL |r|
                             (LETT |b|
                                   (SPADCALL
                                    (SPADCALL |d| |r| (QREFELT $ 41))
                                    |g| (QREFELT $ 41)) . #4#)
                             (QREFELT $ 105))
                         (QREFELT $ 60))
                     (QREFELT $ 61)) . #4#)
           (LETT |d| (SPADCALL |d| |b| (QREFELT $ 105)) . #4#)
           (COND
             ((NULL (SPADCALL |r| (|spadConstant| $ 40) (QREFELT $ 37)))
              (COND
                ((QEQCAR (SPADCALL |g| |r| (QREFELT $ 58)) 0)
                 (EXIT (|FRIDEAL;mkIdeal| (VECTOR |a|) |d| $))))))
           (LETT |invb|
                 (SPADCALL (SPADCALL |b| (QREFELT $ 60))
                     (QREFELT $ 106)) . #4#)
           (LETT |va|
                 (PRIMVEC2ARR
                     (PROGN
                       (LETT #1# (GETREFV (SIZE |nr|)) . #4#)
                       (SEQ (LETT #2# 0 . #4#) (LETT |m| NIL . #4#)
                            (LETT #3# |nr| . #4#) G190
                            (COND
                              ((OR (ATOM #3#)
                                   (PROGN
                                     (LETT |m| (CAR #3#) . #4#)
                                     NIL))
                               #5#))
                            (SEQ (EXIT (SETELT #1# #2#
                                        (SPADCALL |invb| |m|
                                         (QREFELT $ 96)))))
                            (LETT #3#
                                  (PROG1 (CDR #3#)
                                    (LETT #2# (QSADD1 #2#) . #4#)) . #4#)
                            #6# G191 (EXIT NIL))
                       #1#)) . #4#)
           (EXIT (COND
                   ((SPADCALL |a| (QREFELT $ 107))
                    (|FRIDEAL;mkIdeal| |va| |d| $))
                   ('T
                    (|FRIDEAL;mkIdeal|
                        (SPADCALL |a| |va| (QREFELT $ 108)) |d| $)))))))) 

(DEFUN |FRIDEAL;vgcd| (|v| $)
  (PROG (#0=#:G1932 |i| #1=#:G1933)
    (RETURN
      (SEQ (SPADCALL (ELT $ 41)
               (PROGN
                 (LETT #0# NIL . #2=(|FRIDEAL;vgcd|))
                 (SEQ (LETT |i| (SPADCALL |v| (QREFELT $ 109)) . #2#)
                      (LETT #1# (QVSIZE |v|) . #2#) G190
                      (COND ((> |i| #1#) (GO G191)))
                      (SEQ (EXIT (LETT #0#
                                       (CONS
                                        (SPADCALL
                                         (SPADCALL |v| |i|
                                          (QREFELT $ 110))
                                         (QREFELT $ 48))
                                        #0#) . #2#)))
                      (LETT |i| (+ |i| 1) . #2#) (GO G190) G191
                      (EXIT (NREVERSE0 #0#))))
               (QREFELT $ 84)))))) 

(DEFUN |FRIDEAL;poly| (|i| $)
  (PROG (|v| |m| #0=#:G1939 #1=#:G1936 #2=#:G1934 #3=#:G1935)
    (RETURN
      (SEQ (LETT |m|
                 (SPADCALL
                     (LETT |v| (SPADCALL |i| (QREFELT $ 17))
                           . #4=(|FRIDEAL;poly|))
                     (QREFELT $ 63)) . #4#)
           (EXIT (PROGN
                   (LETT #3# NIL . #4#)
                   (SEQ (LETT |i| 0 . #4#)
                        (LETT #0# (- (QVSIZE |v|) 1) . #4#) G190
                        (COND ((QSGREATERP |i| #0#) (GO G191)))
                        (SEQ (EXIT (PROGN
                                     (LETT #1#
                                      (SPADCALL
                                       (SPADCALL |v| (+ |i| |m|)
                                        (QREFELT $ 64))
                                       |i| (QREFELT $ 112)) . #4#)
                                     (COND
                                       (#3#
                                        (LETT #2#
                                         (SPADCALL #2# #1#
                                          (QREFELT $ 113)) . #4#))
                                       ('T
                                        (PROGN
                                          (LETT #2# #1# . #4#)
                                          (LETT #3# 'T . #4#)))))))
                        (LETT |i| (QSADD1 |i|) . #4#) (GO G190) G191
                        (EXIT NIL))
                   (COND (#3# #2#) ('T (|spadConstant| $ 114))))))))) 

(DEFUN |FRIDEAL;*;3$;18| (|i1| |i2| $)
  (|FRIDEAL;intIdeal|
      (SPADCALL
          (SPADCALL (|FRIDEAL;poly| |i1| $) (|FRIDEAL;poly| |i2| $)
              (QREFELT $ 115))
          (QREFELT $ 116))
      (SPADCALL (SPADCALL |i1| (QREFELT $ 18))
          (SPADCALL |i2| (QREFELT $ 18)) (QREFELT $ 117))
      $)) 

(DEFUN |FRIDEAL;**;$I$;19| (|i| |m| $)
  (PROG (#0=#:G1942 |n| |v| #1=#:G1946 |j| #2=#:G1947)
    (RETURN
      (SEQ (COND
             ((< |m| 0)
              (SPADCALL (SPADCALL |i| (QREFELT $ 98)) (- |m|)
                  (QREFELT $ 119)))
             ('T
              (SEQ (LETT |n|
                         (PROG1 (LETT #0# |m|
                                      . #3=(|FRIDEAL;**;$I$;19|))
                           (|check-subtype| (>= #0# 0)
                               '(|NonNegativeInteger|) #0#)) . #3#)
                   (LETT |v| (SPADCALL |i| (QREFELT $ 17)) . #3#)
                   (EXIT (|FRIDEAL;intIdeal|
                             (PROGN
                               (LETT #1# NIL . #3#)
                               (SEQ (LETT |j|
                                     (SPADCALL |v| (QREFELT $ 63)) . #3#)
                                    (LETT #2# (QVSIZE |v|) . #3#) G190
                                    (COND ((> |j| #2#) (GO G191)))
                                    (SEQ
                                     (EXIT
                                      (LETT #1#
                                       (CONS
                                        (SPADCALL
                                         (SPADCALL |v| |j|
                                          (QREFELT $ 64))
                                         |n| (QREFELT $ 120))
                                        #1#) . #3#)))
                                    (LETT |j| (+ |j| 1) . #3#)
                                    (GO G190) G191
                                    (EXIT (NREVERSE0 #1#))))
                             (SPADCALL (SPADCALL |i| (QREFELT $ 18))
                                 |n| (QREFELT $ 121))
                             $))))))))) 

(DEFUN |FRIDEAL;num2O| (|v| $)
  (PROG (#0=#:G1950 |i| #1=#:G1951)
    (RETURN
      (SEQ (SPADCALL
               (PROGN
                 (LETT #0# NIL . #2=(|FRIDEAL;num2O|))
                 (SEQ (LETT |i| (SPADCALL |v| (QREFELT $ 63)) . #2#)
                      (LETT #1# (QVSIZE |v|) . #2#) G190
                      (COND ((> |i| #1#) (GO G191)))
                      (SEQ (EXIT (LETT #0#
                                       (CONS
                                        (SPADCALL
                                         (SPADCALL |v| |i|
                                          (QREFELT $ 64))
                                         (QREFELT $ 123))
                                        #0#) . #2#)))
                      (LETT |i| (+ |i| 1) . #2#) (GO G190) G191
                      (EXIT (NREVERSE0 #0#))))
               (QREFELT $ 125)))))) 

(DEFUN |FRIDEAL;basis;$V;21| (|i| $)
  (PROG (|v| |d| #0=#:G1956 #1=#:G1957 |j| #2=#:G1958)
    (RETURN
      (SEQ (LETT |v| (SPADCALL |i| (QREFELT $ 17))
                 . #3=(|FRIDEAL;basis;$V;21|))
           (LETT |d|
                 (SPADCALL
                     (SPADCALL (SPADCALL |i| (QREFELT $ 18))
                         (QREFELT $ 60))
                     (QREFELT $ 106)) . #3#)
           (EXIT (PRIMVEC2ARR
                     (PROGN
                       (LETT #0#
                             (GETREFV (QSADD1
                                       (- #4=(QVSIZE |v|)
                                        #5=(SPADCALL |v|
                                            (QREFELT $ 63))))) . #3#)
                       (SEQ (LETT #1# 0 . #3#) (LETT |j| #5# . #3#)
                            (LETT #2# #4# . #3#) G190
                            (COND ((> |j| #2#) (GO G191)))
                            (SEQ (EXIT (SETELT #0# #1#
                                        (SPADCALL |d|
                                         (SPADCALL |v| |j|
                                          (QREFELT $ 64))
                                         (QREFELT $ 96)))))
                            (LETT |j|
                                  (PROG1 (+ |j| 1)
                                    (LETT #1# (QSADD1 #1#) . #3#)) . #3#)
                            (GO G190) G191 (EXIT NIL))
                       #0#))))))) 

(DEFUN |FRIDEAL;coerce;$Of;22| (|i| $)
  (PROG (|nm|)
    (RETURN
      (SEQ (LETT |nm| (|FRIDEAL;num2O| (SPADCALL |i| (QREFELT $ 17)) $)
                 |FRIDEAL;coerce;$Of;22|)
           (EXIT (COND
                   ((SPADCALL (SPADCALL |i| (QREFELT $ 18))
                        (|spadConstant| $ 12) (QREFELT $ 37))
                    |nm|)
                   ('T
                    (SPADCALL
                        (SPADCALL (SPADCALL 1 (QREFELT $ 127))
                            (SPADCALL (SPADCALL |i| (QREFELT $ 18))
                                (QREFELT $ 128))
                            (QREFELT $ 129))
                        |nm| (QREFELT $ 130))))))))) 

(DEFUN |FRIDEAL;randomLC;NniVA;23| (|m| |v| $)
  (PROG (|j| #0=#:G1966 #1=#:G1964 #2=#:G1962 #3=#:G1963)
    (RETURN
      (SEQ (PROGN
             (LETT #3# NIL . #4=(|FRIDEAL;randomLC;NniVA;23|))
             (SEQ (LETT |j| (SPADCALL |v| (QREFELT $ 63)) . #4#)
                  (LETT #0# (QVSIZE |v|) . #4#) G190
                  (COND ((> |j| #0#) (GO G191)))
                  (SEQ (EXIT (PROGN
                               (LETT #1#
                                     (SPADCALL
                                      (SPADCALL (QREFELT $ 132))
                                      (SPADCALL |v| |j| (QREFELT $ 64))
                                      (QREFELT $ 96)) . #4#)
                               (COND
                                 (#3# (LETT #2#
                                       (SPADCALL #2# #1#
                                        (QREFELT $ 133)) . #4#))
                                 ('T
                                  (PROGN
                                    (LETT #2# #1# . #4#)
                                    (LETT #3# 'T . #4#)))))))
                  (LETT |j| (+ |j| 1) . #4#) (GO G190) G191 (EXIT NIL))
             (COND (#3# #2#) ('T (|spadConstant| $ 134)))))))) 

(DEFUN |FRIDEAL;randomLC;NniVA;24| (|m| |v| $)
  (PROG (|j| #0=#:G1971 #1=#:G1969 #2=#:G1967 #3=#:G1968)
    (RETURN
      (SEQ (PROGN
             (LETT #3# NIL . #4=(|FRIDEAL;randomLC;NniVA;24|))
             (SEQ (LETT |j| (SPADCALL |v| (QREFELT $ 63)) . #4#)
                  (LETT #0# (QVSIZE |v|) . #4#) G190
                  (COND ((> |j| #0#) (GO G191)))
                  (SEQ (EXIT (PROGN
                               (LETT #1#
                                     (SPADCALL (RANDOM |m|)
                                      (SPADCALL |v| |j| (QREFELT $ 64))
                                      (QREFELT $ 135)) . #4#)
                               (COND
                                 (#3# (LETT #2#
                                       (SPADCALL #2# #1#
                                        (QREFELT $ 133)) . #4#))
                                 ('T
                                  (PROGN
                                    (LETT #2# #1# . #4#)
                                    (LETT #3# 'T . #4#)))))))
                  (LETT |j| (+ |j| 1) . #4#) (GO G190) G191 (EXIT NIL))
             (COND (#3# #2#) ('T (|spadConstant| $ 134)))))))) 

(DEFUN |FRIDEAL;minimize;2$;25| (|i| $)
  (PROG (|nm| |n| |nrm| |range| |u| #0=#:G1979 #1=#:G1977)
    (RETURN
      (SEQ (EXIT (SEQ (LETT |n|
                            (QVSIZE (LETT |nm|
                                     (SPADCALL |i| (QREFELT $ 17))
                                     . #2=(|FRIDEAL;minimize;2$;25|))) . #2#)
                      (COND
                        ((EQL |n| 1) (EXIT |i|))
                        ((< |n| 3)
                         (COND ((|FRIDEAL;ret?| |nm| $) (EXIT |i|)))))
                      (LETT |nrm|
                            (SPADCALL
                                (SPADCALL
                                    (|FRIDEAL;mkIdeal| |nm|
                                     (|spadConstant| $ 12) $)
                                    (QREFELT $ 53))
                                (QREFELT $ 48)) . #2#)
                      (SEQ (EXIT (SEQ (LETT |range| 1 . #2#) G190
                                      (COND
                                        ((QSGREATERP |range| 5)
                                         (GO G191)))
                                      (SEQ
                                       (LETT |u|
                                        (|FRIDEAL;tryRange| |range|
                                         |nm| |nrm| |i| $) . #2#)
                                       (EXIT
                                        (COND
                                          ((QEQCAR |u| 0)
                                           (PROGN
                                             (LETT #1#
                                              (PROGN
                                                (LETT #0#
                                                 (QCDR |u|) . #2#)
                                                (GO #0#)) . #2#)
                                             (GO #1#))))))
                                      (LETT |range|
                                       (QSADD1 |range|) . #2#)
                                      (GO G190) G191 (EXIT NIL)))
                           #1# (EXIT #1#))
                      (EXIT |i|)))
           #0# (EXIT #0#))))) 

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

(DEFUN |FractionalIdeal;| (|#1| |#2| |#3| |#4|)
  (PROG (DV$1 DV$2 DV$3 DV$4 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|) . #0=(|FractionalIdeal|))
        (LETT DV$2 (|devaluate| |#2|) . #0#)
        (LETT DV$3 (|devaluate| |#3|) . #0#)
        (LETT DV$4 (|devaluate| |#4|) . #0#)
        (LETT |dv$|
              (LIST '|FractionalIdeal| DV$1 DV$2 DV$3 DV$4) . #0#)
        (LETT $ (GETREFV 139) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache| '|FractionalIdeal|
            (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| (|:| |num| (|Vector| |#4|)) (|:| |den| |#1|)))
        (COND
          ((|HasCategory| |#2| '(|Finite|))
           (QSETREFV $ 55
               (CONS (|dispatchFunction| |FRIDEAL;randomLC;NniVA;23|)
                     $)))
          ('T
           (QSETREFV $ 55
               (CONS (|dispatchFunction| |FRIDEAL;randomLC;NniVA;24|)
                     $))))
        $)))) 

(MAKEPROP '|FractionalIdeal| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
             (|local| |#3|) (|local| |#4|) '|Rep|
             (CONS IDENTITY
                   (FUNCALL (|dispatchFunction| |FRIDEAL;One;$;1|) $))
             (0 . |One|) (4 . |One|) (8 . |One|) (12 . |One|)
             (|Vector| 9) |FRIDEAL;numer;$V;2| |FRIDEAL;denom;$R;3|
             (|Matrix| 7) (16 . |transpose|) (|Vector| 7)
             (21 . |coordinates|) (26 . *) (32 . |represents|)
             (|NonNegativeInteger|) (37 . |monomial|)
             (43 . |regularRepresentation|) (|Matrix| 8)
             (|Mapping| 8 7)
             (|MatrixCategoryFunctions2| 7 21 21 19 8 (|Vector| 8)
                 (|Vector| 8) 28)
             (48 . |map|) (|Union| 7 '"failed") (54 . |retractIfCan|)
             (|Boolean|) (|Mapping| 34 9) (59 . |any?|) (65 . =)
             (71 . =) |FRIDEAL;=;2$B;8| (77 . |Zero|) (81 . |gcd|)
             (|Mapping| 6 6 6) (|List| 6) (87 . |reduce|)
             (94 . |determinant|) (|List| 7) (99 . |coefficients|)
             (104 . |retract|) (|PositiveInteger|) (109 . |rank|)
             (113 . **) (119 . /) |FRIDEAL;norm;$F;10| (125 . *)
             (131 . |randomLC|) (137 . |norm|) (|Union| $ '"failed")
             (142 . |exquo|) (148 . |unit?|) (153 . |coerce|)
             (158 . |coerce|) (|Integer|) (163 . |minIndex|)
             (168 . |qelt|) (174 . +) (|Mapping| 28 28 28) (|List| 28)
             (180 . |reduce|) (|Fraction| 8) (186 . |coerce|)
             (|Matrix| 69) (|Mapping| 69 8)
             (|MatrixCategoryFunctions2| 8 (|Vector| 8) (|Vector| 8) 28
                 69 (|Vector| 69) (|Vector| 69) 71)
             (191 . |map|) (197 . |inverse|) (202 . |coerce|) (207 . *)
             (|Record| (|:| |num| 28) (|:| |den| 8))
             (|MatrixCommonDenominator| 8 69)
             (213 . |splitDenominator|)
             (|Record| (|:| |num| 43) (|:| |den| 6))
             (|InnerCommonDenominator| 6 7 43 46)
             (218 . |splitDenominator|) (223 . |reduce|) (|List| 8)
             (229 . |parts|) (234 . |degree|) (239 . |max|)
             (|Mapping| 25 25 25) (|List| 25) (245 . |reduce|)
             (251 . |coefficient|) (|Mapping| 7 8)
             (|MatrixCategoryFunctions2| 8 (|Vector| 8) (|Vector| 8) 28
                 7 21 21 19)
             (257 . |map|) (263 . *) |FRIDEAL;ideal;V$;14|
             |FRIDEAL;inv;2$;13| (|CommonDenominator| 6 7 21)
             (269 . |commonDenominator|) (274 . |lcm|) (|List| 9)
             (280 . |removeDuplicates|) (285 . |Zero|) (289 . |quo|)
             (295 . |inv|) (300 . |zero?|) (305 . |concat|)
             (311 . |minIndex|) (316 . |elt|)
             (|SparseUnivariatePolynomial| 9) (322 . |monomial|)
             (328 . +) (334 . |Zero|) (338 . *) (344 . |coefficients|)
             (349 . *) |FRIDEAL;*;3$;18| |FRIDEAL;**;$I$;19| (355 . **)
             (361 . **) (|OutputForm|) (367 . |coerce|) (|List| $)
             (372 . |paren|) |FRIDEAL;basis;$V;21| (377 . |coerce|)
             (382 . |coerce|) (387 . /) (393 . *)
             |FRIDEAL;coerce;$Of;22| (399 . |random|) (403 . +)
             (409 . |Zero|) (413 . *) |FRIDEAL;minimize;2$;25|
             (|String|) (|SingleInteger|))
          '#(~= 419 |sample| 425 |recip| 429 |randomLC| 434 |one?| 440
             |numer| 445 |norm| 450 |minimize| 455 |latex| 460 |inv|
             465 |ideal| 470 |hash| 475 |denom| 480 |conjugate| 485
             |commutator| 491 |coerce| 497 |basis| 502 ^ 507 |One| 525
             = 529 / 535 ** 541 * 559)
          'NIL
          (CONS (|makeByteWordVec2| 1 '(0 0 0 0 0 0 0))
                (CONS '#(|Group&| |Monoid&| |SemiGroup&| |SetCategory&|
                         |BasicType&| NIL NIL)
                      (CONS '#((|Group|) (|Monoid|) (|SemiGroup|)
                               (|SetCategory|) (|BasicType|)
                               (|unitsKnown|) (|CoercibleTo| 122))
                            (|makeByteWordVec2| 138
                                '(0 6 0 12 0 7 0 13 0 8 0 14 0 9 0 15 1
                                  19 0 0 20 1 9 21 0 22 2 19 21 0 21 23
                                  1 9 0 21 24 2 8 0 7 25 26 1 9 19 0 27
                                  2 30 28 29 19 31 1 9 32 0 33 2 16 34
                                  35 0 36 2 6 34 0 0 37 2 16 34 0 0 38
                                  0 6 0 40 2 6 0 0 0 41 3 43 6 42 0 6
                                  44 1 28 8 0 45 1 8 46 0 47 1 7 6 0 48
                                  0 9 49 50 2 6 0 0 49 51 2 7 0 6 6 52
                                  2 25 0 49 0 54 2 0 9 25 16 55 1 9 7 0
                                  56 2 6 57 0 0 58 1 6 34 0 59 1 7 0 6
                                  60 1 9 0 7 61 1 16 62 0 63 2 16 9 0
                                  62 64 2 28 0 0 0 65 2 67 28 66 0 68 1
                                  69 0 8 70 2 73 71 72 28 74 1 71 57 0
                                  75 1 8 0 7 76 2 71 0 69 0 77 1 79 78
                                  71 80 1 82 81 46 83 2 43 6 42 0 84 1
                                  28 85 0 86 1 8 25 0 87 2 25 0 0 0 88
                                  2 90 25 89 0 91 2 8 7 0 25 92 2 94 19
                                  93 28 95 2 9 0 7 0 96 1 99 6 21 100 2
                                  6 0 0 0 101 1 102 0 0 103 0 7 0 104 2
                                  6 0 0 0 105 1 7 0 0 106 1 9 34 0 107
                                  2 16 0 9 0 108 1 21 62 0 109 2 21 7 0
                                  62 110 2 111 0 9 25 112 2 111 0 0 0
                                  113 0 111 0 114 2 111 0 0 0 115 1 111
                                  102 0 116 2 6 0 0 0 117 2 9 0 0 25
                                  120 2 6 0 0 25 121 1 9 122 0 123 1
                                  122 0 124 125 1 62 122 0 127 1 6 122
                                  0 128 2 122 0 0 0 129 2 122 0 0 0 130
                                  0 7 0 132 2 9 0 0 0 133 0 9 0 134 2 9
                                  0 62 0 135 2 0 34 0 0 1 0 0 0 1 1 0
                                  57 0 1 2 0 9 25 16 55 1 0 34 0 1 1 0
                                  16 0 17 1 0 7 0 53 1 0 0 0 136 1 0
                                  137 0 1 1 0 0 0 98 1 0 0 16 97 1 0
                                  138 0 1 1 0 6 0 18 2 0 0 0 0 1 2 0 0
                                  0 0 1 1 0 122 0 131 1 0 16 0 126 2 0
                                  0 0 62 1 2 0 0 0 25 1 2 0 0 0 49 1 0
                                  0 0 11 2 0 34 0 0 39 2 0 0 0 0 1 2 0
                                  0 0 62 119 2 0 0 0 25 1 2 0 0 0 49 1
                                  2 0 0 0 0 118)))))
          '|lookupComplete|)) 
