
(/VERSIONCHECK 2) 

(DEFPARAMETER |FiniteDivisorCategory;CAT| 'NIL) 

(DEFPARAMETER |FiniteDivisorCategory;AL| 'NIL) 

(DEFUN |FiniteDivisorCategory| (&REST #0=#:G1817)
  (LET (#1=#:G1818)
    (COND
      ((SETQ #1#
             (|assoc| #2=(|devaluateList| #0#)
                      |FiniteDivisorCategory;AL|))
       (CDR #1#))
      (T (SETQ |FiniteDivisorCategory;AL|
               (|cons5| (CONS #2#
                              (SETQ #1#
                                    (APPLY #'|FiniteDivisorCategory;|
                                     #0#)))
                        |FiniteDivisorCategory;AL|))
         #1#)))) 

(DEFUN |FiniteDivisorCategory;| (|t#1| |t#2| |t#3| |t#4|)
  (PROG (#0=#:G1816)
    (RETURN
      (PROG1 (LETT #0#
                   (|sublisV|
                       (PAIR '(|t#1| |t#2| |t#3| |t#4|)
                             (LIST (|devaluate| |t#1|)
                                   (|devaluate| |t#2|)
                                   (|devaluate| |t#3|)
                                   (|devaluate| |t#4|)))
                       (COND
                         (|FiniteDivisorCategory;CAT|)
                         ('T
                          (LETT |FiniteDivisorCategory;CAT|
                                (|Join| (|AbelianGroup|)
                                        (|mkCategory| '|domain|
                                         '(((|ideal|
                                             ((|FractionalIdeal| |t#2|
                                               (|Fraction| |t#2|) |t#3|
                                               |t#4|)
                                              $))
                                            T)
                                           ((|divisor|
                                             ($
                                              (|FractionalIdeal| |t#2|
                                               (|Fraction| |t#2|) |t#3|
                                               |t#4|)))
                                            T)
                                           ((|divisor| ($ |t#4|)) T)
                                           ((|divisor| ($ |t#1| |t#1|))
                                            T)
                                           ((|divisor|
                                             ($ |t#1| |t#1|
                                              (|Integer|)))
                                            T)
                                           ((|decompose|
                                             ((|Record|
                                               (|:| |id|
                                                (|FractionalIdeal|
                                                 |t#2|
                                                 (|Fraction| |t#2|)
                                                 |t#3| |t#4|))
                                               (|:| |principalPart|
                                                |t#4|))
                                              $))
                                            T)
                                           ((|reduce| ($ $)) T)
                                           ((|principal?|
                                             ((|Boolean|) $))
                                            T)
                                           ((|generator|
                                             ((|Union| |t#4| "failed")
                                              $))
                                            T)
                                           ((|divisor|
                                             ($ |t#4| |t#2| |t#2| |t#2|
                                              |t#1|))
                                            T))
                                         NIL
                                         '((|Boolean|) (|Integer|)
                                           (|FractionalIdeal| |t#2|
                                            (|Fraction| |t#2|) |t#3|
                                            |t#4|))
                                         NIL))
                                . #1=(|FiniteDivisorCategory|))))) . #1#)
        (SETELT #0# 0
                (LIST '|FiniteDivisorCategory| (|devaluate| |t#1|)
                      (|devaluate| |t#2|) (|devaluate| |t#3|)
                      (|devaluate| |t#4|))))))) 
