
(/VERSIONCHECK 2) 

(DEFUN |IDPAG;-;2$;1| (|x| $)
  (PROG (#1=#:G676 |u| #2=#:G675)
    (RETURN
     (SEQ
      (PROGN
       (LETT #2# NIL . #3=(|IDPAG;-;2$;1|))
       (SEQ (LETT |u| NIL . #3#) (LETT #1# |x| . #3#) G190
            (COND
             ((OR (ATOM #1#) (PROGN (LETT |u| (CAR #1#) . #3#) NIL))
              (GO G191)))
            (SEQ
             (EXIT
              (LETT #2#
                    (CONS (CONS (QCAR |u|) (SPADCALL (QCDR |u|) (QREFELT $ 9)))
                          #2#)
                    . #3#)))
            (LETT #1# (CDR #1#) . #3#) (GO G190) G191
            (EXIT (NREVERSE0 #2#)))))))) 

(DEFUN |IDPAG;*;I2$;2| (|n| |x| $)
  (PROG (|a| #1=#:G682 |u| #2=#:G681)
    (RETURN
     (SEQ
      (COND ((EQL |n| 0) (|spadConstant| $ 11)) ((EQL |n| 1) |x|)
            (#3='T
             (PROGN
              (LETT #2# NIL . #4=(|IDPAG;*;I2$;2|))
              (SEQ (LETT |u| NIL . #4#) (LETT #1# |x| . #4#) G190
                   (COND
                    ((OR (ATOM #1#) (PROGN (LETT |u| (CAR #1#) . #4#) NIL))
                     (GO G191)))
                   (SEQ
                    (EXIT
                     (COND
                      ((SEQ
                        (LETT |a| (SPADCALL |n| (QCDR |u|) (QREFELT $ 14))
                              . #4#)
                        (EXIT
                         (COND
                          ((SPADCALL |a| (|spadConstant| $ 12) (QREFELT $ 16))
                           'NIL)
                          (#3# 'T))))
                       (LETT #2# (CONS (CONS (QCAR |u|) |a|) #2#) . #4#)))))
                   (LETT #1# (CDR #1#) . #4#) (GO G190) G191
                   (EXIT (NREVERSE0 #2#)))))))))) 

(PUT '|IDPAG;qsetrest!| '|SPADreplace| 'RPLACD) 

(DEFUN |IDPAG;qsetrest!| (|l| |e| $) (RPLACD |l| |e|)) 

(DEFUN |IDPAG;-;3$;4| (|x| |y| $)
  (PROG (|res| |end| |endcell| |newcell| |r|)
    (RETURN
     (SEQ
      (COND ((NULL |x|) (SPADCALL |y| (QREFELT $ 10))) ((NULL |y|) |x|)
            (#1='T
             (SEQ (LETT |endcell| NIL . #2=(|IDPAG;-;3$;4|))
                  (LETT |res| NIL . #2#)
                  (SEQ G190
                       (COND
                        ((NULL
                          (COND ((OR (NULL |x|) (NULL |y|)) 'NIL) ('T 'T)))
                         (GO G191)))
                       (SEQ (LETT |newcell| NIL . #2#)
                            (COND
                             ((SPADCALL (QCAR (|SPADfirst| |x|))
                                        (QCAR (|SPADfirst| |y|))
                                        (QREFELT $ 18))
                              (SEQ
                               (LETT |r|
                                     (SPADCALL (QCDR (|SPADfirst| |x|))
                                               (QCDR (|SPADfirst| |y|))
                                               (QREFELT $ 19))
                                     . #2#)
                               (COND
                                ((NULL (SPADCALL |r| (QREFELT $ 20)))
                                 (LETT |newcell|
                                       (CONS
                                        (CONS (QCAR (|SPADfirst| |x|)) |r|)
                                        NIL)
                                       . #2#)))
                               (LETT |x| (CDR |x|) . #2#)
                               (EXIT (LETT |y| (CDR |y|) . #2#))))
                             ((SPADCALL (QCAR (|SPADfirst| |y|))
                                        (QCAR (|SPADfirst| |x|))
                                        (QREFELT $ 21))
                              (SEQ
                               (LETT |newcell| (CONS (|SPADfirst| |x|) NIL)
                                     . #2#)
                               (EXIT (LETT |x| (CDR |x|) . #2#))))
                             ('T
                              (SEQ
                               (LETT |newcell|
                                     (CONS
                                      (CONS (QCAR (|SPADfirst| |y|))
                                            (SPADCALL (QCDR (|SPADfirst| |y|))
                                                      (QREFELT $ 9)))
                                      NIL)
                                     . #2#)
                               (EXIT (LETT |y| (CDR |y|) . #2#)))))
                            (EXIT
                             (COND
                              ((NULL (NULL |newcell|))
                               (COND
                                ((NULL |endcell|)
                                 (SEQ (LETT |res| |newcell| . #2#)
                                      (EXIT (LETT |endcell| |res| . #2#))))
                                ('T
                                 (SEQ (|IDPAG;qsetrest!| |endcell| |newcell| $)
                                      (EXIT
                                       (LETT |endcell| |newcell| . #2#)))))))))
                       NIL (GO G190) G191 (EXIT NIL))
                  (COND
                   ((NULL |x|)
                    (LETT |end| (SPADCALL |y| (QREFELT $ 10)) . #2#))
                   (#1# (LETT |end| |x| . #2#)))
                  (COND ((NULL |res|) (LETT |res| |end| . #2#))
                        (#1# (|IDPAG;qsetrest!| |endcell| |end| $)))
                  (EXIT |res|)))))))) 

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

(DEFUN |IndexedDirectProductAbelianGroup;| (|#1| |#2|)
  (PROG (|pv$| $ |dv$| DV$2 DV$1)
    (RETURN
     (PROGN
      (LETT DV$1 (|devaluate| |#1|) . #1=(|IndexedDirectProductAbelianGroup|))
      (LETT DV$2 (|devaluate| |#2|) . #1#)
      (LETT |dv$| (LIST '|IndexedDirectProductAbelianGroup| DV$1 DV$2) . #1#)
      (LETT $ (GETREFV 32) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#))
      (|haddProp| |$ConstructorCache| '|IndexedDirectProductAbelianGroup|
                  (LIST DV$1 DV$2) (CONS 1 $))
      (|stuffDomainSlots| $)
      (QSETREFV $ 6 |#1|)
      (QSETREFV $ 7 |#2|)
      (QSETREFV $ 8 (|List| (|Record| (|:| |k| |#2|) (|:| |c| |#1|))))
      $)))) 

(MAKEPROP '|IndexedDirectProductAbelianGroup| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL (|IndexedDirectProductAbelianMonoid| 6 7)
              (|local| |#1|) (|local| |#2|) '|Rep| (0 . -) |IDPAG;-;2$;1|
              (5 . |Zero|) (9 . |Zero|) (|Integer|) (13 . *) (|Boolean|)
              (19 . =) |IDPAG;*;I2$;2| (25 . =) (31 . -) (37 . |zero?|)
              (42 . <) |IDPAG;-;3$;4| (|Mapping| 6 6)
              (|Record| (|:| |k| 7) (|:| |c| 6)) (|List| 24)
              (|Union| $ '"failed") (|NonNegativeInteger|) (|PositiveInteger|)
              (|SingleInteger|) (|String|) (|OutputForm|))
           '#(|Zero| 48 - 52 * 63) 'NIL
           (CONS (|makeByteWordVec2| 1 '(0 0 0 0 0 0 0 0))
                 (CONS
                  '#(|AbelianGroup&| NIL |AbelianMonoid&| |AbelianSemiGroup&|
                     NIL |SetCategory&| |BasicType&| NIL)
                  (CONS
                   '#((|AbelianGroup|) (|CancellationAbelianMonoid|)
                      (|AbelianMonoid|) (|AbelianSemiGroup|)
                      (|IndexedDirectProductCategory| 6 7) (|SetCategory|)
                      (|BasicType|) (|CoercibleTo| 31))
                   (|makeByteWordVec2| 22
                                       '(1 6 0 0 9 0 0 0 11 0 6 0 12 2 6 0 13 0
                                         14 2 6 15 0 0 16 2 7 15 0 0 18 2 6 0 0
                                         0 19 1 6 15 0 20 2 7 15 0 0 21 0 0 0
                                         11 1 0 0 0 10 2 0 0 0 0 22 2 0 0 13 0
                                         17)))))
           '|lookupIncomplete|)) 
