
(/VERSIONCHECK 2) 

(DEFPARAMETER |AbelianMonoidRing;CAT| 'NIL) 

(DEFPARAMETER |AbelianMonoidRing;AL| 'NIL) 

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

(DEFUN |AbelianMonoidRing;| (|t#1| |t#2|)
  (PROG (#0=#:G1817)
    (RETURN
      (PROG1 (LETT #0#
                   (|sublisV|
                       (PAIR '(|t#1| |t#2|)
                             (LIST (|devaluate| |t#1|)
                                   (|devaluate| |t#2|)))
                       (COND
                         (|AbelianMonoidRing;CAT|)
                         ('T
                          (LETT |AbelianMonoidRing;CAT|
                                (|Join| (|Ring|)
                                        (|BiModule| '|t#1| '|t#1|)
                                        (|mkCategory| '|domain|
                                         '(((|leadingCoefficient|
                                             (|t#1| $))
                                            T)
                                           ((|leadingMonomial| ($ $))
                                            T)
                                           ((|degree| (|t#2| $)) T)
                                           ((|map|
                                             ($ (|Mapping| |t#1| |t#1|)
                                              $))
                                            T)
                                           ((|monomial?|
                                             ((|Boolean|) $))
                                            T)
                                           ((|monomial|
                                             ($ |t#1| |t#2|))
                                            T)
                                           ((|reductum| ($ $)) T)
                                           ((|coefficient|
                                             (|t#1| $ |t#2|))
                                            T)
                                           ((/ ($ $ |t#1|))
                                            (|has| |t#1| (|Field|))))
                                         '(((|CommutativeRing|)
                                            (|has| |t#1|
                                             (|CommutativeRing|)))
                                           ((|Algebra| |t#1|)
                                            (|has| |t#1|
                                             (|CommutativeRing|)))
                                           ((|CharacteristicZero|)
                                            (|has| |t#1|
                                             (|CharacteristicZero|)))
                                           ((|CharacteristicNonZero|)
                                            (|has| |t#1|
                                             (|CharacteristicNonZero|)))
                                           ((|IntegralDomain|)
                                            (|has| |t#1|
                                             (|IntegralDomain|)))
                                           ((|Algebra|
                                             (|Fraction| (|Integer|)))
                                            (|has| |t#1|
                                             (|Algebra|
                                              (|Fraction| (|Integer|))))))
                                         '((|Boolean|)) NIL))
                                . #1=(|AbelianMonoidRing|))))) . #1#)
        (SETELT #0# 0
                (LIST '|AbelianMonoidRing| (|devaluate| |t#1|)
                      (|devaluate| |t#2|))))))) 
